Skip to content

Fix inverted on/off semantics in omarchy-toggle-bar - #7023

Open
Amvurguezo wants to merge 4 commits into
omacom:quattrofrom
Amvurguezo:fix-toggle-bar-inverted-on-off
Open

Amvurguezo wants to merge 4 commits into
omacom:quattrofrom
Amvurguezo:fix-toggle-bar-inverted-on-off

Conversation

@Amvurguezo

Copy link
Copy Markdown

Summary

  • omarchy-toggle-bar forwarded its on/off argument straight through to the underlying bar-off state flag without inverting it, so omarchy toggle bar on actually hid the bar and omarchy toggle bar off showed it — the opposite of the command's own summary and documented examples.
  • Inverted the mapping in bin/omarchy-toggle-bar (on -> disable bar-off, off -> enable bar-off), leaving generic toggle untouched since it's symmetric.
  • Updated test/shell.d/toggle-test.sh and test/acceptance.d/session-test.sh, which had encoded the previous (inverted) behavior as the expected/correct behavior.

Fixes #7022

Test plan

  • ./test/cli passes
  • ./test/shell — all suites pass except 3 pre-existing failures unrelated to this change (config-test.sh, snapper-test.sh, unowned-system-paths-test.sh), which also fail on master in this environment because no omarchy-pkgs checkout is available (OMARCHY_PKGS_PATH unset) — verified by stashing this change and re-running those 3 files against unmodified master
  • test/shell.d/toggle-test.sh passes in isolation with the new expected on/off directions
  • test/acceptance.d/session-test.sh (graphical acceptance test) not run — requires the disposable VM environment; updated to match the corrected semantics but not executed here

🤖 Generated with Claude Code

omarchy-toggle-bar forwarded the on/off argument straight through to
the underlying bar-off flag, so `omarchy toggle bar on` hid the bar
and `omarchy toggle bar off` showed it, the opposite of the command's
own documented examples. Invert the mapping (leave toggle as-is) and
update the shell and acceptance tests that had encoded the inverted
behavior as expected.

Fixes omacom#7022
Copilot AI balanced review requested due to automatic review settings August 15, 2026 19:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR flips the omarchy-toggle-bar CLI semantics so that on/off match “bar visible” expectations while still using the underlying bar-off toggle internally.

Changes:

  • Invert on/off behavior in bin/omarchy-toggle-bar to map to bar-off appropriately.
  • Update shell and acceptance tests to reflect the new visibility semantics for omarchy-toggle-bar.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
test/shell.d/toggle-test.sh Updates toggle/idempotency expectations to match inverted on/off semantics.
test/acceptance.d/session-test.sh Swaps hide/reveal calls and exit trap restore behavior to align with new bar visibility meaning.
bin/omarchy-toggle-bar Implements explicit argument mapping from on/off to underlying bar-off toggle states.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

The new case statement routed everything that was not on or off into
toggle, so a typo like `omarchy toggle bar onn` hid the bar and exited 0.
Forwarding the argument to omarchy-toggle used to catch that with a usage
error, matching omarchy-toggle-idle and omarchy-toggle-input-device.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings August 16, 2026 11:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (1)

test/shell.d/toggle-test.sh:55

  • This test only redirects stderr. If omarchy-toggle-bar (or a wrapped command) ever emits stdout on error, it can add noise/flakiness to test output. Consider redirecting stdout as well (e.g., >/dev/null 2>&1) for consistency with other suppressed calls in this file.
HOME="$test_home" omarchy-toggle-bar bogus 2>/dev/null && fail "bar rejects an unknown action"

@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed this and traced the whole chain rather than just the comparison. The fix is correct, and the one thing I most expected to be wrong here turns out not to be.

No migration is needed, and that is worth stating explicitly. The persisted state is the flag file ~/.local/state/omarchy/toggles/bar-off, and its meaning is unchanged by this PR: present still means hidden, absent still means visible. That is what shell/plugins/bar/Bar.qml:941 reads, and what manual/13-toggles-idle-screensaver.md:34 documents ("the flags are named for the off state ... so their presence means the feature is disabled"). You only remapped the CLI's argument onto that flag, so nobody's on-disk state changes meaning on upgrade.

Nothing downstream was compensating for the old inversion either, so this does not move the bug elsewhere:

  • shell/plugins/bar/Bar.qml:998-1009 — barHidden drops the exclusion zone and applies a negative margin. Reads the flag directly.
  • shell/plugins/notifications/Service.qml:51 — the only other barHidden consumer, uses the boolean as-is.
  • default/omarchy/omarchy-menu.jsonc:95 and the SUPER + SHIFT + SPACE binding (default/hypr/bindings/utilities.lua:16 via helpers.lua:135) both invoke omarchy-toggle-bar with no argument, so they hit toggle before and after and are unaffected in either direction.

The third file, test/acceptance.d/session-test.sh, is a necessary part of the fix rather than scope creep — it was written against the inverted behaviour and would fail without the flip.

One real defect, which I have pushed a fix for (252057b):

bin/omarchy-toggle-bar:10 — the *) arm routed everything that was not on or off into toggle. Previously the argument was forwarded to omarchy-toggle, which rejected unknown values with a usage message and exit 1. So on this branch a typo silently changed state:

$ omarchy-toggle-bar onn      # this PR: hides the bar, exit 0
$ omarchy-toggle bar-off onn  # before:  Usage: ... , exit 1

Verified both on a VM. Since on means "make it visible", onn hiding your bar with no output is a rough way to find out. I added an explicit toggle) arm and a usage error for anything else, matching what omarchy-toggle-idle and omarchy-toggle-input-device already do, plus a regression test in test/shell.d/toggle-test.sh.

Idempotence is fine as written: on ends in rm -f, off in mkdir -p + touch, both safe to repeat.

./test/cli (116 tests) and test/shell.d/toggle-test.sh pass with the fix applied. The graphical acceptance suite was not run.

omarchybot and others added 2 commits September 28, 2026 04:43
Keeps both sides of omarchy-toggle-bar: the corrected on/off mapping with its usage error, followed by quattro's syncHidden nudge to the shell.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
omarchy-toggle-fullscreen-desktop landed on quattro after this branch was opened and passed its own on/off straight to omarchy-toggle-bar, relying on bar on meaning hidden. With the corrected mapping, full screen on would show the bar while removing the gaps, and the toggle would never leave full screen because the bar and gap flags could not both be set. Map full screen on to bar off, and make the half-hidden test hide the bar with bar off so it still exercises what it names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Sep 28, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This branch had fallen into conflict with quattro, so I merged quattro into it and pushed two commits (801290f). One of them fixes a problem the merge would otherwise have caused.

The merge. quattro had since added a omarchy-shell -q omarchy.bar syncHidden nudge to the end of bin/omarchy-toggle-bar. The resolution keeps your case and runs the nudge after it, so every valid action still nudges the shell, and an unknown action exits with the usage error before touching the flag or the shell.

A caller that depended on the old inversion. bin/omarchy-toggle-fullscreen-desktop (#10672) landed after this pull request was opened and passes its own on/off straight to omarchy-toggle-bar, relying on bar on meaning hidden. With your fix, omarchy toggle fullscreen desktop on would have shown the bar while removing the gaps, and the plain toggle could never leave full screen. It now maps full screen on to bar off, and the "half-hidden desktop" test in test/shell.d/toggle-test.sh hides the bar with bar off so it still tests what it names.

What was run, on a disposable Omarchy VM:

  • A reproduction of my own (bar off must create the bar-off flag, bar on must remove it): fails on quattro, passes at 801290f, and fails again with bin/omarchy-toggle-bar reverted to quattro's.
  • test/shell.d/toggle-test.sh at 801290f: 14 passed. The merge without the full screen fix failed "fullscreen toggle hides the bar and the gaps together", which is what caught the caller.
  • ./test/cli: 86 passed, 1 failed, "vscode generated theme references current theme file". It fails identically on quattro and has nothing to do with bar toggling, but it means the suite is not green, and that is what keeps this from being marked ready.
  • The graphical acceptance suite was not run.

Second opinion: Codex at medium effort reviewed the head for proportionality, every caller of omarchy-toggle-bar and reader of bar-off, the merge resolution and the full screen cases, and found no defects. It had my reasoning available, so its agreement is not guaranteed to be independent. Beyond this pull request, it noted that layer_off_screen in test/acceptance.d/base-test.sh:119 only negates layer_on_screen, so a missing bar layer would also pass as "parked off screen". That was already on quattro and is not changed here.

No migration is needed. The flag keeps its meaning (present means hidden), so nobody's saved bar state changes on upgrade.

Next: this waits on the maintainer, and on the unrelated ./test/cli failure on quattro. There is nothing left for the author to do.

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

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy toggle bar on/off has inverted semantics (hides bar on 'on', shows it on 'off')

3 participants