Skip to content

fix(console): the guide comes back when the last face is deleted - #178

Merged
stormer78 merged 1 commit into
mainfrom
fix/persona-guide-returns
Sep 7, 2026
Merged

fix(console): the guide comes back when the last face is deleted#178
stormer78 merged 1 commit into
mainfrom
fix/persona-guide-returns

Conversation

@stormer78

Copy link
Copy Markdown
Contributor

Caught a minute before it would have bitten, from "will now delete everything to see the guided flow" — which is the first thing anyone does with this pane, and it did not work.

The bug

Deleting your last face left you on the identity map with nothing to draw, and no way back to the guided setup short of reloading the page. Guide-or-map was decided once, when the pane first loaded.

Why it was decided once

Because the naive version is wrong in the other direction. Deriving from faces === 0 on every render flips to the map the instant step two creates a face — past step three, which is the step the whole guide leads to. That one was caught by reading the code in #176; this one needed a person about to use it.

So the rule needs both directions, and now has three terms:

showsGuide = !skipped && (guiding || faces === 0)
  • guiding holds the guide open once it is showing — what step two needs.
  • skipped is sticky for the session: a holder who said they would build it themselves must not be dropped back into the guide by deleting a face, which is a thing they may well do next.
  • faces is nullable, and not loaded is not zero — otherwise the guide flashes at every holder on every load and is yanked away, which is the worst possible first impression of the pane.

Where it lives

persona-flow.ts, a plain module, rather than beside the guide it governs — the guide is .tsx and Node's type stripping cannot load JSX, which is why profile-entries.ts and identity-graph.ts are .ts too.

Seven tests, mutation-checked against both historical versions: reverting to "decide once" fails two of them (a holder with no face is guided, deleting the last face brings the guide back), and reverting to "derive from faces alone" fails another (the guide survives its own second step creating a face).

Neither failure looks like a wrong boolean. Both look like a broken page — which is the argument for it being a tested function rather than three terms inline.

Verification

npm run lint, npm run build, npm test — 843 across four workspaces (+7). All six ci.yml assertions against the real build.

Reported a minute before it would have bitten: "will now delete
everything to see the guided flow". Deleting your last face left you on
a map with nothing to draw and no way back but a page reload, because
guide-or-map was decided once when the pane first loaded.

That decision was itself a fix — deriving it from `faces === 0` on every
render flipped to the map the instant step two created a face, past step
three, which is the step the whole guide leads to. So the rule needs
both directions and now has three terms:

  showsGuide = !skipped && (guiding || faces === 0)

`guiding` holds the guide open once it is showing, which is what step
two needs. `skipped` is sticky for the session, because a holder who
said they would build it themselves must not be dropped back into the
guide by deleting a face — a thing they may well do next. And `faces`
is nullable: not loaded is not zero, or the guide flashes at every
holder on every load.

It lives in `persona-flow.ts` rather than beside the guide, because the
guide is `.tsx` and Node's type stripping cannot load JSX — and this
rule has now been wrong twice, in opposite directions, so it needed to
be somewhere a test can reach. Seven tests, mutation-checked against
both historical versions: deciding once fails two of them, deriving from
faces alone fails another.

Neither failure looks like a wrong boolean. Both look like a broken
page, which is why this is a function and not three terms inline.

Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
@stormer78
stormer78 merged commit 3fb8212 into main Sep 7, 2026
3 checks passed
@stormer78
stormer78 deleted the fix/persona-guide-returns branch September 7, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant