Skip to content

fix(tui): guard live-list panic and refresh stale wizard hint bar#25

Merged
hi-lei merged 1 commit into
mainfrom
fix/tui-livelist-panic-hint-bar
May 29, 2026
Merged

fix(tui): guard live-list panic and refresh stale wizard hint bar#25
hi-lei merged 1 commit into
mainfrom
fix/tui-livelist-panic-hint-bar

Conversation

@hi-lei

@hi-lei hi-lei commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Two correctness fixes surfaced by an adversarial review of the keybinding/live-list TUI work (the feature itself already landed on main).

  • Live-list panicliveListModel.Update now early-returns on liveListUpdateMsg once a selection is chosen. bubbletea drains queued messages after tea.Quit, so a pumped update could refilter and empty matched, panicking View's chosen branch (index out of range).
  • Stale wizard hint barcompositeModel.Update re-reads prompt.Hints() after forwarding a key instead of relying on the one-time snapshot from setPrompt. Prompt hint labels are dynamic (e.g. esc flips to clear filter while filtering), so the wizard bottom bar went stale.

Also clarifies the refilter allocation comment and documents the testing.Prompter.LiveList drain-goroutine lifecycle contract.

Test plan

  • New regression tests: TestLiveList_NoPanicOnUpdateAfterChosen, TestComposite_HintBar_RefreshesOnFilter (both fail before the fix, pass after).
  • go build ./..., go test ./..., make lint all green.

🤖 Generated with Claude Code

Two correctness fixes surfaced by an adversarial review of the
keybinding/live-list work on this branch:

- liveListModel.Update now early-returns on liveListUpdateMsg once a
  selection is chosen. bubbletea drains queued messages after tea.Quit,
  so a pumped update could refilter and empty matched, panicking View's
  chosen branch (index out of range). Added regression test.

- compositeModel.Update re-reads prompt.Hints() after forwarding a key,
  instead of relying on the one-time snapshot taken in setPrompt. Prompt
  hint labels are dynamic (e.g. esc flips to "clear filter" while
  filtering), so the wizard bottom bar went stale. Added regression test.

Also clarify the refilter allocation comment and document the
testing.Prompter.LiveList drain-goroutine lifecycle contract.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hi-lei hi-lei merged commit c90fad0 into main May 29, 2026
14 checks passed
@hi-lei hi-lei deleted the fix/tui-livelist-panic-hint-bar branch May 29, 2026 12:18
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.

1 participant