Repository navigation
Floating bar: margin, radius, a switch and Hyprland-derived defaults - #13138
cristian-fleischer wants to merge 9 commits into
Conversation
c5d950c to
3d04c27
Compare
Automated AI review
Outcome: The floating bar's own geometry and reserved space check out. Popout panels and notification toasts elsewhere in the shell still place themselves as if the bar were flush against the screen edge, so they misalign once floating is on. Two documentation corrections and one large-gap limit follow. Verified:
Popout panels and notification toasts ignore the bar margin
Top bar, 26 px, stock Bottom, left and right bars show the same pattern on their own axes. With a panel open, a click on the bar is forwarded with the same offset, so it can reach a neighbouring widget, or land outside the recognised bar strip and close the panel instead. Impact: Only with floating enabled, so existing setups are unchanged. When it is on, every popout opened from the bar is off-centre and touches or overlaps the bar, toasts do the same, and forwarded clicks can hit the wrong widget. Suggested change: Expose the bar's DocumentationSuggested change: Suggested change: The example Large Optional test improvement: Most of the new Review informationTest scope: Source review of head AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
3d04c27 to
ced6275
Compare
|
Thanks @llstrk, the popout finding was a real bug.
Checked on screen in a nested Hyprland with the bar floating, top and right. |
Automated AI review
Outcome: Follow-up on the earlier review and the author's reply, checked at head
Verified:
Test coverage of the popout fixOptional test improvement: The new popout and toast handling is checked only by matching source text (
A behaviour-preserving rewrite of Plugin bar facade omits
|
ced6275 to
dfc1fab
Compare
|
Thanks @llstrk, all taken.
Another review pass found a few more things, also fixed:
|
Automated AI review
Outcome: At Resolved: popout/toast value tests, A far-edge-only theme margin keeps a floating bar flush
Suggested change: Check only the touched edges in Reproducer (fails at dfc1fab)Each block goes after the line Block 1: a flush-sitting bar is rounded. // A theme margin only on the edge a top bar does not touch leaves the bar
// flush, so it should stay square like any flush bar.
const farEdge = { top: 0, right: 0, bottom: 10, left: 0 }
const farEdgeFloats = bar.barFloating(undefined, farEdge)
assertDeepEqual(bar.windowMargins('top', bar.barMargins(farEdgeFloats, farEdge, gaps, 'top'), 26, false), noMargin, 'a top bar with a bottom-only theme margin sits flush')
assertEqual(bar.barRadius(farEdgeFloats, undefined, 8, 26), 0, 'a top bar that sits flush stays square')Actual output at Block 2: // bar.floating true with a theme margin that touches none of the bar's
// edges should float the bar in the gap, as with no theme margin.
const farEdge = { top: 0, right: 0, bottom: 10, left: 0 }
const switched = bar.barMargins(bar.barFloating(true, farEdge), farEdge, gaps, 'top')
assertDeepEqual(bar.windowMargins('top', switched, 26, false), { top: 6, right: 12, bottom: 0, left: 12 }, 'bar.floating true floats a top bar in the gap when the theme margin is only on its far edge')Actual output at The expected values are one reading of the docs ("a flush bar stays square", "Turn it on with DetailsVerified:
Optional test improvement: of the move preview's geometry, the check covers only assert(
/y: modelData === "bottom" \? parent\.height - edgeSize - edgeMargins\.bottom : edgeMargins\.top/.test(barSource) &&
/width: edgeVertical \? edgeSize : parent\.width - edgeMargins\.left - edgeMargins\.right/.test(barSource) &&
/height: edgeVertical \? parent\.height - edgeMargins\.top - edgeMargins\.bottom : edgeSize/.test(barSource) &&
/radius: BarModel\.barRadius\(root\.floating, Style\.barOverrides\["radius"\] !== undefined \? Style\.bar\.radius : undefined, Style\.cornerRadius, edgeSize\)/.test(barSource),
'the move preview places and rounds every edge like the bar'
)Optional: the comment on Related PR: #13569 also adds a Review informationTest scope: Source and Node 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. |
dfc1fab to
e11b8cd
Compare
|
Thanks @llstrk, fixed. |
[Medium impact] The PR appears safe to merge; no new actionable issues remain. SummaryAdds an opt-in floating bar through
No new actionable issues were established. The previous unnumbered findings are addressed in the current code.
|
e11b8cd to
aeadbb6
Compare
aeadbb6 to
d72cdfc
Compare
|
I wish this or my pr would merge but it feel hopeless |
A detached bar sits its margin off the screen edge, but the panels opened from it, the clicks they forward back to the bar, and notification toasts still placed themselves as if it were flush: with a 10px margin a top bar's panels overlapped it and opened a margin left of their icon, and toasts covered it. Panels now place themselves from the bar window's origin and outer face (PanelGeometry.js), popup cards leave room for the edge margin, and toasts clear it. Widgets get the margins as bar.barMargins and plugins that place their own windows as shell.bar.barMargins, both as copies. Taken from Cristian Fleischer's floating bar work in omacom#13138, without its floating switch. Co-authored-by: Cristian Fleischer <1486327+cristian-fleischer@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QJ9xdGDgAWUqbEooHGuMBS
|
Thanks for keeping at it, and for the co-author credit. Your new commits fix two things #13138 gets wrong too: the wallpaper sample on a scaled screen and a top margin over a notch. I'll take both into #13138 with you as co-author. I think two floating PRs make it harder for the maintainers to say yes to either. What do you think if we make it one? I'm happy to rebase #13138 on #9725, so it only adds the |
d72cdfc to
6cd1167
Compare
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
5c58335 to
9251b39
Compare
ef1d968 to
9b8af02
Compare
e1ded36 to
cbb002a
Compare
201de1c lets icon-slot, icon-canvas, icon-size, icon-font and status-slot through the [bar] parser, which fixes part 1 of omacom#11359. The keys are still missing from docs/omarchy-shell.md and the theme template. docs/omarchy-shell.md and shell.toml.tpl list the keys with their defaults; the Style.qml header names them. icon-font is the font size an icon button renders its glyph and label at; the drawn glyph is rescaled to fit icon-size, so it does not make the icon bigger. Co-Authored-By: Claude <noreply@anthropic.com>
cbb002a to
f533965
Compare
[Rebased onto the full-screen bar window (omacom#6782): the margin insets the painted strip instead of the window, and the exclusive zone grows by it. The [bar] parser setup its test runs moves here from the size-keys test, which upstream no longer needs.]
A bar is usually set further off the edges it spans than off the one it hangs from — sketchybar and waybar both inset 8 at the sides and 4 at the top — which a single margin cannot express. Read the gap through Geometry.parseWidthSpec, the width spec the border widths already take, so margin accepts N, "Y X", "T X B" or "T R B L" with no new vocabulary. A scalar still means every edge. omarchy-bar-text-color crops the wallpaper at the screen edge to choose a legible transparent-mode foreground, a strip a detached bar no longer covers. It takes an --inset now, applied to all four crops. At margin 0 the crops are byte-identical, so a flush bar is untouched. [Rebased onto the full-screen bar window (omacom#6782): the margins inset the painted strip instead of the window. Drag points need no offset there, so the windowScreenPoint() change is dropped. Rebased again onto bounded wallpaper sampling (omacom#14281): the insets scale with the 1920 px sample canvas. The Bar.qml and Style.qml source asserts are dropped, as upstream no longer keeps source-text tests (omacom#16334).]
bar.floating in shell.json turns the detached bar on or off without editing a theme. Unset, a [bar] margin on an edge the bar touches floats it as before; false keeps it flush whatever the theme says. A floating bar with no theme margin floats inside the space a flush bar already has: half of Hyprland's general:gaps_out from the screen edge, so the gap above the bar matches the gap below it, and the full gaps_out at its ends, so they line up with the windows. It reserves only its own thickness, so Hyprland leaves the windows where a flush bar leaves them and switching floating on or off never moves a window. A theme margin is reserved on top of the bar. The radius applies only while the bar floats, so a flush bar stays square; unset it follows decoration:rounding, and it is capped at half the bar thickness. Bar popouts, clicks forwarded while one is open, the drag-off-to-remove distance and notification toasts measure from the strip's inner face, so they follow a floating bar. Popup cards (tray menus, media, the bar options) leave room for the edge margin, and the move preview shows where a floating bar would land. Third-party widgets get the margins as bar.barMargins, and plugins that place their own windows as shell.bar.barMargins, both as copies. A flush bar does not depend on Hyprland's gaps at all. The margins, the strip's place on its screen and the margin reserved past the thickness are BarModel functions, and the toast clearance is Delivery.barReach, all tested by value along with the gaps_out parse. The theme template keeps margin and radius as commented examples, so a generated theme no longer pins radius to 0 and margin reads as unset. The omarchy agent skill (plugins.md) explains the switch, the Hyprland defaults and the theme keys, so an agent asked for a floating bar knows where to look. Co-Authored-By: Claude <noreply@anthropic.com>
The bar's size and its insets are logical pixels, but the screen was measured in hyprctl's physical mode, so on a scaled display the sample missed the strip a floating bar covers. Measure the screen in logical pixels too, and fall back when a top or left inset pushes the strip off the screen instead of sampling what is left of it. From Marc-Anthony Girard's omacom#9725. Co-authored-by: Marc-Anthony Girard <marcanthony.girard.pro@gmail.com> Co-Authored-By: Claude <noreply@anthropic.com>
A theme top margin moves the bar down past part or all of a camera cutout, but the bar still took the whole cutout as its floor and still moved its center sections beside the right one. The cutout now reaches into the bar only as far as it extends past the margin: the floor shrinks by the margin, and a margin that clears the cutout leaves a plain bar with its center in the middle. A flush bar has no margin, so it is unchanged. A bar floating in the gap keeps the flush floor. It reserves only what a flush bar reserves, so a thinner bar there would move the windows when floating is toggled. From Marc-Anthony Girard's omacom#9725. Co-authored-by: Marc-Anthony Girard <marcanthony.girard.pro@gmail.com> Co-Authored-By: Claude <noreply@anthropic.com>
A top bar on a notched screen is taller than barSize, but the radius was capped at half of barSize on every screen: a 50 px bar with radius = 20 got 13 px corners. Each bar surface now caps the radius at half its own thickness. Co-Authored-By: Claude <noreply@anthropic.com>
f533965 to
f75480f
Compare
# Conflicts: # default/themed/shell.toml.tpl # shell/Ui/KeyboardPanel.qml # shell/plugins/bar/Bar.qml
Lets the bar sit off the screen edge and line up with the windows, with the same corners as the windows (square on stock Omarchy). Off by default.
This builds on #9725 by @Marc-AnthonyG, which itself builds on #8975 by @ekrist1. Their two commits are included with authorship kept, rebased onto the reworked bar (#15517), the opaque, glassy and clear backgrounds (#14991) and the full-screen bar window (#6782). On that window the margins inset the painted strip instead of the window, and #9725's drag-point fix is no longer needed, so it is dropped. #9725's
--insetnow scales with the 1920 px sample canvas from #14281. Its Bar.qml and Style.qml source asserts are dropped, since #16334 removed that kind of test. If you'd rather merge #9725 first, the rest of this PR goes on top of it.From #9725
[bar] margininshell.toml, a CSS-style list (N,"Y X","T X B","T R B L") through the existingGeometry.parseWidthSpec, and[bar] radius.omarchy-bar-text-color --inset) accounts for the margin.Added on top
bar.floatinginshell.json(true/false) switches it without editing a theme. Unset, a theme margin on an edge the bar touches floats it as in Feature: Allow user to create floating bar by adding support for custom margin and bar radius. #9725; a margin on the far side alone leaves it flush.general:gaps_outfrom the screen edge, so the gap is the same on both sides of the bar, and the fullgaps_outat its ends, so they line up with the windows (Bar: allow the bar to be inset from the screen edges so it lines up with tiled windows #13027). It reserves only its own thickness, so Hyprland reserves exactly what it reserves for a flush bar and switching floating on or off never moves a window. A theme margin is reserved on top of the bar, as in Feature: Allow user to create floating bar by adding support for custom margin and bar radius. #9725.radiusapplies only while the bar floats, so a flush bar stays square (in Feature: Allow user to create floating bar by adding support for custom margin and bar radius. #9725 a theme radius also rounded the flush bar). Unset, it followsdecoration:rounding; it is capped at half the bar thickness. The opaque and glassy backgrounds both take the rounding.bar.barMargins, and plugins that place their own windows asshell.bar.barMargins, both as copies. Tray menus and the otherPopupCards leave room for the edge margin, and the bar-move preview shows where a floating bar would land.marginandradiusas commented examples, so generated themes don't pinradius = 0.omarchyagent skill (plugins.md) gets a Floating Bar section: the switch, the Hyprland defaults and the theme keys, so an agent asked for a floating bar knows where to look.Unchanged unless enabled
With neither
bar.floatingnor a theme margin, the bar renders exactly as on quattro: 0 differing pixels at all four positions, opaque and clear background (whole-screen diff in a nested Hyprland).Tests
bar-test.sh: value tests for the floating rules (BarModel.barFloating,barMargins,floatsInGap,barRadius), where the strip sits and what the bar reserves (stripRect,reservedMargin), and thegaps_outparse.notifications/logic.cjs: toast clearance (Delivery.barReach, a notch-tall bar included).bar-notch-test.sh: the notch floor less a theme top margin, and a bar floating in the gap reserving what a flush bar reserves.bar-text-color-test.sh: #9725's--insetand scaled-screen cases, and insets on a 4K screen scaled to the sample canvas. After the rebase onto #6782, checked again in a nested Hyprland:bar-drag,bar-icon-geometryandbar-widget-contractpass; a top bar floating in the gap reserves 26 px like a flush one, a theme margin of 10 reserves 36; a left bar floats the same way; the right-click card and a panel open below a floating bar.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.