Skip to content

Add presentation mode while preserving independent settings - #12422

Open
sprajs wants to merge 13 commits into
omacom:quattrofrom
sprajs:codex/pr-8513-regression-fix
Open

sprajs wants to merge 13 commits into
omacom:quattrofrom
sprajs:codex/pr-8513-regression-fix

Conversation

@sprajs

@sprajs sprajs commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

This carries forward the implementation from #8513 by @chessing234, with the regression fix described below. The original commits and authorship are preserved. #8513 is closed. #12730 remains an overlapping implementation; the product/implementation choice remains with maintainers.

Presentation mode hides the bar, silences notifications and keeps the system awake while retaining the prior settings for restoration. Inactive off leaves independently selected settings alone. Transitions share a lock and keep a recoverable snapshot; interrupted activation can resume, and restoration records completed steps so retrying after an IPC failure does not replay them over subsequent user choices. Update idle handover retains the existing security checks.

Verification on 17 November

The command now reads the current notifications isDnd IPC and checks that the bar accepts its refresh before finishing restoration. A regression through the production IPC wrapper failed on the previous head and passed after the fix. All 14 focused presentation checks pass. In a private nested Hyprland session running this branch's Omarchy shell, enabling presentation hid the bar, enabled Do Not Disturb and enabled Stay Awake. Disabling it restored all three. With all three settings independently enabled beforehand, they survived a complete on/off cycle.

Validation at 31d377e8, after merging quattro at 087f73d8: all 16 presentation/update-ownership checks, 15 update security checks, 224 menu/guard checks and 125 CLI checks pass. The English menu catalog now includes Presentation, and notification text goes through omarchy-i18n; all 401 structural i18n checks and the embedded-literal scan pass. Coverage includes inactive-off, unknown notification state, interrupted activation, overlapping commands, partial restoration, retry and reversal. Bash syntax and the focused diff check pass.

The full shell suite was not rerun on this merge. Earlier aggregate runs reproduced baseline/environment failures and were not fully green.

chessing234 and others added 3 commits August 26, 2026 22:24
The other Trigger > Toggle commands are documented there; this one was
missing from the published list.
@llstrk

llstrk commented Sep 25, 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.

Verified: the inactive-off guard does what the description says. With no presentation flag, omarchy-toggle-presentation off returns before touching the bar, stay-awake or DND, including when repeated. The new regression test is meaningful: run against the script from 1382ed7 (before the guard), it fails at inactive presentation off leaves an independently hidden bar, and at this head all five checks pass. They also pass with current quattro's omarchy-toggle-bar. In isolated runs, bare toggle (the menu action), status, repeated on, and a start with only the bar already hidden also behaved correctly, and omarchy toggle presentation routes to the new script.

Three smaller state-restore gaps remain, described below.

Presentation flag is created last, so an interrupted or overlapping on can lose the original state

enable_presentation writes the restore snapshot, changes the bar, DND and stay-awake, and only then creates the presentation flag (bin/omarchy-toggle-presentation lines 43-47). If on stops in between (for example Ctrl+C while omarchy-shell waits on a slow shell), the settings stay changed with no flag, and the new no-op off cannot undo them:

start: bar visible, DND off, stay-awake off
on   write_restore (bar_off=0) -> bar hidden -> [interrupted before touch]
     state: bar hidden, no presentation flag
off  no flag -> returns early           bar stays hidden
on   snapshot now records bar_off=1
off  restores bar_off=1                 bar stays hidden

The same gap lets two overlapping on or toggle runs (a script racing a manual toggle, or a double-tapped custom keybinding) both pass the enabled check. The second run then rewrites the snapshot with values the first run already applied, and the later off leaves the bar hidden and DND on. This was reproduced by forcing the interleaving in an isolated run; it is unlikely from the menu, which closes before its action runs.

Impact: the user has to restore the bar (and possibly DND or stay-awake) by hand; no on/off sequence recovers the original state.

Suggested change: move touch "$STATE_FILE" to right after write_restore. With only that change, off after an interrupted on restored the visible bar, and a second on during the first returned early. That move narrows but does not close the overlap window, particularly for toggle. Serializing the whole script with flock on a lock file outside the watched toggles/ directory, as bin/omarchy-system-lock already does, would cover it (the flock variant was not run).

DND restore is silently dropped when the shell is unavailable

disable_presentation deletes the flag and snapshot (line 63) before calling omarchy-shell -q notifications setDnd off (line 69). With -q, omarchy-shell exits 0 on every failure (shell not running, not ready, or not responding), so the script cannot tell the call did nothing. The shell persists DND in ~/.local/state/omarchy/notifications.json, so DND comes back on:

After on, then off while the shell is down Result
Bar, stay-awake (file flags) Restored
DND (IPC only) Stays on after the shell returns
A later off No-op (no flag)
A later on/off pair Snapshot records dnd=on, so DND is left on

The on side has a related gap: dnd_state maps a failed dndState query to off, so starting presentation while the shell is not ready records dnd=off, and the later off clears a DND the user had on. Neither case is reachable from the menu (it runs inside the shell), only from the CLI, a keybinding or a script, for example in the seconds after login or a shell restart.

Impact: notifications can stay silenced after a presentation with no indication and no tool-level recovery.

Suggested change: call setDnd off without -q and check that it answers off. On failure, keep a DND-only pending marker (or leave the flag in place) and exit nonzero. In dnd_state, record dnd=unknown when the query fails and skip the DND restore for it.

Stay-awake owned by a running omarchy update is removed mid-presentation

If presentation starts while an update holds stay-awake, write_restore records stay_awake=1 and omarchy-toggle-idle stay-awake only touches the file, so it keeps the update's owner token. When the update finishes, omarchy-update-stay-awake stop sees its token still in place and removes stay-awake while the presentation flag is still set. From the idle service source, the idle monitor is then re-enabled, so the screensaver and lock can start after the normal idle timeout during the rest of the presentation.

Impact: narrow timing, but per the idle service source the screensaver and lock can appear mid-presentation.

Suggested change: make one side ownership-aware, for example have omarchy-update-stay-awake stop leave stay-awake alone while toggles/presentation exists, or have presentation take over an update-owned file. This touches a file outside this PR, so a note or follow-up may fit better.

Base note: this branch predates quattro commit e1fc502 ("Nudge the bar over IPC when toggling visibility"), whose message describes the toggles-directory watch stopping after flag changes land in quick succession. Presentation on and off each flip two flags there back to back. With current quattro's omarchy-toggle-bar, the nudge fires after each flip, so the outstanding desktop check is more representative on a rebased branch.

Overlap note: #12730 at d524068 carries the 1382ed7 script byte for byte, without this guard. If that PR is the one that lands, the guard and this regression test would still need to go with it.

Documentation: manual/13-toggles-idle-screensaver.md says toggle flags are named for the off state; toggles/presentation is named for the on state, so that sentence could note the exception.


Review information

Test scope: Reviewed at d66bb5e. The PR test, the pre-guard negative control and additional scenarios ran in an isolated sandbox with a temporary home, real repository helpers for the bar, idle, toggle and update stay-awake scripts, and stubbed omarchy-shell and notification sending. Shell-down, interruption and overlapping-run cases are modeled with those stubs and forced interleavings; timing windows were not measured. On-screen results (bar, popups, idle lock) are inferred from the in-tree shell source; no desktop session or live shell was used. The full test suite was not rerun.

AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments with targeted cross-checks of each other's findings, Opus 5.5 Medium editorial check.

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

@omarchybot omarchybot added the enhancement New feature or request label Sep 27, 2026
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The latest changes appear safe to merge; desktop/VM acceptance remains deferred.

Summary

Adds presentation mode that hides the bar, silences notifications, and pauses idle locking while keeping the user's prior settings for restoration.

  • Presentation mode hides the bar and restores only settings it changed.
  • Presentation mode keeps its idle hold when an update ends.

The latest changes preserve recovery state when bar synchronization fails. No new actionable issues found. sprajs explicitly deferred desktop/VM presentation acceptance; that check remains outstanding.

Reviews (8) · Last reviewed commit: "Keep presentation restoration retryable ..." · Reviewed by Greptile

Comment thread bin/omarchy-toggle-presentation Resolved
Comment thread bin/omarchy-toggle-presentation Resolved
@sprajs

sprajs commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Following up on the automated community review: the transitions now share a lock, preserve the original snapshot across interrupted activation, retain recoverable DND state when IPC fails, and track completed restoration steps. Presentation and update stay-awake ownership are covered together without dropping the existing ownership/security checks. The manual also documents the presentation flag exception. Forced interleaving, interruption, unavailable-shell, retry and update-handover regressions pass; physical desktop/VM acceptance remains untested. Latest fix: fd29bdb.

@sprajs

sprajs commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Resolved the conflict with current quattro in 467c674, keeping the current menu and its Presentation entry. All 16 presentation/update-ownership checks, 15 update security checks, 151 menu checks and 124 CLI checks pass. The presentation tests also pass inside the aggregate run, and the isolated menu render was inspected.

./test/all on this exact head remains non-green: 15/386 files failed, all the same failures as the exact upstream base (15/384). No additional failing test files were found. Physical presentation acceptance remains untested.

@greptileai please re-review the updated head.

@jandrusk

Copy link
Copy Markdown

Carries #8513 (closed) with transition/lock fixes. Same product ask as #8510 / #12730. Clean enough for a product call on whether one-shot presentation mode should land; merge is dirty so needs a rebase first.

@sprajs

sprajs commented Oct 17, 2026

Copy link
Copy Markdown
Contributor Author

Resolved the current menu conflict in 8cc120a, retaining quattro's menu aliases and updated Stay Awake icon alongside the Presentation entry. The presentation transition and update-ownership code are unchanged apart from the upstream merge.

All 16 presentation/ownership checks, 15 update security checks, 162 menu checks and 125 CLI checks pass. The full shell suite and desktop/VM presentation acceptance were not rerun on this merge.

I also corrected the description: #8513 is closed; #12730 is the still-open overlapping implementation. The product/implementation choice remains with maintainers.

@sprajs

sprajs commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Merged current quattro (087f73d8) in ed0e833, keeping its separate On/Off menu entries alongside Presentation. The merge is clean again.

I also ran the current CI checks locally and found two i18n blockers: the Presentation row was missing from the English menu catalog, and its notifications still embedded English. Fixed both in 31d377e. The 401 structural i18n checks and literal scan now pass, along with 16 presentation/update-ownership, 15 update security, 224 menu/guard and 125 CLI checks.

The full shell suite and desktop/VM acceptance were not rerun. The product choice between this and #12730 remains with maintainers.

Comment thread bin/omarchy-toggle-presentation Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants