fix(toggle): invert on/off semantics in omarchy-toggle-bar - #9102
Open
harshithnadig wants to merge 1 commit into
Open
fix(toggle): invert on/off semantics in omarchy-toggle-bar#9102harshithnadig wants to merge 1 commit into
harshithnadig wants to merge 1 commit into
Conversation
'omarchy-toggle-bar' previously passed 'on' and 'off' directly to the
underlying 'bar-off' state flag. Because the flag represents disabling
the bar ('bar-off'), passing 'on' created the flag (hiding the bar) while
'off' deleted the flag (showing the bar), inverting expected user semantics.
Map 'on' -> 'off' and 'off' -> 'on' when passing to 'omarchy-toggle bar-off'
so that 'omarchy toggle bar on' shows the bar and 'omarchy toggle bar off'
hides it.
Fixes omacom#9007
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.
Problem
In #9007,
omarchy toggle bar onhides the top bar, andomarchy toggle bar offshows it. This is inverted compared to all otheromarchy toggle <feature> [on|off]commands.Cause
omarchy-toggle-bardelegates toomarchy-toggle bar-off "${1:-toggle}". Because the underlying flag is namedbar-off, enabling the flag (on) creates~/.local/state/omarchy/toggles/bar-offwhich shifts the bar off-screen.Solution
In
bin/omarchy-toggle-bar, translateontooffandofftoonwhen forwarding to thebar-offtoggle:omarchy toggle bar on-> removesbar-offflag (shows the bar)omarchy toggle bar off-> createsbar-offflag (hides the bar)omarchy toggle bar [toggle]-> toggles thebar-offflagFixes #9007