Skip to content

Let bar widgets live in the tray's drawer - #15281

Merged
dhh merged 5 commits into
quattrofrom
bar-tray-section
Oct 13, 2026
Merged

dhh merged 5 commits into
quattrofrom
bar-tray-section

Conversation

@dhh

@dhh dhh commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Adds a fourth bar section, tray, drawn inside the tray's drawer after the app icons, so any bar widget can be tucked away there.

  • Drag a widget onto the tray to put it in the drawer; drag it back out to return it. The drawer opens during any widget drag and offers an empty slot when the section is empty.
  • The drawer stays open while a tray menu, the tray manager, or a panel from a widget in it is open.
  • omarchy bar move <id> --section tray, omarchy plugin enable <id> --section tray, and barWidget.defaultSection: "tray" in a manifest all put a widget straight into it. Sections are now left|center|tray|right.
  • The open-panel mark under the tray sits under the icon whose menu is open, not the middle of the tray.
  • Superwhisper's own tray icon is hidden while its superwhisper.panel bar widget is on the bar, the way Dropbox's already is.

Reviewed with Codex; its three findings (empty tray hidden during a drag, the tray accepted into its own drawer over IPC, and a drop-target tie at the drawer's edge) are fixed here.

Verified in the running shell: a widget in the tray section shows in the drawer, opens its panel from there with the mark under it, and holds the drawer open. Dragging itself could not be automated here and still needs a manual try.

🤖 Generated with Claude Code

dhh and others added 2 commits October 13, 2026 20:45
A fourth bar section, tray, is drawn inside the tray's drawer after the app
icons. Dragging a widget onto the tray drops it there, the drawer stays open
while a widget is dragged or one of its panels is up, and plugins can name
tray as their default section. The open-panel mark under the tray now sits
under the icon whose menu is open instead of the middle of the tray.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with a non-blocking error-message bug for a tray clone whose default points into its own drawer.

Findings

  1. P2 Tray enable loses its explanation ▶

Summary

Adds a tray section for widgets inside the tray drawer.

  • Bar widgets can live inside the tray drawer.
  • Bar commands and plugin manifests can place widgets in the tray.
  • Superwhisper's tray icon disappears when its bar widget is present.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Placement[Drag or command] --> Layout[Saved widget section]
  Layout --> Bar[Bar widget slots]
  Bar --> Host[Tray drawer host]
  Host --> Widgets[Widgets after app icons]
  Widgets --> Panel[Open widget panel]
  Panel --> Hold[Keep drawer open]
Loading

Reviews (3) · Last reviewed commit: "Refuse enabling the tray into its own dr..." · Reviewed by Greptile

Comment thread shell/plugins/bar/Bar.qml Resolved
Comment thread shell/plugins/bar/widgets/Tray.qml Resolved
Comment thread shell/plugins/bar/Bar.qml Resolved
dhh and others added 3 commits October 13, 2026 21:34
A cloned tray hosts the section too, through two flags on the plugin bar
API. The empty drop slot shows when nothing in the section takes up space,
not only when it is empty, and the open-menu mark follows an icon still
sliding in with the drawer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The registry treats a clone of the tray like the tray when refusing to put
it in its own drawer. The drop slot is reached through the drawer area
rather than handed over separately, and the drawer's list relies on the
module list skipping an empty section.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment on lines +554 to 555
var target = barTarget(config, placement || {}, section, key)
config.bar.layout[target.section].splice(target.index, 0, entry)

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 Tray enable loses its explanation

Enabling a tray clone with barWidget.defaultSection: "tray" and no placement skips the early check because placement is empty. When the original tray is absent, barTarget returns an error, but setEnabled calls .splice on config.bar.layout[undefined]. The command throws instead of explaining that the tray cannot go inside its own drawer. Check target.error before inserting, including when placement comes from the manifest.

@dhh
dhh merged commit 1a161eb into quattro Oct 13, 2026
1 check passed
@dhh
dhh deleted the bar-tray-section branch October 13, 2026 13:01
omarchybot added a commit to AnPod/omarchy that referenced this pull request 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 added a commit to sprajs/omarchy that referenced this pull request Oct 13, 2026
Quattro's tray section (omacom#15281) added "tray" to the section list in updateEntryInline, which this branch had moved inside mutateShellConfig; the resolution keeps the branch's mutation wrapper and adds the tray section to it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jandrusk

Copy link
Copy Markdown

One edge case I noticed: the tray section only renders when there's a tray to host it (the Loader is active: !!host && root.layoutEntries("tray").length > 0). On a bar without omarchy.tray, or after the tray is removed, omarchy bar move <id> --section tray succeeds and the widget just disappears. Could the CLI refuse --section tray when the tray isn't placed, or could the bar fall back to drawing those entries in right when there's no host?

This also looks like it covers #7163 and the request in #6355.

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.

3 participants