Repository navigation
Bar pills: an optional background per widget or run of widgets - #13139
cristian-fleischer wants to merge 11 commits into
Conversation
Automated AI review
Verified: the pill run logic, the new theme keys and the Pills off: the anchored centre widget can move 1 px
The stock vertical clock is 3 lines × The clock and the centre widgets anchored to it sit 1 px lower. On horizontal bars the same shift happens only when the clock width is an odd integer, which is not the typical case. Impact: small, but it contradicts the "0 differing pixels at all four positions" claim for left and right bars at the default font size. This comes from source and Qt's anchor code; no screenshot diff was taken. Suggested change:
|
2b60e70 to
dbf89bf
Compare
|
Thanks @llstrk, all confirmed.
|
Automated AI review
Follow-up to the earlier review and the author's reply, checked at head Verified: the anchor, section-end margin and documentation fixes work as described. The drag z-order is unchanged, as the reply says it would be. The tray colour fix has one side effect: the tray's popup menus now take the pill text colour too (new finding below).
With pills on, the tray's popup menus use the pill text colour
Both popups are Computed with the head's colour helpers:
The same flip can come from a translucent pill on a transparent bar over a light wallpaper. In a sandbox run with Tokyo Night colours and a light test image, the head's Impact: with pills on and a pill colour of the opposite lightness, a flipping translucent pill, or a Suggested change: keep readonly property color foreground: bar ? bar.foreground : Color.foreground
readonly property color barIconColor: bar ? (bar.pillsOn ? bar.barForeground : bar.foreground) : Color.foreground
// TrayIcon colorizes with a `tint` property defaulting to root.foreground;
// the TrayItem on the bar sets tint: root.barIconColor.No test covers the tray colour in either direction. Verified: on this head, Review informationTest scope: source review of head 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. |
dbf89bf to
e3d713c
Compare
|
Thanks @llstrk, good catch, that one was mine. Another review pass found a few more things, also fixed:
|
Automated AI review
Outcome: All seven earlier findings are resolved at Follows the second review and the author's reply. Drag ghost hides the widget on a contrasting pillWith pills on, widgets use the pill text colour, but on a drawn bar the drag ghost is filled with the bar background. With Suggested change: on a drawn bar, fill the ghost with the pill as drawn: Reproducer (computation at e3d713c, not rendered)N1: with a contrasting pill colour, the drag ghost draws the widget in its own fill colourKind: computation from source with the PR's own colour helpers ( Source facts used:
Run from the root of an omarchy checkout at // ghost-contrast.js
const path = require('path')
const bar = require(path.resolve(process.argv[2] || '.', 'shell/plugins/bar/BarModel.js'))
const themes = [
// [name, colors.toml foreground, colors.toml background]
['Tokyo Night', '#a9b1d6', '#1a1b26'],
['Catppuccin Latte', '#4c4f69', '#eff1f5']
]
for (const [name, fg, bg] of themes) {
// [bar] pill = "{{ foreground }}" on a drawn bar: pillRaised is false, so the
// backdrop is the pill at alpha 1.
const pill = bar.blendHex(fg, 1, bg)
// pillForeground with [bar] pill-text unset.
const pillText = bar.pickTextColor(fg, bg, pill)
console.log(`${name}, [bar] pill = "{{ foreground }}"`)
console.log(` pill ${pill}, widget text ${pillText}, contrast on the pill ${bar.contrastRatio(pillText, pill).toFixed(2)}`)
console.log(` drag ghost fill ${bg}, contrast of the dragged widget on it ${bar.contrastRatio(pillText, bg).toFixed(2)}`)
}
The picked text is right for the pill (8.10 and 7.06), but the ghost fill is the bar background, which here equals the picked text, so the dragged widget's glyph and the ghost's 1 px border have the same colour as the ghost fill. With the stock template and only DetailsEarlier findings: the Verified:
Related PR #13570: it uses the layout Optional test improvement: most new round-2 checks match source text. A mutant that draws each horizontal pill from the wrong gap half (1 px off for odd gaps) still passes all 148 checks. Adding T1 (test validity): the round-2 geometry checks pin source text, not geometryKind: mutation run of the PR's own Mutant 1: pill drawn from the wrong gap halfOne-line change in - x: root.vertical ? inset : slot.pillGapLead
+ x: root.vertical ? inset : slot.pillGapTrailWith an odd
The regex for "a pill is drawn between the two gap halves of its run" checks the Mutant 2: the old symmetric split function pillGapLead(pillGap) {
- return Math.floor(pillGap / 2)
+ return Math.round(pillGap / 2)
}Actual result: exit 1. The identity check passes, and the behavioural
A behavioural alternative already fits the file's style: the test runs Review informationTest scope: source and sandbox tests at 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. |
e3d713c to
afe491b
Compare
|
Thanks @llstrk, fixed. While pills are on, the drag ghost now sits on the pill as drawn: the pill over the bar colour on a drawn bar, the pill alone on a transparent bar. Without pills it is unchanged. |
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge, with a non-blocking text-legibility issue after certain widget reorders. SummaryThe PR adds opt-in backgrounds for individual bar widgets or widget runs, with theme controls, wallpaper-aware text contrast, drag spacing, tray icon coloring, documentation, and tests.
|
afe491b to
d085a26
Compare
|
Heads-up for the rebase: #14553 (merged today) qualifies palette references as |
|
Thanks for the heads-up @jandrusk. I'll switch these to |
d085a26 to
bd748f7
Compare
bd748f7 to
3b3422e
Compare
|
Added frosted pills: with pills on, |
3b3422e to
a9b6c22
Compare
a9b6c22 to
be14d6b
Compare
ba02afb to
ce12a63
Compare
2de5042 to
d656367
Compare
d656367 to
7ab542f
Compare
bar.pills in shell.json (off, section, widget), or [bar] pills as a theme default, gives widgets their own background so the bar background can be switched off. Off by default: without it the bar renders as before. - section joins neighbouring widgets into one pill; a spacer, even at size 0, or a change of "group" between neighbours ends it. widget gives every widget its own. "pill": false keeps an entry off pills. - Roles are a port of DMS's SegmentRoles: hidden widgets drop out of a run without breaking it, so a widget that hides needs no rebuild. - The first slot of a pill draws the whole pill. Per-slot segments meet at fractional pixels on scaled outputs and show a seam. - Text is picked against the pill; omarchy-bar-text-color --blend composites a translucent pill over the sampled strip. - On an opaque bar the pill is the bar text at 10% so it shows; on a clear bar it is the bar colour. On a glassy bar the pills take the glass and the strip is not drawn, so Omarchy's blur falls on the pills alone. A theme's [bar] pill wins. - Theme keys: pill, pill-alpha, pill-text, pill-border(-alpha), pill-radius, pill-inset, pill-padding, pill-gap, all optional, with commented examples in the theme template. - Every section list draws its own pills, so centerBegin, center and centerEnd each get theirs. The tray's drawer sits inside the tray's pill and draws none. The pill size keys join the [bar] allowlist. - A bare widget at a section end keeps the stock end margin. - Tray icons on the bar follow the pill text colour; the tray popups sit on the popup background and keep the theme text. Bar widgets outside the shell see bar.pillsOn, so a cloned tray does the same. - An odd pill-gap splits so that neighbouring pills are exactly pill-gap apart, and pill-gap and pill-padding keep a deliberate 0. - Dragging the first widget of a pill keeps the pill under its neighbours, and the drag ghost stays under the pointer and sits on the pill colour, so it shows in the pill text colour. Once the dragged widget's room moves away, no empty pill stays behind. - The omarchy agent skill explains pills and their theme keys (plugins.md), and blur behind pills on a clear bar as a layer rule with ignore_alpha (hyprland.md). Border and theme-template examples after omacom#7251. Co-Authored-By: Saco Song <threesking@gmail.com> Co-Authored-By: Claude <noreply@anthropic.com>
Slots sit at the top of a horizontal section, so a pill centered on its first slot sat high when that widget was shorter than the bar: a 16 px widget lifted the pill by 5 px and clipped it at the bar's edge. The pill now measures across the section, which is centered in the bar. A vertical bar's pill takes the section's width the same way, so a narrow first widget no longer narrows the pill for the rest of the run. Stock widgets are all bar-sized and render as before. Co-Authored-By: Claude <noreply@anthropic.com>
A refresh that came in while omarchy-bar-text-color was still sampling was dropped unless pills were involved. Moving the bar or switching floating on a clear bar mid-sample left the text color picked for the old strip until something else asked again. Every such refresh now runs once the current sample is in. Co-Authored-By: Claude <noreply@anthropic.com>
A widget pulled off the bar keeps its layout entry until its poof has played, about 620 ms. Its slot already closes (alongLength is 0), but it still counted as drawn, so in widget mode an empty pill and its padding stayed behind for the length of the poof. A slot pending removal now leaves its pill at once. Co-Authored-By: Claude <noreply@anthropic.com>
ccf7b6a to
64c7cfa
Compare
The omarchy skill's plugins.md became shell.md upstream (c80308f), so the Bar Pills section moves there, after Bar Layout.
Upstream dropped bar-text-color-test.sh (omacom#19904), so it goes here too.
The room a drag opened sat outside the pill run, so it held only the widget's own length. Once the widget landed, its slot gained the pill padding and the widget moved on by that much after the glide: 7 px with the default pill settings in widget mode. The room now takes part in its list's pills as the dragged widget. It gets the padding the widget will have there, draws the pill when it starts one, and the glide lands past the padding.
The settle watchdog finishes any settle within 500 ms, so the floating steps of the bar-drag fixture wait 700 ms instead of 1200 ms. That keeps the fixture well inside its 15 s limit with the pill drop steps from omacom#13139 added to it.
The settle watchdog finishes any settle within 500 ms, so the floating steps of the bar-drag fixture wait 700 ms instead of 1200 ms. That keeps the fixture well inside its 15 s limit with the pill drop steps from omacom#13139 added to it.
# Conflicts: # shell/plugins/bar/Bar.qml
# Conflicts: # bin/omarchy-bar-text-color # shell/plugins/bar/Bar.qml
Comments Outside DiffThese findings could not be posted inline.
|
|
The stale spans note is upstream code too: |
Pills give widgets their own background, so the bar can go clear (
omarchy bar background none) and the widgets still sit on something, or turn into frosted glass pills withglassy. Off by default.Rebased onto the reworked bar (#15517) and the full-screen bar window (#6782). It no longer needs #13137: the pill size keys go into the
[bar]allowlist from 201de1c.Rounded corners, on a floating bar (#13138):
How it works
bar.pillsinshell.json:sectionjoins neighboring widgets into one pill,widgetgives each its own,offdraws none. A theme can set a default with[bar] pills;shell.jsonwins.left,centerBegin,center,centerEndandright. The tray's drawer gets none."size": 0) or a change of"group"between neighbors ends a run."pill": falsekeeps an entry off pills.SegmentRoles, as pure JS inBarModel.js. A widget that hides drops out of its pill without breaking the run or rebuilding the bar.omarchy-bar-text-color --blend, which composites the pill over each wallpaper sample before the contrast and mist checks from Add soft mist behind clear bar on low-contrast wallpapers #20671."pill": falsewidgets use the pill text color, and a bare widget at a section end keeps the stock end margin.bar.pillsOn, so a cloned tray does the same.pill-gapsplits so neighboring pills are exactlypill-gapapart.pill-gapandpill-paddingaccept 0.omarchyagent skill gets a Bar Pills section inshell.md, and a Layer Rules section inhyprland.md: frosted pills come fromglassy, and blur behind translucent pills on a clear bar is a layer rule withignore_alpha.Theme keys
All optional, all in
[bar], with commented examples inshell.toml.tpl:pills,pill,pill-alpha,pill-text,pill-border,pill-border-alpha,pill-radius,pill-inset,pill-padding,pill-gap. Unset, pills use the bar's colors and Hyprland's rounding.This is an alternative to #7251 by @Saco93. It takes #7251's border and theme-template examples (credited as co-author) and draws pills per widget run instead of wrapping each section in a container. That keeps per-widget hover, lets hidden widgets drop out, and avoids re-parenting the section lists.
Unchanged unless enabled
With
pillsunset oroff, the bar renders as on quattro at all four positions, opaque and clear background, clock included. 0 differing pixels, apart from an occasional 1 of 255 on one edge pixel of the weather icon. quattro shows the same pixel against an identical copy of itself, so it is render noise from the distance-field icons (#17003), not this PR.Tests
bar-test.sh: cases for modes, runs, spacer and group splits, hidden widgets, section end margins and odd gaps, and the contrast helpers. #19904 droppedbar-text-color-test.sh, sobar-test.shhas a--blendcase next to #20671's sampler cases instead. Thebar-dragfixture drops a widget at a pill's end in widget and section mode and checks it lands where its room showed it. After the rebase onto #6782, checked again in a nested Hyprland: section pills on an opaque and a clear top bar, frosted widget pills on a glassy top and left bar. The GIFs are built from screenshots in the same setup.Part of a set of opt-in bar changes described in #13136: #13137
[bar]size keys, #13138 floating, #13139 pills, #13140 bar options. Nothing changes unless you turn it on.Claude (Anthropic) wrote most of this under my supervision; I reviewed it and run it on my own Omarchy install.