Repository navigation
Let bar widgets live in drawers of their own - #15987
uBruckhaus wants to merge 2 commits into
Conversation
[Medium impact] The changes reach the top-bar drawer workflow and its placement tools. The contributor-rule violations should be fixed before merging; the cross-monitor hover issue is non-blocking. FindingsSummaryAdds named drawers to the bar, including widget moves, CLI placement, tooltips, and tests.
Reviews (3) · Last reviewed commit: "Keep drawers out of drawers from the com..." · Reviewed by Greptile |
A drawer is a bar entry with "type": "drawer" and an id of its own. Its widgets are a section of their own, drawer:<id>, kept under bar.layout.drawers.<id> and drawn inside the drawer the way the tray section is drawn inside the tray's drawer. A click on its button opens and closes it, or "reveal": "hover" opens it while the pointer is over it. Every drawer opens while a widget is dragged along the bar, and a drop anywhere over a drawer, its button too, goes into it. A panel open from a widget in a drawer keeps the drawer open. A drawer opens away from the edge its section keeps to. Drawer sections are ordinary sections in BarModel's layoutWidgets, moveEntry and dropRoom, so widgets keep their instance moving in and out. The tray and drawers cannot go into a drawer. omarchy bar takes --section drawer:<id>, and get finds widgets in drawers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omarchy bar move took a drawer into another drawer or the tray's drawer, where it has no section of its own and its widgets are not drawn. The registry now refuses it as it does the tray, beside a widget in a drawer too, knowing the drawer by the entry being moved. omarchy bar get reads only drawers on the bar, as the shell does, so it no longer finds settings of widgets that set cannot reach. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f577b85 to
ae9b7df
Compare
| Timer { | ||
| id: collapseDelay | ||
| interval: 450 | ||
| onTriggered: if (drawer.hoverReveal && !drawerHover.hovered) drawer.setOpen(false) |
There was a problem hiding this comment.
Each monitor has its own collapseDelay, but all copies of a drawer share drawerOpenState. With reveal: "hover", leaving one copy and entering another within 450 ms lets the first monitor's timer close both copies. It checks only its own drawerHover.hovered, so the second drawer closes under the pointer.
Track hover across copies before clearing the shared state, or keep hover-open state local.
| assertDeepEqual(bar.sectionDropTarget([], zone, { x: 705 }, false, null, 'drawer:home'), { region: 'drawer:home', after: true }, 'over an empty drawer, a drop lands in it') | ||
|
|
||
| assert(tray.layoutHasWidget({ right: [], drawers: { home: [{ id: 'omarchy.dropbox' }] } }, 'omarchy.dropbox'), 'a widget in a drawer counts as on the bar for the tray') | ||
| assert(/drawerCustom: customType === "drawer"/.test(barSource) && /component DrawerModule/.test(barSource), 'the bar draws drawer entries with its drawer module') |
There was a problem hiding this comment.
Tests repeat the implementation
The new assertions match literal source text rather than drawer behavior. AGENTS.md forbids tests that restate the implementation by searching for strings just added. The same pattern appears on lines 768 and 771.
Replace these with behavior checks, or remove them where the drawer fixture already covers the behavior. This repository requirement must be satisfied before merging.
File Used: AGENTS.md (source)
| `omarchy.tray` is on the bar; it cannot hold the tray itself. Each drawer on | ||
| the bar adds a section `drawer:<id>`, kept under `bar.layout.drawers.<id>` | ||
| (see *Drawers* below). |
There was a problem hiding this comment.
Added prose breaks Markdown style
The added drawer description is hard-wrapped across several Markdown lines. AGENTS.md requires full lines in docs/, with breaks only at structural boundaries.
Keep the added prose on one line rather than extending the existing hard wrapping. This repository requirement must be satisfied before merging.
| `omarchy.tray` is on the bar; it cannot hold the tray itself. Each drawer on | |
| the bar adds a section `drawer:<id>`, kept under `bar.layout.drawers.<id>` | |
| (see *Drawers* below). | |
| `omarchy.tray` is on the bar; it cannot hold the tray itself. Each drawer on the bar adds a section `drawer:<id>`, kept under `bar.layout.drawers.<id>` (see *Drawers* below). |
File Used: AGENTS.md (source)
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!
Builds on the tray section from #15281: a drawer is a bar entry with
"type": "drawer"and an id of its own, and its widgets are a section of their own,drawer:<id>, drawn inside the drawer the way the tray section is drawn inside the tray's drawer. It is the first-party shape discussed in #10895."reveal": "hover"opens it while the pointer is over it instead. It starts closed unless the entry says"collapsed": false.nameis the tooltip (with the widget count),iconthe button's glyph,colortints the button and a thin line along the open drawer.left,centerBegin,center,centerEndorright, and opens away from the edge its section keeps to, as the tray does: toward the middle on the right, outward beside the center box.BarModel.layoutWidgets,moveEntryanddropRoom.BarModel.moveEntryand the plugin registry all refuse it). Widgets underdrawerswhose drawer is no longer on the bar are not drawn and count as off the bar.omarchy bar move <id> --section drawer:<id>andputplace widgets in a drawer, andomarchy bar getfinds them there. The tray's own "is this widget on the bar" check looks in drawers too.shell/Commons/BarLayout.jsfor Util, the registry andshell.qml;BarModel.jskeeps its own copy for plainrequire, and a test checks the two agree, as the existing section-list test does.docs/omarchy-shell.md,manual/05-the-top-bar.md) describe the entry; one new string,bar.drawerWidgets(plural, English only).Tests: new cases in
bar-test.sh(sections, moves in and out, nested drawers ignored, the tray and drawers kept out), the plugin-registry fixture (move into and out of a drawer, settings on a widget in a drawer, the tray refused), and thebar-dragQML fixture now drags a widget out of a drawer and back in through the bar's own pointer handlers, checking it stays the same instance and that a drawer is not dropped into itself (its wait goes from 10 to 20 s for the extra steps). Full./test/shellin an edge VM: 6876 ok, and the 14 failures there also fail on plainquattroin the same VM.Tried by hand in an edge VM with a virtual pointer: a widget dragged from the bar into a drawer (over its widgets and over its button), from one drawer into another that opens the other way, and back out onto the bar lands where dropped; a drawer dragged onto another lands beside it, and the other drawers stay closed meanwhile; a click on a drawer's button closes and opens it.
omarchy bar moveinto and out of a drawer,bar geton a widget in one, and moving the tray into one (refused) work from the command line.🤖 Generated with Claude Code