feat(tui): Phase 3B — filter input, post-run auto-exit, context hints - #77
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (
/)filterEditing: booleanin State +startFilterEdit/endFilterEditkey actions in the reducer.to filter editing when active; passes through to normal nav otherwise.
selectFilteredTasksis a case-insensitive substring match on${project}#${task}keyed bystate.filters[activeView](per-view,not global — Workers view's filter doesn't carry into Queue).
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.state.autoExitAt = Date.now() + AUTO_EXIT_MSonrunEnd. AUTO_EXIT_MS = 3000.AutoExitoverlay shows the 1Hz countdown ("Closing in Xs…Press any key to stay open. q quits immediately.").
autoExitAt— the reducer deletes thefield at the top of every
keyaction.autoExitTriggeredonce the deadlinepasses.
startTuinow exposeswaitForExit(): Promise<void>that resolveson q / Ctrl-C OR
autoExitTriggered.cli/run.tsawaits it betweenrunOrchestrator()returning andtui.dispose().Context-sensitive StatusBar
Keymap hints adapt to:
/ <typed> (Enter to apply · Esc to cancel);help-open →
? close help; default → view-specific hints.surface the keys most relevant to them. Shows view number + name
on the left.
Test plan
bun src/bin.ts run format— cleanbun src/bin.ts run lint— 0 warnings, 0 errorsbun src/bin.ts run test— 506 pass, 0 failselectFilteredTasksempty / case-insensitive / per-viewrunEndsetsautoExitAt, key clears it, tick triggersstartTui({ testing: true })in the smoke test)https://claude.ai/code/session_016HXj6HW6bxSn8EYuKcxTD9
Generated by Claude Code