Skip to content

Fix lopsided cursor highlight on network panel header actions - #8787

Merged
dhh merged 3 commits into
omacom:quattrofrom
mayaanhafeez:fix-network-panel-header-action-highlight
Oct 9, 2026
Merged

dhh merged 3 commits into
omacom:quattrofrom
mayaanhafeez:fix-network-panel-header-action-highlight

Conversation

@mayaanhafeez

@mayaanhafeez mayaanhafeez commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The QR and speed-test header actions in the network panel (shell/plugins/panels/network/Panel.qml) were Buttons with asymmetric padding (horizontalPadding: Style.space(5), verticalPadding: Style.space(2)). Their keyboard/hover highlight came out taller than wide (27×33 and 29×33 at scale 1), and the icon sat off-centre horizontally (7px left / 5px right at 1.25).
  • Swapped both to PanelActionButton, the kit's square inline action, as the Bluetooth row action already uses. hasCursor, hovered(bool), clicked() and tooltipText carry over unchanged.
  • In PanelActionButton (from @fabianbehrendt's review), the size is rounded and made odd, and the icon is placed on whole pixels with Math.round instead of anchors.centerIn. Before this, a fractional size put the glyph on half-pixel coordinates, so it rounded a pixel or more off the centre of the fill, mostly low. The odd size lets odd-width glyphs get even margins. It applies to every PanelActionButton, so the default grows from 22 to 23.

As with other PanelActionButton cursor targets, the highlight has no 1px hover border and no separate pressed fill.

Fixes #8782

Before / after

Measured in the real Network panel with the keyboard cursor on QR (left column) and speed test (right column), running each tree in place of the live shell. Physical pixels of fill between the icon ink and the highlight edge, left/right · top/bottom:

1600×900 @ 1.25

Laptop at 1.25: quattro, this PR before rounding, this PR now
box QR speed test
quattro (Button) 34×41 7/5 · 10/10 7/5 · 10/10
PanelActionButton, unrounded 35×35 8/7 · 7/9 7/6 · 7/10
this PR 36×36 8/8 · 8/9 7/7 · 8/9

1920×1080 @ 1

TV at 1: quattro, this PR before rounding, this PR now
box QR speed test
quattro (Button) 27×33 / 29×33 5/4 · 7/8 5/4 · 8/8
PanelActionButton, unrounded 28×28 6/6 · 5/7 5/5 · 6/7
this PR 29×29 6/7 · 6/7 5/6 · 7/7

Test plan

  • ./test/cli passes
  • network, network-qr, network-password, border-geometry, button-border-stability, row-border-stability, bluetooth, clock and qml-text-format shell tests pass on the branch merged with current quattro
  • Verified visually on both screens above. The clock panel's month arrows (also PanelActionButton) show no layout shift against quattro on either screen.

The QR and speed-test header buttons used raw Button components with
asymmetric horizontal/vertical padding, producing a highlight box wider
than tall around their near-square icons. Swap them for
PanelActionButton, the canonical square inline-action component already
used elsewhere in the kit (e.g. connectPwBtn), which sizes itself
symmetrically around the icon.

Fixes omacom#8782

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings August 28, 2026 17:03

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

Replaces asymmetric network header buttons with canonical square action buttons to align cursor highlights.

Changes:

  • Migrates QR and speed-test actions to PanelActionButton.
  • Preserves existing icons, tooltips, cursor handling, and click behavior.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.


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

@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review labels Sep 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 725136e, and the fix does what it says.

Reproduced on a worker. I built a Quickshell fixture from the QR and speed-test declarations in this tree's shell/plugins/panels/network/Panel.qml, put the cursor on each, and measured the highlight box on an Omarchy ISO worker. On quattro (c05d901) the boxes are 27×33 and 29×33, so not square. With the default shell font they come out taller than wide rather than the 30×24 the issue predicted, but they are lopsided either way. On this head, and on this head merged onto current quattro, both are 28×28. With the change reverted on top of that merge, they go back to 27×33 and 29×33.

Review. The change is the right size for the problem: two elements move to PanelActionButton, the kit's square inline action, and every property and handler the panel's header cursor uses carries over unchanged. Swapping Button for PanelActionButton also drops Button's 1px hover border and its pressed fill. That matches every other PanelActionButton used as a cursor target, such as the Bluetooth row action and the dev gallery. No other open pull request touches these two actions, and it merges cleanly onto quattro.

Tests, on the worker. ./test/cli passed. network, network-qr, network-password, network-manager-transition, button-border-stability, border-geometry, bluetooth and plugin-clone passed on both this head and quattro. The full ./test/shell on this head merged onto quattro fails the same seven files as quattro alone: ascii, branding-about-animation, kernel-headers-migration, network-captive-portal, omarchy-kernel-migration, passwordless-grant-lifecycle and video-background. windows-vm-compose also failed on the merge and manifest-entrypoints on quattro, but both passed when rerun on both trees. None of these failures is caused by this change.

Second opinion: none. The configured reviewer, Codex Medium, answers, but its daily review budget was spent when this ran, so this review is one model's (Claude Opus 5.5). Before this can be marked ready, the second review needs to run on this head. After that, it is the maintainer's call. Nothing is needed from you.

@fabianbehrendt

fabianbehrendt commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for this. Switching to PanelActionButton makes the highlight square. I measured the rendered result (1600×900, scale 1, JetBrainsMono Nerd Font), and the speed-test icon still sits low in the box (6px gap above, 8px below). That comes from sub-pixel positioning, not from the glyph.

size comes from fontSize + spacing * 2, and with fontSize: Style.font.subtitle * 1.5 (19.5px) it can be fractional. The icon Text is also only ~14.98px wide, so anchors.centerIn puts it on half-pixel coordinates, and the glyph then snaps a pixel away from the center of the fill.

Pixel gaps between the icon ink and the highlight box (left / right / top / bottom):

QR Speed test
This PR 7 / 6 / 6 / 7 6 / 5 / 6 / 8
+ rounded size and icon position 7 / 6 / 7 / 6 6 / 5 / 7 / 7
+ odd size 7 / 7 / 7 / 7 6 / 6 / 7 / 8

Suggested change to shell/Ui/PanelActionButton.qml:

-  property real size: Math.max(Style.space(22), fontSize + Style.spacing.sm * 2)
+  property real size: Math.round(Math.max(Style.space(22), fontSize + Style.spacing.sm * 2))
   Text {
     textFormat: Text.PlainText
-    anchors.centerIn: parent
+    // Snap to whole pixels so the glyph doesn't round away from the fill's center.
+    x: Math.round((root.width - width) / 2)
+    y: Math.round((root.height - height) / 2)

Optional: these two glyphs paint an odd number of pixels wide (15 and 17px). An even 28px box therefore can't center them exactly and always leaves a 1px imbalance. Forcing an odd size (... ) | 1, giving 29px) gives the bottom row of the table. It's tuned to these glyphs, though, so I'd treat it as a nice-to-have rather than part of the fix.

Ui/Button.qml uses the same anchors.horizontalCenter pattern and has the same issue: before this PR, these buttons were 1px off horizontally (7 / 5 gaps). Rounding implicitWidth up (Math.ceil(row.implicitWidth)) and setting x: Math.round((root.width - width) / 2) on the inner Row fixed it there. I can send that as a separate PR if it's useful.

🤖 Generated with Claude Code

mayaanhafeez and others added 2 commits October 9, 2026 01:40
A fractional size and anchors.centerIn put the glyph on half-pixel
coordinates, so it rounded a pixel off the center of the fill: the
speed-test icon sat low in the network header. Round the size, make it
odd so odd-width glyphs get even margins, and place the icon on whole
pixels.

Co-authored-by: Fabian Behrendt <7931874+fabianbehrendt@users.noreply.github.com>
…network-panel-header-action-highlight

# Conflicts:
#	shell/Ui/PanelActionButton.qml
@mayaanhafeez

Copy link
Copy Markdown
Contributor Author

Pushed ed36f81, plus a merge of current quattro (9887137) to clear the conflict with the textFormat change in the same file. The commit takes @fabianbehrendt's PanelActionButton suggestion in full: the size is rounded and made odd, and the icon is placed with Math.round instead of anchors.centerIn. Thanks Fabian, and you're credited as co-author on the commit.

I tested it in the real Network panel (not a fixture) on both of my screens, running stock quattro, this PR before the push, and this PR now in place of the live shell. The keyboard cursor is on QR in the left column and on the speed test in the right column, scaled with nearest-neighbour so the pixels stay crisp.

Laptop panel, 1600×900 @ 1.25

image

TV, 1920×1080 @ 1

image

Physical pixels of fill between the icon ink and the highlight edge (inside the 1px border for Button), left/right · top/bottom:

box QR speed test
@ 1.25 quattro 34×41 7/5 · 10/10 7/5 · 10/10
@ 1.25 #8787 before 35×35 8/7 · 7/9 7/6 · 7/10
@ 1.25 #8787 now 36×36 8/8 · 8/9 7/7 · 8/9
@ 1 quattro 27×33 / 29×33 5/4 · 7/8 5/4 · 8/8
@ 1 #8787 before 28×28 6/6 · 5/7 5/5 · 6/7
@ 1 #8787 now 29×29 6/7 · 6/7 5/6 · 7/7

The icons no longer sit low: the worst case drops from 3px to 1px at 1.25, and from 2px to at most 1px at 1. At 1.25, the odd size also makes left and right exact. At 1 it leaves a 1px horizontal difference, as Fabian expected, since it's tuned to these glyph widths.

The odd size applies to every PanelActionButton, so the default grows from 22 to 23. I checked the clock panel's month arrows on both screens: whole-screen diffs against quattro show no layout shift. ./test/cli passes, and so do the network, network-qr, network-password, border-geometry, button-border-stability, row-border-stability, bluetooth, clock and qml-text-format shell tests, run on the merged tree.

Fabian, your separate Button fix (Math.ceil + rounded x) also tested well here. It took the stock buttons from 7/5 to 6/6 at 1.25, so a PR for it would be welcome.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 9, 2026
@greptile-apps

greptile-apps Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable defects were found.

Summary

The network header now uses PanelActionButton for the QR and speed-test actions. The shared button also uses odd, whole-number dimensions and rounds icon positions.

  • Existing action handlers and cursor wiring remain unchanged.
  • No actionable issues were found.
  • Visual checks were not run here because no QML runtime was available.

Reviews (1) · Last reviewed commit: "Merge branch 'quattro' of https://github..." · Reviewed by Greptile

@dhh
dhh merged commit be05233 into omacom:quattro Oct 9, 2026
1 check passed
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 9, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 725136e, and the fix does what it says.

Reproduced on a worker. I built a Quickshell fixture from the QR and speed-test declarations in this tree's shell/plugins/panels/network/Panel.qml, put the cursor on each, and measured the highlight box on an Omarchy ISO worker. On quattro (c05d901) the boxes are 27×33 and 29×33, so not square. With the default shell font they come out taller than wide rather than the 30×24 the issue predicted, but they are lopsided either way. On this head, and on this head merged onto current quattro, both are 28×28. With the change reverted on top of that merge, they go back to 27×33 and 29×33.

Review. The change is the right size for the problem: two elements move to PanelActionButton, the kit's square inline action, and every property and handler the panel's header cursor uses carries over unchanged. Swapping Button for PanelActionButton also drops Button's 1px hover border and its pressed fill. That matches every other PanelActionButton used as a cursor target, such as the Bluetooth row action and the dev gallery. No other open pull request touches these two actions, and it merges cleanly onto quattro.

Tests, on the worker. ./test/cli passed. network, network-qr, network-password, network-manager-transition, button-border-stability, border-geometry, bluetooth and plugin-clone passed on both this head and quattro. The full ./test/shell on this head merged onto quattro fails the same seven files as quattro alone: ascii, branding-about-animation, kernel-headers-migration, network-captive-portal, omarchy-kernel-migration, passwordless-grant-lifecycle and video-background. windows-vm-compose also failed on the merge and manifest-entrypoints on quattro, but both passed when rerun on both trees. None of these failures is caused by this change.

Second opinion: none. The configured reviewer, Codex Medium, answers, but its daily review budget was spent when this ran, so this review is one model's (Claude Opus 5.5). Before this can be marked ready, the second review needs to run on this head. After that, it is the maintainer's call. Nothing is needed from you.

@omarchybot

Copy link
Copy Markdown
Collaborator

Please disregard the comment just above. It repeated the 1 October review by mistake, and this is the review of the current head.

Re-reviewed at 9887137, with the centring commit and the quattro merge. The highlight fix still holds, and the centring change does what it says.

On a worker. I rendered the panel's own QR and speed-test actions, as each tree declares them, in a real window on an Omarchy ISO worker, with the cursor on each and JetBrainsMono Nerd Font. Then I measured the highlight box and the icon ink inside it. On quattro (c352b62), the boxes are 27×33 and 29×33. On this head, both are 29×29. With the change reverted, they go back to 27×33 and 29×33. Compared with the head before ed36f81, the icons now sit within a pixel of centre on both axes: the QR gaps went from 6/5 · 5/7 to 6/6 · 6/7, and the speed test from 5/4 · 6/7 to 5/5 · 7/7. A default-size PanelActionButton grows from 22 to 23 and is better centred too.

Tests, on the worker. ./test/cli passed. The full ./test/shell fails 6 of 322 files on this head: ascii, branding-about-animation, default-agent, hyprland-startup-cursor-cold, passwordless-grant-lifecycle and screenshot-sanity. All six fail the same way on quattro alone, so this change causes none of them.

Second opinion: Codex Medium, reading the code at this head.

  • It found no layout that the 1px growth breaks across the other PanelActionButton callers (clock, Bluetooth, Tailscale, Dropbox, elsewhen, the dev gallery). The header cursor, tooltips and click handling carry over.
  • It found two comments this change makes wrong, and I confirmed both. shell/Ui/PanelActionButton.qml:5 still says "22×22 by default", and shell/plugins/panels/network/Panel.qml:2093 still says "22×22 right-anchored". Both are now 23×23.
  • It also raised a theme with no hover fill and only a hover border, where these two actions would show no cursor. I did not count that against this PR. No shipped theme does that, and the existing PanelActionButton cursor targets, such as Bluetooth's Forget, behave the same way.

What it waits on. I tried to push the two-line comment fix to your branch, but GitHub refused the push. Could you change 22×22 to 23×23 on those two lines? After that, the second opinion needs to come back clean at the new head, and then it is the maintainer's call.

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.

Wi-Fi network panel: QR / speed-test header highlight doesn't line up with the button

6 participants