Skip to content

feat(tui): Phase 3B — filter input, post-run auto-exit, context hints - #77

Merged
Exelord merged 1 commit into
mainfrom
claude/tui-phase-3b-polish
May 13, 2026
Merged

feat(tui): Phase 3B — filter input, post-run auto-exit, context hints#77
Exelord merged 1 commit into
mainfrom
claude/tui-phase-3b-polish

Conversation

@Exelord

@Exelord Exelord commented May 13, 2026

Copy link
Copy Markdown
Member

Summary

Phase 3 polish, plus the requested post-run auto-exit behavior:
the TUI now stays on screen for 3 seconds after the run finishes,
showing a countdown popup. Any key press cancels the timer
the TUI stays open until the user explicitly quits with q / Ctrl-C.

Tests: 497 → 506.

Changes

Filter input (/)

  • New filterEditing: boolean in State + startFilterEdit /
    endFilterEdit key actions in the reducer.
  • App's keyboard handler routes printable keys + Backspace + Enter/Esc
    to filter editing when active; passes through to normal nav otherwise.
  • selectFilteredTasks is a case-insensitive substring match on
    ${project}#${task} keyed by state.filters[activeView] (per-view,
    not global — Workers view's filter doesn't carry into Queue).
  • TaskList title surfaces the active filter so it's never ambiguous.

Post-run auto-exit (3s, cancelable)

Addresses a UX regression: before this PR the TUI tore down ~120ms
after runEnd, so the user could never see the final frame.

  • Reducer sets state.autoExitAt = Date.now() + AUTO_EXIT_MS on
    runEnd. AUTO_EXIT_MS = 3000.
  • New AutoExit overlay shows the 1Hz countdown ("Closing in Xs…
    Press any key to stay open. q quits immediately.").
  • Any key press clears autoExitAt — the reducer deletes the
    field at the top of every key action.
  • The 1 Hz sampler tick flips autoExitTriggered once the deadline
    passes.
  • startTui now exposes waitForExit(): Promise<void> that resolves
    on q / Ctrl-C OR autoExitTriggered.
  • cli/run.ts awaits it between runOrchestrator() returning and
    tui.dispose().

Context-sensitive StatusBar

Keymap hints adapt to:

  • Mode: filter-editing → / <typed> (Enter to apply · Esc to cancel);
    help-open → ? close help; default → view-specific hints.
  • View: Overview / Graph / Workers / Bottlenecks / Queue each
    surface the keys most relevant to them. Shows view number + name
    on the left.

Test plan

  • bun src/bin.ts run format — clean
  • bun src/bin.ts run lint — 0 warnings, 0 errors
  • bun src/bin.ts run test — 506 pass, 0 fail
  • New tests:
    • selectFilteredTasks empty / case-insensitive / per-view
    • reducer: runEnd sets autoExitAt, key clears it, tick triggers
    • reducer: tick before deadline does not trigger
  • Manual e2e (silent fallback path verified; the TTY path runs
    startTui({ testing: true }) in the smoke test)

https://claude.ai/code/session_016HXj6HW6bxSn8EYuKcxTD9


Generated by Claude Code

Three polish items on top of Phase 3 (497 → 506 tests):

1. **Filter input (`/`).** State gains `filterEditing: boolean`;
   reducer adds `startFilterEdit` / `endFilterEdit` actions. App's
   keyboard handler routes printable + Backspace + Enter/Esc to
   filter editing while active. `selectFilteredTasks` is a
   case-insensitive substring match on `${project}#${task}` keyed
   by `state.filters[activeView]` (per-view, not global). TaskList
   title shows the active filter.

2. **Post-run auto-exit (3s, cancelable).** Addresses the UX
   regression where the TUI flashed off-screen immediately on runEnd:
   - Reducer sets `state.autoExitAt = Date.now() + 3000` on `runEnd`.
   - New `AutoExit` overlay shows a 1Hz "Closing in Xs" countdown.
   - **Any key press clears `autoExitAt`** — the user is engaged, so
     the TUI stays open until they press q / Ctrl-C.
   - Sampler tick flips `autoExitTriggered` when the deadline passes.
   - `startTui` exposes `waitForExit()` that resolves on q / Ctrl-C
     OR `autoExitTriggered`. `cli/run.ts` awaits it between `runEnd`
     and `dispose()`.

3. **Context-sensitive StatusBar.** Keymap hints adapt to the active
   view (Overview / Graph / Workers / Bottlenecks / Queue) and mode
   (filter-editing / help-open / default). Shows the view number +
   name on the left.

Tests: 497 → 506. New: filter selector tests (3), reducer auto-exit
tests (4), view-cycle keys (already in Phase 3, still passing).

https://claude.ai/code/session_016HXj6HW6bxSn8EYuKcxTD9
@Exelord
Exelord merged commit 6dc1532 into main May 13, 2026
1 check passed
@Exelord
Exelord deleted the claude/tui-phase-3b-polish branch May 13, 2026 16:39
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.

2 participants