Skip to content

Size bar tray drawer from reveal extent while collapsed - #13636

Open
AnPod wants to merge 2 commits into
omacom:quattrofrom
AnPod:cursor/fix-tray-drawer-width-e0d3
Open

AnPod wants to merge 2 commits into
omacom:quattrofrom
AnPod:cursor/fix-tray-drawer-width-e0d3

Conversation

@AnPod

@AnPod AnPod commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #13182

The tray reserved its fully expanded width while collapsed, leaving empty bar space beside the chevron.

Supersedes #29 (same fix, this branch adds focused tests).

Change

  • Size drawer block from revealExtent
  • Pin the chevron to the block edge (horizontal and vertical)
  • Add test/shell.d/tray-drawer-width-test.sh

Test plan

  • bash test/shell.d/tray-drawer-width-test.sh
  • Collapse the bar tray; it should only occupy chevron width until expanded

The tray reserved its fully expanded width even when collapsed, leaving
empty bar space beside the chevron. Size from revealExtent and pin the
chevron to the block edge so it holds still as the drawer opens (omacom#13182).

Co-authored-by: AnPod <AnPod@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/fix-tray-drawer-width-e0d3 branch from 8584620 to f243874 Compare September 29, 2026 21:14
@omarchybot omarchybot added the bug Something isn't working label Oct 1, 2026
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 3, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at f243874 and run on an Omarchy ISO worker, with the shell linked to this branch and one tray item (udiskie) in the drawer. Nothing found that needs changing.

The bug reproduces and this fixes it. On quattro the collapsed tray measures 54px in omarchy-shell shell debugBarGeometry: 27px of chevron and 27px of empty space. On this branch it measures 27px, grows to 54px on hover with its right edge fixed, and shrinks back to 27px when the pointer leaves. On a left (vertical) bar it is 27px tall collapsed and 81px with two items expanded, its bottom edge fixed. The vertical case was checked by those measurements only, not by a screenshot.

Tests. tray-drawer-width-test.sh fails on quattro and passes here. tray-test.sh (9/9) and bar-test.sh (88/88) pass. ./test/cli has one failure, vscode generated theme references current theme file, and it fails the same way on quattro, so it is not from this change. The full ./test/shell was not run. No CI checks are reported on this branch.

One visible change for the maintainer to weigh. When the tray is expanded, the chevron now sits between the drawer icons and the pinned icons (icons < pinned) instead of before the drawer icons (< icons pinned), because it stays put while the drawer opens to its left. In the default right section nothing else moves. If the tray is placed in the left section, or in a center section with no center anchor, the chevron and the widgets around it now shift while the drawer opens, where before the space was reserved.

Codex Medium reviewed the diff as a second opinion. It found no defects and named the same chevron-order and left/center-section changes. Its independence from this review is not guaranteed. It also noted that on a stock bar the reserved space sits in empty bar toward the center, so the visible effect is mostly the widget's reported width and any theme that paints behind each module.

This now waits on the maintainer.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 13, 2026
The drawer now also holds bar widgets dragged into the tray section, and sizes itself on hasDrawer rather than on having tray items. Keep that condition and size the block from the rounded reveal extent. The test's check for the old full-extent sizing no longer assumes which condition guards it, so it still catches quattro's line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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 no longer merged into quattro, so I brought it across with a merge commit, 5c21869, rather than a rebase, leaving your commit as it was. Since this was written, quattro gained bar widgets that can live in the tray's drawer (#15281), which changed the drawer's guard from root.allItems.length > 0 to root.hasDrawer on the same two lines this pull request rewrites. The merge keeps hasDrawer and sizes the block from revealPx as before. The two negative checks in tray-drawer-width-test.sh no longer assume which guard comes first, so they still catch quattro's line.

Checked on an Omarchy ISO worker running the shell from this branch, with udiskie as the one tray item. On quattro the collapsed tray is 54px and stays that size. With a bar widget (audio) moved into the tray section it is 81px, also all the time. On this branch the collapsed tray is 27px. Hovering opens it to 54px, or 81px with the audio widget in the section, with its right edge fixed, and it closes back to 27px when the pointer leaves. A screenshot of the open drawer shows both udiskie and the audio widget drawn in it. On a vertical bar it is 27px collapsed and 54px on hover, with its bottom edge fixed. Dragging a widget into an empty tray section was not exercised.

Tests, on the worker. tray-drawer-width-test.sh fails on quattro, passes here, and fails again with only the sizing line reverted. tray-test.sh (12/12), tray-menu-test.sh, bar-test.sh (92/92), bar-notch-test.sh (95/95) and the other bar tests pass. ./test/cli passes. The full ./test/shell passes 390 of 399 files. The 9 that fail (ascii, branding-about-animation, hyprland-startup-cursor-cold, menu-guards, plugin-validate, runtime-smoke, screenshot-sanity, webapp-install, webp-background-migration) fail the same way on quattro on the same worker. No CI checks are reported on this branch.

No second opinion ran on this revision. The reviewer omabot uses (Codex Medium) had reached its daily limit, so this port was checked by one model only, Claude Opus 5.5. The earlier review of f243874 by Codex Medium does not cover the merge. This waits on a second review of 5c21869, and then on the maintainer.

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

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium impact] Changes how the collapsed tray drawer sizes and hit-tests.

The PR appears safe to merge, with a non-blocking gap in the new test's coverage.

Findings

  1. P2 Tests miss drawer behavior ▶

Summary

The tray now takes only the chevron's space when collapsed and grows with the reveal animation.

  • Collapsed tray drawers take space only as they open.

Reviews (1) · Last reviewed commit: "Merge quattro into the tray drawer sizin..." · Reviewed by Greptile

Comment on lines +20 to +31
grep -Fq 'expandIcon.implicitWidth + revealPx' "$tray" ||
fail "horizontal drawer block width uses revealPx"
grep -Fq 'expandIcon.implicitHeight + revealPx' "$tray" ||
fail "vertical drawer block height uses revealPx"
grep -Fq 'x: horizontalTrayRoot.drawerBlockWidth - width' "$tray" ||
fail "horizontal chevron pins to the block's trailing edge"
grep -Fq 'y: verticalTrayRoot.drawerBlockHeight - height' "$tray" ||
fail "vertical chevron pins to the block's trailing edge"
grep -Fq 'width: horizontalTrayRoot.revealPx' "$tray" ||
fail "horizontal icon clip tracks revealPx"
grep -Fq 'height: verticalTrayRoot.revealPx' "$tray" ||
fail "vertical icon clip tracks revealPx"

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 Tests miss drawer behavior

The new test checks source strings, not drawer sizes or positions. It would still pass if revealProgress stopped reaching zero or the parent stopped using the tray's changing size. Add a QML test that measures the collapsed and expanded drawer in both orientations, including the chevron's position in the bar.

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!

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