Skip to content

Fix bar toggle on/off polarity - #13451

Closed
haiderakt wants to merge 2 commits into
omacom:quattrofrom
haiderakt:fix-bar-toggle-13440
Closed

haiderakt wants to merge 2 commits into
omacom:quattrofrom
haiderakt:fix-bar-toggle-13440

Conversation

@haiderakt

Copy link
Copy Markdown

Fixes #13440

omarchy toggle bar on and off currently have inverted behavior because the internal bar-off flag has opposite polarity to the public command.

This change maps the public on/off arguments to the correct internal flag actions, updates fullscreen desktop handling, and adjusts the relevant tests.

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
@llstrk

llstrk commented Sep 29, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Outcome: Open PRs #12422 and #12730 rely on the old bar on meaning, and this PR duplicates #7023.

Presentation PRs expect bar on to hide

#12422 and #12730 call omarchy-toggle-bar on to hide the bar. With this PR on quattro, their tests fail at presentation on hides the bar. Impact: presentation mode would show the bar; no merge conflict flags it.

Suggested change: whichever lands second swaps the two calls in omarchy-toggle-presentation; #11803's help summary would then be wrong.

Reproducer (fails on quattro + this PR)

Reproducer: open presentation-mode PRs rely on the old bar on = hide meaning

Reviewed head: 3d4787403d6bd2dd901d5ef253b9500256c71a0e (#13451), merged onto quattro at b421b1b479ee9ea0863792282eee4ffeb50923dc (the merge is clean).

Open PRs #12422 (head d66bb5efced0f7abb2c921d96fa03bf81dfd8b03) and #12730 (head b31b9244fc9c85ffc205bdccb4a19f469c5b0e97) each add bin/omarchy-toggle-presentation, which calls:

# enable_presentation
omarchy-toggle-bar on
# disable_presentation, when the bar was visible before
omarchy-toggle-bar off

Their test/shell.d/presentation-mode-test.sh asserts that bar-off is set after presentation on.

Steps

  1. Check out quattro with Fix bar toggle on/off polarity #13451 merged.
  2. Apply the PR diff. The manual/13-toggles-idle-screensaver.md hunk no longer applies by context and is unrelated to behaviour, so it was excluded: git apply --exclude=manual/13-toggles-idle-screensaver.md <pr>.diff.
  3. bash test/shell.d/presentation-mode-test.sh

Actual output

quattro + #13451 + #12422:

not ok - presentation on hides the bar

quattro + #13451 + #12730:

not ok - presentation on hides the bar

Control, quattro + #12422 without #13451:

ok - presentation on hides the bar, silences notifications, and stays awake
ok - presentation off restores the previous bar, dnd, and idle state
ok - inactive presentation off is idempotent and preserves independent state
ok - presentation off does not undo state it did not change
ok - presentation mode is on the Toggle menu

Control, quattro + #12730 without #13451: exit 0.

Fix for whichever lands second

Swap the two calls in bin/omarchy-toggle-presentation (omarchy-toggle-bar off to hide on enable, omarchy-toggle-bar on to restore on disable). This swap was not run.

Also open: #11803 changes the omarchy:summary of bin/omarchy-toggle-bar to "(on hides the bar, off shows it)", which would describe the opposite of this PR's behaviour.

Full screen tests start in the wrong states

The bar checks now end with bar off, so the first full screen case starts half-hidden and the "half-hidden" case starts fully visible (line 75 is a no-op). Impact: test-only; names no longer match setups, and coverage relies on the ordering.

Suggested change: run bar off before the bar on checks and use bar off on line 75.

Reproducer (fails at 3d47874)

Reproducer: the full screen cases in toggle-test.sh no longer start from the states they name

Reviewed head: 3d4787403d6bd2dd901d5ef253b9500256c71a0e (#13451). Merge-base for comparison: 0066ea216b2e7793a5c34443703a7c8d050b03e1.

The bar block now ends with omarchy-toggle-bar off (line 51), so bar-off is still set when the full screen block starts. Line 75 still runs omarchy-toggle-bar on, which now clears a flag that line 71 already cleared. The two setup states are therefore swapped relative to the test names.

Probe 1: state after the line-75 setup step

--- a/test/shell.d/toggle-test.sh
+++ b/test/shell.d/toggle-test.sh
@@ -73,6 +73,7 @@
 pass "fullscreen toggle restores the bar and the gaps together"
 
 HOME="$test_home" omarchy-toggle-bar on
+[[ -f $bar_flag && ! -f $gaps_flag ]] || fail "half-hidden setup hides the bar but not the gaps"
 HOME="$test_home" omarchy-toggle-fullscreen-desktop
 [[ -f $bar_flag && -f $gaps_flag ]] || fail "fullscreen toggle pulls a half-hidden desktop into full screen"
 pass "fullscreen toggle pulls a half-hidden desktop into full screen"

bash test/shell.d/toggle-test.sh at 3d47874 (actual output, stdout then stderr):

ok - generic toggle enables explicit on state
ok - generic toggle on is idempotent
ok - generic toggle disables explicit off state
ok - generic toggle flips disabled state on
ok - generic toggle flips enabled state off
ok - bar on shows the bar
ok - bar on is idempotent
ok - bar off hides the bar
ok - fullscreen toggle hides the bar and the gaps together
ok - fullscreen toggle restores the bar and the gaps together
not ok - half-hidden setup hides the bar but not the gaps

The same probe inserted at the same place in the merge-base test (where bar on still sets the flag) passes: exit 0.

Probe 2: state before the first full screen toggle

--- a/test/shell.d/toggle-test.sh
+++ b/test/shell.d/toggle-test.sh
@@ -64,6 +64,7 @@
 
 gaps_flag="$test_home/.local/state/omarchy/toggles/hypr/window-no-gaps.lua"
 
+[[ ! -f $bar_flag && ! -f $gaps_flag ]] || fail "first full screen case starts from a fully visible desktop"
 HOME="$test_home" omarchy-toggle-fullscreen-desktop
 [[ -f $bar_flag && -f $gaps_flag ]] || fail "fullscreen toggle hides the bar and the gaps together"
 pass "fullscreen toggle hides the bar and the gaps together"

At 3d47874 (actual output):

ok - generic toggle enables explicit on state
ok - generic toggle on is idempotent
ok - generic toggle disables explicit off state
ok - generic toggle flips disabled state on
ok - generic toggle flips enabled state off
ok - bar on shows the bar
ok - bar on is idempotent
ok - bar off hides the bar
not ok - first full screen case starts from a fully visible desktop

At the merge-base the same probe passes: exit 0.

What this does and does not affect

The pull-into-line rule in bin/omarchy-toggle-fullscreen-desktop:13 is still exercised, just by the first case instead of the one named for it. Diagnostic mutant: replacing && with || in that condition makes the unmodified 3d47874 test fail at not ok - fullscreen toggle hides the bar and the gaps together (in the merge-base test the same mutant fails at not ok - fullscreen toggle pulls a half-hidden desktop into full screen). So coverage moved; it was not lost.

Separately, bar on shows the bar now runs first on an empty home, where the flag never existed, so it passes even if on does nothing. With on) exit 0 ;; as a diagnostic mutant, the first failure is not ok - fullscreen toggle restores the bar and the gaps together.

Suggested test layout (verified)

--- a/test/shell.d/toggle-test.sh
+++ b/test/shell.d/toggle-test.sh
@@ -40,6 +40,10 @@
 [[ ! -f $flag ]] || fail "generic toggle flips enabled state off"
 pass "generic toggle flips enabled state off"
 
+HOME="$test_home" omarchy-toggle-bar off
+[[ -f $bar_flag ]] || fail "bar off hides the bar"
+pass "bar off hides the bar"
+
 HOME="$test_home" omarchy-toggle-bar on
 [[ ! -f $bar_flag ]] || fail "bar on shows the bar"
 pass "bar on shows the bar"
@@ -48,10 +52,6 @@
 [[ ! -f $bar_flag ]] || fail "bar on is idempotent"
 pass "bar on is idempotent"
 
-HOME="$test_home" omarchy-toggle-bar off
-[[ -f $bar_flag ]] || fail "bar off hides the bar"
-pass "bar off hides the bar"
-
 # The gaps half of full screen copies a flag file in and reloads Hyprland, so
 # give it this checkout to copy from and a hyprctl that answers without a
 # compositor.
@@ -72,7 +72,7 @@
 [[ ! -f $bar_flag && ! -f $gaps_flag ]] || fail "fullscreen toggle restores the bar and the gaps together"
 pass "fullscreen toggle restores the bar and the gaps together"
 
-HOME="$test_home" omarchy-toggle-bar on
+HOME="$test_home" omarchy-toggle-bar off
 HOME="$test_home" omarchy-toggle-fullscreen-desktop
 [[ -f $bar_flag && -f $gaps_flag ]] || fail "fullscreen toggle pulls a half-hidden desktop into full screen"
 pass "fullscreen toggle pulls a half-hidden desktop into full screen"

Observed with this layout:

  • 3d47874 scripts: all 13 checks pass; both probes above pass.
  • Merged onto quattro b421b1b (the diff applies cleanly): all 15 checks pass.
  • Merge-base scripts: fails at not ok - bar off hides the bar (still catches the inversion).
  • || mutant and "decide by bar-off alone" mutant: fail at not ok - fullscreen toggle pulls a half-hidden desktop into full screen.
  • bar on no-op mutant: fails at not ok - bar on shows the bar.

PR #13670 and PR #7023 use the same idea (their bar block starts off, off, on, and their half-hidden setup step, line 75 in #13670 and line 79 in #7023, uses bar off); each of their tests fails with the || mutant at not ok - fullscreen toggle pulls a half-hidden desktop into full screen.

Other open PRs for this issue

They cite different issue numbers (#7022, #11817, #12082, #13440) for the same inverted on/off bug. Each conflicts with this PR in bin/omarchy-toggle-bar, bin/omarchy-toggle-fullscreen-desktop and test/shell.d/toggle-test.sh, so only one can land as is.

Details

Verified

  • omarchy toggle bar on clears bar-off (bar shown) and off sets it, from either start state; bare, "" and toggle still flip it.
  • omarchy-toggle-fullscreen-desktop ends in the same state as at the merge-base in all 24 start-state and argument cases.
  • toggle-test.sh passes at the head (13 checks) and on a clean local merge with quattro (15 checks); it fails on the merge-base scripts.
  • The menu entry and the bar hotkey call omarchy-toggle-bar with no argument, and the full screen hotkey calls omarchy-toggle-fullscreen-desktop with no argument; the bar-off flag keeps its meaning, so saved state is unaffected.

Optional notes

  • Optional test improvement: no check runs omarchy-toggle-bar with no argument, the form the menu and hotkey use, so a change to the bare-toggle path would not fail toggle-test.sh. A pair of bare omarchy-toggle-bar checks after the on/off checks (one hides the bar, the next shows it again) would cover it without changing the state the full screen checks start from.
  • Unknown arguments (show, hide, ON) print omarchy-toggle's usage and exit 0 with the flag unchanged. This is unchanged from the merge-base; Fix inverted on/off semantics in omarchy-toggle-bar #7023 and Make omarchy toggle bar on/off match bar visibility #12150 reject them instead.

Review information

Test scope: Source and sandboxed shell tests at 3d47874 and on quattro; acceptance test not run.

AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check.

Opt out: To stop receiving these reviews, reply to this comment saying so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy toggle bar on hides the bar: on/off arguments are inverted

3 participants