Skip to content

Retry transparent bar sampling after input changes - #13914

Open
sprajs wants to merge 3 commits into
omacom:quattrofrom
sprajs:fix/issue-10289
Open

sprajs wants to merge 3 commits into
omacom:quattrofrom
sprajs:fix/issue-10289

Conversation

@sprajs

@sprajs sprajs commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

A theme or wallpaper refresh arriving during transparent-bar foreground sampling can be dropped, leaving the previous palette applied indefinitely. Keep the newest request pending, reject stale output when inputs change and retry after the running process exits while retaining the debounce. A failed sample without a newer request remains quiet.

Validation: the controlled real Quickshell Process fixture reproduces the baseline race and verifies the candidate discards stale output and runs a replacement sample. Offscreen lifecycle scenarios cover both palette colors, bound bar position/size, transparency and the actual wallpaper FileView/Style watcher path. Existing bar/text-color checks pass; live baseline/candidate fixtures and a recording were inspected. The full-suite runs reproduce baseline/environment failures also seen on clean quattro; they are not fully green. Focused regressions pass.

Related fix

#14148 also addresses #10289. I recommend landing this PR and then retiring the overlapping change. An independent contributor reproduced the dropped refresh on the packaged 4.5.0 shell, ran all 13 sampler scenarios against the backport and current quattro, and verified the light/dark switch on a three-display NixOS setup. Independent verification

Fixes #10289.

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge based on this review.

Summary

The PR retains the newest transparent-bar foreground refresh request, discards stale sampler output, and retries after the running process exits. It also adds lifecycle tests covering palette, geometry, transparency, and wallpaper changes.

  • The latest revision corrects singleton access and waits for the fixture’s configured bar size before sampling.
  • No new actionable issue was identified in the changes since the previous review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Input changes] --> B[Increment request serial]
  B --> C{Sampler running?}
  C -->|No| D[Debounced sample]
  C -->|Yes| E[Keep request pending]
  D --> F[Accept output only for current serial]
  E --> G[Sampler exits]
  G --> H{Debounce timer armed?}
  H -->|Yes| D
  H -->|No| I[Sample latest request]
  I --> F
Loading

Reviews (3) · Last reviewed commit: "Initialize theme style in transparent fo..." · Reviewed by Greptile

@omarchybot omarchybot added the bug Something isn't working label Oct 1, 2026
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 7, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and tested at 82eb1f6. Nothing found that needs changing.

The bug, reproduced. I wrote my own reproduction on a worker built from the Omarchy ISO, separate from the test in this pull request. It loads the real sampler code from Bar.qml into an offscreen Quickshell, with a stub omarchy-bar-text-color that takes 0.6 s. It then replays the order of a theme switch from #10289: the current directory changes and starts a sample with the old palette, the new palette arrives while that sample is still running, and then current/background is pointed at the new wallpaper. On quattro, and on this branch with the Bar.qml change reverted, the bar keeps the old theme's colour and is never sampled again. On this branch it samples once more, with the new palette against the new wallpaper, and shows that colour. Your bar-foreground-refresh-test.sh also fails with the fix reverted and passes on the head.

The suite, on the same worker with the shell running from this branch: ./test/cli has one failure (vscode generated theme references current theme file), which fails the same way on quattro. ./test/shell with node installed: bar-test.sh (88), background-test.sh, bar-text-color-test.sh and the new test all pass. Six other files fail, and each fails the same way on quattro: ascii, branding-about-animation, kernel-headers-migration, network-captive-portal, passwordless-grant-lifecycle and video-background. omarchy-kernel-migration-test.sh also fails on both. Its pacman stub reads -Q -- pkg as a pattern and waits on stdin. None of these touch the bar.

Review. I traced the new request-serial and pending logic, and I found no way a request is lost, stale output is applied, or a failed sample retries in a loop. If transparency is turned off during a sample, the result is discarded. The onBarSizeChanged trigger is in scope, since the bar size is one of the sampler's arguments. A second review by Codex Medium found no defects either. It agreed with my reading and noted that Quickshell finishes parsing stdout before it emits exited, so a deferred retry can't race the old process's output. That agreement is not guaranteed to be independent.

Related. #14148 fixes the same issue a different way. This pull request is older, and it covers cases that one does not: it marks the running sample stale as soon as a new request arrives, it resamples when only the bar size changes, and it keeps resampling when only the wallpaper symlink changes. #14148 adds something this one doesn't have: a background-plugin property that lets the bar sample once per theme switch, against the wallpaper actually on screen. That would make sampling cheaper but isn't needed for correctness, so it's left for the maintainer to decide on separately. Codex Medium reached the same conclusion when asked to compare the two without seeing mine.

This now waits on the maintainer.

@sprajs

sprajs commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the lifecycle fixture in 4bf1abe. It now qualifies the theme Color singleton for Qt 6.12 and waits for shell.toml to supply the configured bar size. The geometry extraction also stops after the two bindings it needs.

All 13 lifecycle scenarios pass, including against a clean merge with current quattro (4c1b4cb). Replacing only the sampler with its pre-fix production code still fails on stale output and the missing retry. The bar contract and text-colour tests pass too.

./test/all is still not green on this host: the CLI VS Code theme-reference check fails, and 10 of 287 shell files fail, with two skipped files. I reproduced every failed check at the previous head, 82eb1f6.

@greptileai please re-review 4bf1abe and update the confidence score.

@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge and removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Oct 12, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed and re-tested at 4bf1abe. Nothing found that needs changing.

What changed. The new commit only touches the test fixture: it waits for shell.toml to load the bar size before it starts sampling, uses Commons.Color explicitly, and stops the geometry extraction after barSize. The sampler in Bar.qml is the same code I reviewed at 82eb1f6. Stopping the extraction there matters on current quattro, which added cutout code after barSize, and the fixture can't pass by never starting: if the style never becomes ready, its watchdog reports a timeout and the test fails.

Tested against current quattro. On a worker built from the Omarchy ISO, I ran the shell from this branch merged with quattro at 7e7a560. Your bar-foreground-refresh-test.sh passes all 13 scenarios. Then I swapped in quattro's Bar.qml, leaving the rest of the merge as it was, and the same test fails: the stale colour is applied and nothing is sampled again. bar-test.sh, bar-text-color-test.sh and background-test.sh pass, and ./test/cli is green. The full ./test/shell run has 14 failing files, and I re-ran each one on plain quattro. Eleven fail there too. background-intro-lifecycle and remote-session-service passed every time I re-ran them on this branch. background-intro-clone is intermittent: on quattro it failed once in five runs, and on this branch it passed six re-runs in a row.

Review. Codex Medium also found no defects. It checked that the merged sampler matches the one reviewed before. It also confirmed that quattro's newer bar code (the glassy background and the cutouts) doesn't interfere with the retry logic, and that a failed sample with no newer request still doesn't loop. It agreed with my reading, and that agreement is not guaranteed to be independent.

#14148 still competes with this one, and what I said about it above still applies. This now waits on the maintainer.

@ryantm

ryantm commented Nov 13, 2026

Copy link
Copy Markdown

Independent reproduction and validation of this fix on NixOS 26.11, Omarchy 4.5.0, Qt 6.12.0 and Hyprland 0.57.0 (Framework AMD laptop, three displays).

The transparent bar retained Catppuccin's pale foreground after switching to Catppuccin Latte: workspace numbers, network and other bar icons became nearly unreadable against the light wallpaper. Restarting the shell restored the correct colors. The installed Bar.qml still contains the early return that drops refresh requests while a sample is running.

I ran this PR's real Quickshell Process lifecycle fixture against the installed 4.5.0 Bar.qml, using the installed Qt/Quickshell binaries. Before the patch it fails:

RESULT fail foreground color=#111111 samples=1 stale=true
not ok - transparent foreground foreground converges without stale output or extra samples

With this PR's sampler changes applied to that same file, all 13 scenarios pass: foreground, contrast, position, orientation, size, orientation-size, background, rapid, toggle, off, failure, early and failure-latest. I also cherry-picked the three PR commits onto current quattro (3f974d0); all 13 scenarios pass there too. Existing bar-test.sh and bar-text-color-test.sh pass.

The patch applies to our packaged 4.5.0 with --fuzz=0; both the patched package and the NixOS system build succeed. I deployed the backport locally, confirmed the running shell loads the patched Bar.qml, then visually checked actual Catppuccin -> Catppuccin Latte theme switches across the desktop. The icons and workspace numbers now follow the theme with readable contrast, without restarting the shell between theme changes.

This is validation of Szymon's existing fix, not a competing implementation. We're carrying it locally while awaiting upstream merge. The deterministic fixture establishes the dropped-request race; the original incident did not have per-sample tracing enabled.

@omarchybot omarchybot removed the ready Good to merge label Nov 18, 2026
@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Nov 28, 2026
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.

Transparent bar keeps the previous theme's text colour: the refresh request is dropped while a sample is in flight

3 participants