Skip to content

Reserve only revealed tray drawer width when collapsed - #13473

Closed
AnPod wants to merge 2 commits into
omacom:quattrofrom
AnPod:fix/tray-collapsed-width
Closed

AnPod wants to merge 2 commits into
omacom:quattrofrom
AnPod:fix/tray-collapsed-width

Conversation

@AnPod

@AnPod AnPod commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Summary

omarchy.tray permanently occupied its fully-expanded drawer footprint on the bar (expandIcon.implicitWidth + root.drawerExtent), leaving empty dead space on the bar while collapsed (#13182).

This updates drawerBlockWidth (and vertical drawerBlockHeight) to derive from Math.round(root.revealExtent) rather than the static full extent, pinning the chevron to the right/bottom edge of the growing drawer block so the collapsed tray occupies only its visible width.

Fixes #13182

Testing

  • Ran bash test/shell.d/tray-test.sh (all 9 assertions pass).

The tray widget permanently occupied its fully-expanded drawer footprint
on the bar (omacom#13182).

Co-authored-by: AnPod <AnPod@users.noreply.github.com>
@cursor
cursor Bot force-pushed the fix/tray-collapsed-width branch from 70ed634 to 6dc987b Compare September 29, 2026 21:03
@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 1, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 6dc987b and reproduced on a disposable Omarchy VM with the shell loaded from each tree and two tray items registered. On quattro the collapsed tray is 81px wide, 54px of it empty beside the chevron; on this branch it is 27px collapsed and grows to 81px when hovered, with the widgets to its right staying put. The same holds with the bar on the left: 27px tall collapsed, 81px hovered. tray-test.sh, tray-menu-test.sh, bar-test.sh, bar-icon-geometry-test.sh and bar-widget-contract-test.sh pass on the worker. ./test/cli stops at a vscode theme check that fails the same way on quattro, so that is not this change.

One visible change beyond the fix: when the drawer is open, the icons now sit to the left of the chevron (above it on a vertical bar), where before the chevron came first and the icons followed it. That comes from keeping the chevron still while the drawer opens. The gap could also be closed with the old order kept, by leaving the chevron at the start of the block and growing the clip after it, so which arrangement to ship is the maintainer's call. It is not a defect.

Codex Medium reviewed it as a second opinion and found no defect. It checked hover across left, center and right placements and found nothing that would make the drawer open and close in a loop as the widget resizes. It also confirmed that collapsed icons take no clicks, because their clip is zero-width. It agreed with the ordering note above, which was already in its brief, so that part is agreement and independence is not guaranteed.

#13636 makes the same change to Tray.qml and adds a test that greps the source. This one is older and is the one carried forward. Linked to #13182, which it closes. Nothing is left for you; it waits on the maintainer.

@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Oct 13, 2026
Brings the fix across the tray drawer section from omacom#15281: the drawer block keeps quattro's hasDrawer guard, so a tray holding only bar widgets still gets one, and reserves only the revealed extent as before.
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 13, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This stopped merging cleanly after #15281 landed on quattro, which puts bar widgets in the tray's drawer. I merged quattro into the branch (e5ece13). The only conflict was the two drawerBlockWidth/drawerBlockHeight lines in Tray.qml. The resolution keeps quattro's root.hasDrawer guard, so a tray holding only bar widgets still gets its chevron, and keeps this branch's revealed extent. No rebase and no force push, so your commit is unchanged.

The merge was checked again on a disposable Omarchy VM with the shell loaded from each tree and two tray items registered. On quattro the collapsed tray is 81px, and it is 81px again with Tray.qml put back to quattro's. On this branch it is 27px collapsed, 81px when hovered with the widgets to its right unmoved, and 27px again when the pointer leaves. With omarchy.audio moved into the drawer it is 27px collapsed and 108px open. With only that widget in the drawer it is 27px and 54px. On a left bar it is 27px tall collapsed and 108px open. tray-test.sh, tray-menu-test.sh, bar-test.sh, bar-icon-geometry-test.sh, bar-widget-contract-test.sh and ./test/cli pass on the worker. I also read the drag-and-drop code from #15281. Drop targets are measured when the drop happens, so a drawer that opens during a drag is measured as it is drawn.

No second opinion ran on this revision. The reviewer, Codex Medium, was reachable, but omabot's daily review budget was already spent, so this check is one model's alone. The branch keeps verified but does not get ready until a second opinion has reviewed this head. After that it waits on the maintainer, and nothing is left for you.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium impact] Adjusts how the tray drawer reserves space when collapsed.

The PR appears safe to merge, with a non-blocking gap in tests for the changed drawer layout.

Findings

  1. P2 Drawer layout goes unchecked ▶

Summary

The tray now reserves space only for its chevron and the revealed part of its drawer.

  • Tray drawers reserve only the space they have revealed.

Reviews (1) · Last reviewed commit: "Merge quattro into fix/tray-collapsed-wi..." · Reviewed by Greptile

// Only reserve the chevron plus the currently revealed drawer width so a
// collapsed tray does not permanently occupy its fully-expanded footprint
// on the bar (#13182).
readonly property int drawerBlockWidth: root.hasDrawer ? expandIcon.implicitWidth + Math.round(root.revealExtent) : 0

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.

P2 Drawer layout goes unchecked

The changed drawer layout has no regression test. tray-test.sh only checks TrayModel.js helpers, so it passes even if the collapsed drawer reserves extra space or the chevron overlaps an icon. Add checks for collapsed, partly revealed, and fully open states in both orientations, including pinned items.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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

Copy link
Copy Markdown
Collaborator

This stopped merging cleanly again, and this time I have not ported it. quattro now fixes #13182 on its own. b7e900c (#15517, "Rework bar dragging, sections and widget orientation") rewrote shell/plugins/bar/widgets/Tray.qml so the tray's size counts only the drawer it has revealed. In the horizontal bar, horizontalTrayRoot.implicitWidth is the pinned row plus the chevron plus root.revealExtent, and drawerArea and trayClip shrink with it. The vertical bar does the same with heights. The old containmentMask that hid the dead region from hover is gone, because there is no dead region left to hide.

I checked this on a disposable Omarchy VM, with the shell loaded from quattro at 246f33a and two tray items registered. The collapsed tray measured 27px, which is the chevron alone. On quattro before #15517, the same setup measured 81px, as reported in #13182 and in my earlier comment here. This was the only behaviour I tested; I didn't run the suite, since nothing from this branch would land.

Codex Medium also reviewed it, reading the source only. It agreed that quattro covers the horizontal and vertical bars, with and without bar widgets in the tray section, and that Bar.qml adds no reservation of its own on top. It found nothing in this branch that quattro lacks and a user would notice. Rounding revealExtent moves frames mid-animation by at most half a pixel, and both trees are exactly zero when collapsed. It had my conclusion in front of it, so take that as agreement rather than an independent check.

The decision is the maintainer's: this pull request and #13182 look ready to close as fixed by #15517. Thank you for the precise report and fix, @AnPod. The measurement in #13182 is what made this quick to confirm.

AnPod commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of my older PR #13636, which carries the same fix.

@AnPod AnPod closed this Oct 23, 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.

Bar tray reserves its fully-expanded drawer width while collapsed, occupying bar space it never paints

3 participants