PadIO: hidden modes, trim the mode picker list - #16
Merged
Merged
Conversation
Once modes are driven by the app in the focused pane, the mode list grows one entry per app and the picker becomes unusable as a manual switcher. Let modes be marked hidden: excluded from the picker and prev/next cycling, but still fully functional. Add an optional hidden_modes ([String]) at two levels: on ProfileConfig (per-profile modes) and at top level (for cross-profile shared modes), both decoded with decodeIfPresent ?? []. allModeNames, the single source feeding the picker and prev/next cycling, subtracts the union of the two lists. Hidden modes stay reachable via setMode, external context, and default_mode. If hiding would leave nothing, fall back to the full set so the picker is never an empty, inescapable panel. Closes #10 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Implements #10.
With modes driven by the app in the focused pane (#9), the mode list grows one entry per app, so the picker stops working as a manual switcher when only a few modes (e.g.
media,zsh) are ever picked by hand. This lets modes be marked hidden.Chosen form:
hidden_modesdenylistPer the discussion in #10 I picked the denylist (list modes to hide) at two levels:
ProfileConfig— hides per-profile modesMappingConfig— hides cross-profileshared_modesBoth are optional,
decodeIfPresent(...) ?? [], so existing configs list every mode exactly as before.{ "hidden_modes": ["media-alt"], "profiles": { "ghostty": { "hidden_modes": ["agent", "vim", "browser"], "modes": { "herdr-nav": {}, "agent": {}, "vim": {}, "browser": {} } } } }Implementation
allModeNames(profile:config:)is the single source feeding the picker and prev/next cycling (the manual switchers), so the filter lives in one place: it subtracts the union ofprofile.hidden_modesand top-levelhidden_modes. Hidden modes stay reachable viasetModebindings, external context (#9), anddefault_mode— those resolve modes by name and never enumerate.Degenerate guard: if hiding would leave zero visible modes, it falls back to the full set, so the picker is never an empty, inescapable panel.
Verified nothing else enumerates mode names for display: only
ControllerManagercallsallModeNames;HelpOverlayenumerates bindings for the active mode, not mode names;ModePickerOverlayjust renders whatever list it is handed.Verified
BuildProject.🤖 Generated with Claude Code