feat(tui): Tab to flip between a line's items and colors editors - #547
Open
bit-saver wants to merge 5 commits into
Open
feat(tui): Tab to flip between a line's items and colors editors#547bit-saver wants to merge 5 commits into
bit-saver wants to merge 5 commits into
Conversation
… theme-managed check
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.
What
In the configurator, press
Tabto jump straight between a line's items editor and its color editor — no more escaping to the main menu and re-selecting the line.Tabtoggles;Escis 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 sharedselectedLine, so the flip is justsetScreen('colors')⇄setScreen('items')withselectedLineleft untouched:ItemsEditorgains an optionalonSwitchToColorscallback, bound toTabin its normal-mode input handler.Apppasses it — gated off when a powerline preset theme manages colors (a newarePerLineColorsThemeManaged(settings)helper that mirrors the existing "Select Line to Edit Colors"isThemeManagedgate).ColorMenugains an optionalonSwitchToItemscallback, bound toTabin its normal-mode key chain. Always available (the color editor is only reachable when colors aren't theme-managed).Tabfires only in each editor's normal mode — never inside the widget picker/search/move modes or the hex/ansi256/gradient color-entry sub-modes.Tabalso flips the line-selector screens — "Select Line to Edit Items" ⇄ "Select Line to Edit Colors" (a newonSwitchScreenprop onLineSelector), 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.Tests
arePerLineColorsThemeManagedpredicate unit tests (existingpowerline-settingstests preserved).input-handlers:Tabswitches to colors from normal mode.ColorMenu:Tabswitches to items, driven via a real stdin keypress through the existing mock-TTY harness.LineSelector:Tabflips the selector screen and carries the highlighted row; no-op when no handler is wired.bun run lint(--max-warnings=0) clean.