hermes-agent/apps
ethernet 0f70aab579 fix(desktop): front the workspace on ⌘N when the selection is already null
New session (⌘N, the sidebar New session row, and the per-worktree "+")
all funnel into `startFreshSessionDraft`, which sets the stored-session
selection to null. Fronting the workspace pane was never done by that
action — it happened as a side effect of `$selectedStoredSessionId.listen`.

Nanostores `.listen` only notifies on an actual value CHANGE, so:

  selected = <id>  -> set null -> changed  -> workspace fronted    (fine)
  selected = null  -> set null -> no change -> listener never runs (dead)

With main already parked on a blank draft and a session tile fronted,
every subsequent new-session gesture created the session but never
revealed it, so it looked like nothing happened at all. Reproduced
deterministically against the running app: 4/4 silent no-ops in that
state, versus a correct reveal when the selection did change.

Extract the listener body as `homeSelectionToWorkspace` and add
`homeFreshDraftToWorkspace`, called explicitly from
`startFreshSessionDraft`. A fresh draft is a primary navigation, so it
applies the homing policy directly instead of depending on a change
notification. Homing is idempotent, so the listener firing as well is
harmless.

The explicit path deliberately does NOT consume the boot-restore
one-shot: that flag is armed for a specific pending resume, and
swallowing it here would let a cold start clobber the persisted active
tab (the ⌘R bug the flag exists to prevent). Covered by its own test.

Unit tests verified RED without the fix and GREEN with it.

Also adds an E2E covering the two-worktree "+" scenario from the report.
That path turns out to be healthy — the spec passes with and without the
fix, and it is labelled as coverage rather than a regression test in its
header. It is kept because it pins the fiddly worktree-lane fixture
(projects registered via the folder-open flow, since a desktop session
does not adopt its launch cwd as a workspace) and would catch a future
change that collapses the two lanes into one session.
2026-07-30 14:42:47 -04:00
..
bootstrap-installer test(installer): pin own-pid adopt for desktop-prewritten update marker 2026-07-30 17:57:13 +07:00
desktop fix(desktop): front the workspace on ⌘N when the selection is already null 2026-07-30 14:42:47 -04:00
shared refactor: drop the shared subpath export, keeping package.json untouched 2026-07-28 03:54:49 -05:00