Skip to content

Let bar widgets live in drawers of their own - #15987

Open
uBruckhaus wants to merge 2 commits into
omacom:quattrofrom
uBruckhaus:bar-drawers
Open

uBruckhaus wants to merge 2 commits into
omacom:quattrofrom
uBruckhaus:bar-drawers

Conversation

@uBruckhaus

Copy link
Copy Markdown

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.

"right": [ { "id": "home", "type": "drawer", "name": "Home", "icon": "󰋜", "color": "#f38d70" } ],
"drawers": { "home": [ { "id": "omarchy.bluetooth" }, { "id": "omarchy.audio" } ] }
  • A click on the drawer's button opens and closes it; "reveal": "hover" opens it while the pointer is over it instead. It starts closed unless the entry says "collapsed": false. name is the tooltip (with the widget count), icon the button's glyph, color tints the button and a thin line along the open drawer.
  • A drawer can sit in left, centerBegin, center, centerEnd or right, 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.
  • Every drawer opens while a widget is dragged along the bar, and a drop anywhere over it, its button included, lands among its widgets, or in it when it is empty; a drop on the neighbouring widget lands beside it. Unlike the tray's chevron, which belongs to the bar, a drawer's button is the drawer. A panel open from a widget in a drawer keeps the drawer open.
  • Widgets moved in and out of a drawer keep their instance, like any other move since Rework bar dragging, sections and widget orientation #15517: drawer sections are ordinary sections in BarModel.layoutWidgets, moveEntry and dropRoom.
  • The tray and drawers never go into a drawer (the drop targets, BarModel.moveEntry and the plugin registry all refuse it). Widgets under drawers whose drawer is no longer on the bar are not drawn and count as off the bar.
  • omarchy bar move <id> --section drawer:<id> and put place widgets in a drawer, and omarchy bar get finds them there. The tray's own "is this widget on the bar" check looks in drawers too.
  • The section names live in shell/Commons/BarLayout.js for Util, the registry and shell.qml; BarModel.js keeps its own copy for plain require, and a test checks the two agree, as the existing section-list test does.
  • Docs (docs/omarchy-shell.md, manual/05-the-top-bar.md) describe the entry; one new string, bar.drawerWidgets (plural, English only).
  • Existing configs are untouched: no migration, and a layout without drawers behaves exactly as before.

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 the bar-drag QML 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/shell in an edge VM: 6876 ok, and the 14 failures there also fail on plain quattro in 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 move into and out of a drawer, bar get on a widget in one, and moving the tray into one (refused) work from the command line.

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[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.

Findings

  1. P2 Hovered drawer closes ▶
  2. P2 Tests repeat the implementation ▶
  3. P2 Added prose breaks Markdown style ▶

Summary

Adds named drawers to the bar, including widget moves, CLI placement, tooltips, and tests.

  • Drawer buttons open their own groups of bar widgets.
  • Drawer widget groups work as sections across bar layouts and commands.

Reviews (3) · Last reviewed commit: "Keep drawers out of drawers from the com..." · Reviewed by Greptile

Comment thread shell/services/PluginRegistry.qml Resolved
Comment thread bin/omarchy-bar Resolved
@omarchybot omarchybot added the enhancement New feature or request label Oct 21, 2026
Uwe Bruckhaus and others added 2 commits October 22, 2026 12:48
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>
Comment thread shell/plugins/bar/Bar.qml
Timer {
id: collapseDelay
interval: 450
onTriggered: if (drawer.hoverReveal && !drawerHover.hovered) drawer.setOpen(false)

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 Hovered drawer closes

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.

Comment thread test/shell.d/bar-test.sh
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')

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 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)

Comment thread docs/omarchy-shell.md
Comment on lines +175 to +177
`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).

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 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.

Suggested change
`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!

@omarchybot omarchybot removed the enhancement New feature or request label Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants