feat: runtime config editing — add/save tabs with YAML validation - #20
Merged
Conversation
- "+" opens a two-step floating dialog (name → command) to add a new tab; the new TabConfig is validated against the full config before config.yaml is written, preventing broken configs - "w" on any config tab saves the current (possibly edited) command back to config.yaml immediately - "w" on the Search tab prompts for a name and saves the search command as a permanent tab entry in config.yaml - After a successful add, the new tab is appended to the tab bar and focused automatically - tabs.AddTab(), config.SaveConfig(), TabAddedMsg / ConfigSavedMsg wired into the Elm-style Update loop; disk I/O runs in a Cmd goroutine so the TUI stays responsive - Footer hints updated to advertise [w]save and [+]new tab https://claude.ai/code/session_01GYo9iNKVfzrzZafwzRr7hz
- Reorder footer: [w]save and [+]new tab now appear first in the hint line on all states (normal, filtered, Search tab) so they are always visible even in narrow terminals - Add [w] to filtered-state footer (was missing) - Intercept 'w' inside the command-edit dialog (Enter key, config tab): applies the new command AND saves config.yaml in one keystroke - Show "[w] apply + save to config.yaml" in the edit dialog's key-hint line via new WithExtraHints() on InputModel - README: add Runtime Config Editing section and keyboard shortcut table https://claude.ai/code/session_01GYo9iNKVfzrzZafwzRr7hz
The footer was reordered to put [w]/[+] first, but the right fix is to let the long hint string wrap at the terminal width. - Add wrapAtWidth() helper that breaks on word boundaries at m.width - Apply it to all three footer states (normal, filtered, search tab) - [w]save and [+]new tab are back at their natural end position; they become visible on the wrapped second line in narrow terminals - Bump list-height budget from height-5 to height-6 to reserve space for a potential second footer line (footer area now 4: \n\n + 2 lines) https://claude.ai/code/session_01GYo9iNKVfzrzZafwzRr7hz
[w] is now a contextual hint: it appears exclusively in the command-edit dialog (opened with Enter on a config tab) via WithExtraHints(), where it is actually usable. Removed [w]save / [w]save as tab from all three footer lines (normal, filtered, search tab). [+]new tab remains in the footer since it is always available. https://claude.ai/code/session_01GYo9iNKVfzrzZafwzRr7hz
'w' is a printable character and would be consumed by kubectl get expressions typed inside the input dialogs. Ctrl+W is a safe chord that does not conflict with any command text. Updated all three sites: main-view key handler, ViewSearchTab intercept, dialog extra-hint label, and README shortcut table. https://claude.ai/code/session_01GYo9iNKVfzrzZafwzRr7hz
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.
tab; the new TabConfig is validated against the full config before
config.yaml is written, preventing broken configs
back to config.yaml immediately
as a permanent tab entry in config.yaml
focused automatically
wired into the Elm-style Update loop; disk I/O runs in a Cmd goroutine
so the TUI stays responsive
https://claude.ai/code/session_01GYo9iNKVfzrzZafwzRr7hz