Skip to content

feat(tui): Tab to flip between a line's items and colors editors - #547

Open
bit-saver wants to merge 5 commits into
sirmalloc:mainfrom
bit-saver:feat/tab-toggle-items-colors
Open

feat(tui): Tab to flip between a line's items and colors editors#547
bit-saver wants to merge 5 commits into
sirmalloc:mainfrom
bit-saver:feat/tab-toggle-items-colors

Conversation

@bit-saver

@bit-saver bit-saver commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What

In the configurator, press Tab to jump straight between a line's items editor and its color editor — no more escaping to the main menu and re-selecting the line. Tab toggles; Esc is unchanged.

Why

Editing a line's widgets and editing its colors are separate screens reached from two different main-menu entries. Switching between them for the same line means escaping all the way out and re-navigating each time. This adds a direct toggle that stays on the current line.

How

Both editors already render off App's shared selectedLine, so the flip is just setScreen('colors')setScreen('items') with selectedLine left untouched:

  • ItemsEditor gains an optional onSwitchToColors callback, bound to Tab in its normal-mode input handler. App passes it — gated off when a powerline preset theme manages colors (a new arePerLineColorsThemeManaged(settings) helper that mirrors the existing "Select Line to Edit Colors" isThemeManaged gate).
  • ColorMenu gains an optional onSwitchToItems callback, bound to Tab in its normal-mode key chain. Always available (the color editor is only reachable when colors aren't theme-managed).
  • Tab fires only in each editor's normal mode — never inside the widget picker/search/move modes or the hex/ansi256/gradient color-entry sub-modes.
  • Tab also flips the line-selector screens — "Select Line to Edit Items" ⇄ "Select Line to Edit Colors" (a new onSwitchScreen prop on LineSelector), carrying the highlighted row (both selectors already share the same cursor slot) and gated the same way under powerline preset themes. So the items/colors flow is Tab-flippable at both the picker and the editor level.
  • Footer hints added to both editors and both selectors.

Tests

  • arePerLineColorsThemeManaged predicate unit tests (existing powerline-settings tests preserved).
  • input-handlers: Tab switches to colors from normal mode.
  • ColorMenu: Tab switches to items, driven via a real stdin keypress through the existing mock-TTY harness.
  • LineSelector: Tab flips the selector screen and carries the highlighted row; no-op when no handler is wired.
  • Full suite + bun run lint (--max-warnings=0) clean.

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