Skip to content

fix(toggle): invert on/off semantics in omarchy-toggle-bar - #9102

Open
harshithnadig wants to merge 1 commit into
omacom:quattrofrom
harshithnadig:fix/toggle-bar-inverted-semantics
Open

fix(toggle): invert on/off semantics in omarchy-toggle-bar#9102
harshithnadig wants to merge 1 commit into
omacom:quattrofrom
harshithnadig:fix/toggle-bar-inverted-semantics

Conversation

@harshithnadig

Copy link
Copy Markdown

Problem

In #9007, omarchy toggle bar on hides the top bar, and omarchy toggle bar off shows it. This is inverted compared to all other omarchy toggle <feature> [on|off] commands.

Cause

omarchy-toggle-bar delegates to omarchy-toggle bar-off "${1:-toggle}". Because the underlying flag is named bar-off, enabling the flag (on) creates ~/.local/state/omarchy/toggles/bar-off which shifts the bar off-screen.

Solution

In bin/omarchy-toggle-bar, translate on to off and off to on when forwarding to the bar-off toggle:

  • omarchy toggle bar on -> removes bar-off flag (shows the bar)
  • omarchy toggle bar off -> creates bar-off flag (hides the bar)
  • omarchy toggle bar [toggle] -> toggles the bar-off flag

Fixes #9007

'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
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.

omarchy toggle bar has inverted on/off semantics — on hides the bar, off shows it

1 participant