hermes-agent/apps/desktop/e2e
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
..
boot-failure.spec.ts fix: tool_calls double-encoding on import (#68856) 2026-07-21 18:53:05 +00:00
boot.spec.ts fix: tool_calls double-encoding on import (#68856) 2026-07-21 18:53:05 +00:00
chat.spec.ts fix(desktop): show steer glyph in busy composer (#69612) 2026-07-22 23:29:38 +00:00
correction-session-switch.spec.ts fix(desktop): preserve correction order in session tabs 2026-07-26 05:00:18 -05:00
fix-electron-tracing.ts fix(desktop): address review — overlay a11y, e2e typecheck, nits 2026-07-20 14:37:39 -04:00
fixtures.ts feat(desktop): default UI zoom to Appearance 90% preset 2026-07-28 04:00:55 -05:00
hidden-history-messages.spec.ts fix(timeline): persist typed display events (#69771) 2026-07-23 14:46:24 -04:00
image-attachment-resume.spec.ts fix(desktop): preserve correction order in session tabs 2026-07-26 05:00:18 -05:00
interim-messages.spec.ts test(desktop): add E2E coverage for session lifecycle (#69580) 2026-07-22 22:56:13 +00:00
large-session-resume.spec.ts test(desktop): wait for backfill before the duplicate-count baseline 2026-07-27 01:44:42 -05:00
launch-packaged-app.spec.ts fix: tool_calls double-encoding on import (#68856) 2026-07-21 18:53:05 +00:00
mock-backend-setup.spec.ts fix: tool_calls double-encoding on import (#68856) 2026-07-21 18:53:05 +00:00
mock-server.ts fix(desktop-e2e): end the sidebar background-dot wall-clock race 2026-07-26 00:12:36 -07:00
onboarding.spec.ts fix: tool_calls double-encoding on import (#68856) 2026-07-21 18:53:05 +00:00
queue-turn-boundary.spec.ts fix(desktop): split steer and queue keyboard shortcuts (#69797) 2026-07-23 00:13:58 -04:00
real-session-builder.ts test(desktop): cover attached-image resume end to end 2026-07-24 21:20:52 -05:00
session-compression-and-queue-stop.spec.ts test(desktop): isolate compression from slash completion 2026-07-26 23:34:29 -07:00
sidebar-states.spec.ts fix(desktop-e2e): end the sidebar background-dot wall-clock race 2026-07-26 00:12:36 -07:00
submit-drift.spec.ts test(desktop): cover submit drift through e2e (#69599) 2026-07-22 16:44:54 -04:00
test.ts fix: tool_calls double-encoding on import (#68856) 2026-07-21 18:53:05 +00:00
tile-unread-bug.spec.ts fix(desktop-e2e): poll for the finished-unread dot instead of sampling once 2026-07-26 00:12:36 -07:00
visual-snapshot.ts fix(desktop): link artifacts in E2E summary + upload all screenshots 2026-07-20 11:44:41 -04:00
warm-resume-jitter.spec.ts fix(desktop): expect keep-alive tabs not to repaint on reactivation 2026-07-26 05:11:46 -05:00
worktree-branch-status.spec.ts fix(desktop): separate workspace defaults from live cwd (#69765) 2026-07-23 02:44:26 +00:00
worktree-new-session-tabs.spec.ts fix(desktop): front the workspace on ⌘N when the selection is already null 2026-07-30 14:42:47 -04:00