Skip to content

refactor(cli): centralize TUI keybindings via bubbles/key#1060

Merged
Soph merged 1 commit intomainfrom
soph/bubbletea-v2-prep
Apr 28, 2026
Merged

refactor(cli): centralize TUI keybindings via bubbles/key#1060
Soph merged 1 commit intomainfrom
soph/bubbletea-v2-prep

Conversation

@Soph
Copy link
Copy Markdown
Collaborator

@Soph Soph commented Apr 28, 2026

https://entire.io/gh/entireio/cli/trails/249

Introduce a shared keyMap (cmd/entire/cli/keys.go) so the activity, dispatch, and search TUIs all match keys and render help text from one source of truth, replacing scattered string literals like "esc", "ctrl+c", and "q".

Entire-Checkpoint: 7611ae68730a


Note

Low Risk
Low risk refactor that mainly replaces scattered key string comparisons and hardcoded help text with bubbles/key bindings; potential risk is minor behavior drift if any prior key strings differed from the new bindings.

Overview
Centralizes TUI keybindings by introducing cmd/entire/cli/keys.go as a single source of truth for common actions (quit/back/search/confirm/navigation).

Updates the activity, dispatch, and search TUIs to use key.Matches(...) against the shared bindings instead of ad-hoc msg.String() checks, and rewires footer/help rendering to pull key labels/descriptions from the same bindings (removing local constants like tuiEscKey).

Reviewed by Cursor Bugbot for commit 1e5d0e3. Configure here.

Copilot AI review requested due to automatic review settings April 28, 2026 10:35
@Soph Soph requested a review from a team as a code owner April 28, 2026 10:35
Introduce a shared keyMap (cmd/entire/cli/keys.go) so the activity,
dispatch, and search TUIs all match keys and render help text from one
source of truth, replacing scattered string literals like "esc",
"ctrl+c", and "q".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 7611ae68730a
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR centralizes Bubble Tea TUI keybindings into a single shared keyMap so the activity, dispatch, and search TUIs match on the same bindings and can render consistent help text.

Changes:

  • Added cmd/entire/cli/keys.go defining shared keys bindings (quit/back/search/confirm/navigation).
  • Updated search_tui.go to use key.Matches against shared bindings and to render help text using binding help metadata.
  • Updated activity_tui.go and dispatch_tui.go to use the shared quit/back bindings instead of local string checks.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
cmd/entire/cli/search_tui.go Replaces scattered key string literals with shared bindings; updates footer/help rendering accordingly.
cmd/entire/cli/keys.go Introduces the shared TUI key map as the single source of truth.
cmd/entire/cli/dispatch_tui.go Uses shared quit/back bindings for cancel behavior and removes local tuiEscKey.
cmd/entire/cli/activity_tui.go Uses shared quit/back bindings and updates footer help to use binding metadata.

@Soph Soph force-pushed the soph/bubbletea-v2-prep branch from 1e5d0e3 to d3572b2 Compare April 28, 2026 10:42
@Soph Soph merged commit 102693c into main Apr 28, 2026
9 checks passed
@Soph Soph deleted the soph/bubbletea-v2-prep branch April 28, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants