# Quality Checklist: Quick Session/Window Launch Without Folder Selection

**Change**: 260405-gle4-quick-session-launch
**Generated**: 2026-04-06
**Spec**: `spec.md`

<!--
  AUTO-GENERATED by /fab-continue or /fab-ff at the tasks stage.

  This checklist validates that the IMPLEMENTATION matches the SPEC.
  Items are derived from:
    1. spec.md — every requirement should have coverage
    2. Plan decisions — technical choices should be reflected in code
    3. Project constitution — project-wide quality standards

  Categories below are defaults. Add project-specific categories from config.yaml.
  /fab-continue (review) checks all items. ALL must pass before archiving.
-->

## Functional Completeness
<!-- Every requirement in spec.md has working implementation -->
- [x] CHK-001 Instant session creation — sidebar `+` button calls `executeCreateSessionInstant` immediately without opening any dialog; `createSession(name, cwd)` is called with derived name and `worktreePath` as CWD
- [x] CHK-002 Instant session creation — Cmd+K "Session: Create" action triggers instant creation (not dialog); command palette closes after selection
- [x] CHK-003 "Session: Create at Folder" action exists in Cmd+K palette and opens `CreateSessionDialog` with path pre-filled from `currentWindow.worktreePath`
- [x] CHK-004 "Window: Create at Folder" action exists in Cmd+K palette (only when a session is active) and opens `CreateSessionDialog` in `mode="window"` with `session` prop and `defaultPath` pre-filled
- [x] CHK-005 Dashboard "New Session" card triggers instant session creation (not `CreateSessionDialog`)
- [x] CHK-006 Top-bar breadcrumb dropdown `+ New Session` item triggers instant session creation
- [x] CHK-007 Session name derivation — `deriveInstantSessionName` uses `deriveNameFromPath(worktreePath)`, falls back to `"session"` when result is empty, and deduplicates with `-2`…`-10` suffixes (and `-11` beyond that)
- [x] CHK-008 `CreateSessionDialog` gains `defaultPath?: string` prop — `path` state initializes from `defaultPath ?? ""`; existing callers without the prop are unaffected
- [x] CHK-009 `CreateSessionDialog` gains `mode?: "session" | "window"` prop — in window mode: title is "Create window at folder", session name input is hidden, `handleCreate` calls `createWindow(session, "zsh", cwd)` instead of `createSession`
- [x] CHK-010 Sidebar window `+` button behavior is unchanged — still calls `createWindow(session, "zsh", activeWin?.worktreePath)`
- [x] CHK-011 `deriveNameFromPath` and `toTmuxSafeName` are exported from `create-session-dialog.tsx` and importable in `app.tsx`
- [x] CHK-012 `dialogOpenRef.current` assignment updated to include `showCreateSessionAtFolderDialog` and `showCreateWindowAtFolderDialog` so active-window sync effect is suppressed while those dialogs are open

## Behavioral Correctness
<!-- Changed requirements behave as specified, not as before -->
- [x] CHK-013 Sidebar `+` button now triggers `executeCreateSessionInstant` (previously called `dialogs.openCreateDialog`) — verify `onCreateSession` prop in both desktop and mobile drawer `<Sidebar>` instances points to the instant handler
- [x] CHK-014 Cmd+K "Session: Create" action now triggers instant creation (previously opened `CreateSessionDialog`) — `onSelect` no longer calls `dialogs.openCreateDialog`
- [x] CHK-015 Dashboard `onCreateSession` prop now resolves to `executeCreateSessionInstant` (previously `dialogs.openCreateDialog`)
- [x] CHK-016 TopBar `onCreateSession` prop now resolves to `executeCreateSessionInstant` (previously `dialogs.openCreateDialog`)

## Removal Verification
<!-- Every deprecated requirement is actually gone -->
- [x] CHK-017 `dialogs.openCreateDialog` is no longer called from sidebar `+`, dashboard "New Session", breadcrumb dropdown `+ New Session`, or Cmd+K "Session: Create" — search confirms no remaining call sites for these entry points
- [x] CHK-018 No dead code left behind — previously flagged `showCreateDialog`/`openCreateDialog`/`closeCreateDialog` dead code in `app.tsx` and `use-dialog-state.ts` has been removed; all remaining create-dialog wiring is only in active use (at-folder secondary flows)

## Scenario Coverage
<!-- Key scenarios from spec.md have been exercised -->
- [x] CHK-019 Scenario "Instant session from sidebar `+` with active window": `createSession("run-kit", "/home/user/code/run-kit")` is called; no dialog opens; session appears in sidebar via optimistic ghost
- [x] CHK-020 Scenario "Instant session from Cmd+K with active window": `createSession("api", "/home/user/projects/api")` called; palette closes; no dialog
- [x] CHK-021 Scenario "Name deduplication": given existing sessions `run-kit` and `run-kit-2`, instant creation with `worktreePath=/home/user/code/run-kit` calls `createSession("run-kit-3", ...)`
- [x] CHK-022 Scenario "Fallback name when CWD is root or home": `worktreePath="/"` or `deriveNameFromPath` returns `""` → name is `"session"`; `createSession("session", "/")` called
- [x] CHK-023 Scenario "No active window (dashboard, zero sessions)": `createSession("session")` called with no `cwd` argument; tmux defaults to server CWD
- [x] CHK-024 Scenario "Session: Create at Folder" from Cmd+K: dialog opens with path pre-filled from `currentWindow.worktreePath` (or empty if no active window)
- [x] CHK-025 Scenario "Window: Create at Folder" from Cmd+K: dialog opens in window mode; on confirmation `createWindow(session, "zsh", cwd)` is called
- [x] CHK-026 Scenario "Cmd+K session actions list": both "Session: Create" and "Session: Create at Folder" appear when searching "session" or "create"; "Window: Create at Folder" absent when no session is active
- [x] CHK-027 Scenario "Sidebar window `+` is unchanged": clicking window-level `+` in sidebar still calls `createWindow(session, "zsh", activeWin?.worktreePath)` as before

## Edge Cases & Error Handling
<!-- Error states, boundary conditions, failure modes -->
- [x] CHK-028 `worktreePath` is `undefined` → `deriveInstantSessionName` returns `"session"`; `createSession` called with no `cwd` argument (not empty string)
- [x] CHK-029 `worktreePath` is `"/"` or `"~"` → `deriveNameFromPath` returns `""` → name falls back to `"session"`
- [x] CHK-030 All ten suffixes (`-2` through `-10`) taken → session created with `-11` suffix (best-effort, no error state)
- [x] CHK-031 `executeCreateSessionInstant` uses `useCallback` with `currentWindow` in deps so it reads `worktreePath` at call time, not at render time
- [x] CHK-032 `CreateSessionDialog` opened with `mode="window"` and no `session` prop — verify the component handles this gracefully (should not crash; `createWindow` call would be a no-op or guarded)
- [x] CHK-033 `executeCreateSessionInstant` failure path — error toast is shown on `createSession` rejection, consistent with `executeCreateWindow` pattern

## Code Quality
<!-- Always included. Baseline items when no code_quality config; expanded when config exists -->
- [x] CHK-034 Pattern consistency: new code follows naming and structural patterns of surrounding code in `app.tsx` (mirrors `executeCreateWindow` pattern for `executeCreateSessionInstant`)
- [x] CHK-035 No unnecessary duplication: `deriveNameFromPath` and `toTmuxSafeName` are imported from `create-session-dialog.tsx`, not copied
- [x] CHK-036 Readability and maintainability: `deriveInstantSessionName` is a clearly named, single-purpose helper; logic is not inlined inside `useCallback`
- [x] CHK-037 Frontend type safety: no `as` casts in new code — `defaultPath` and `mode` props are properly typed; type narrowing used where `mode === "window"` guards `createWindow` call
- [x] CHK-038 No magic strings: `"session"` fallback name and `-11` limit are either named constants or clearly commented inline
- [x] CHK-039 No new routes added — this change is frontend-only; verify no new API routes were added to backend without spec justification
- [x] CHK-040 No polling introduced: instant creation uses the existing optimistic/ghost mechanism and SSE stream — no `setInterval` + fetch added
- [x] CHK-041 Go tests pass: `cd app/backend && go test ./...` — no backend changes expected; confirm no regressions
- [x] CHK-042 Frontend type check passes: `cd app/frontend && npx tsc --noEmit`
- [x] CHK-043 Smoke check passes: `just test` (backend + frontend + e2e tests)
- [x] CHK-044 Production build passes: `just build`
- [x] CHK-045 New behavior covered by tests: `sidebar.test.tsx` verifies `onCreateSession` is called on `+` click (not dialog open); `app.test.tsx` verifies "Session: Create" triggers instant creation and "Session: Create at Folder"/"Window: Create at Folder" appear/disappear correctly in palette

## Notes

- Check items as you verify: `- [x]`
- All items must pass before `/fab-continue` (hydrate)
- If an item is not applicable, mark checked and prefix with **N/A**: `- [x] CHK-001 **N/A**: {reason}`
