Skip to content

Collapse bar widgets listed before the tray into the tray drawer - #7163

Open
TMartinPPC wants to merge 2 commits into
omacom:quattrofrom
TMartinPPC:feature/tray-bar-widgets
Open

TMartinPPC wants to merge 2 commits into
omacom:quattrofrom
TMartinPPC:feature/tray-bar-widgets

Conversation

@TMartinPPC

Copy link
Copy Markdown

Summary

Bar widgets listed before omarchy.tray in a section now collapse into the tray's reveal drawer instead of rendering as their own bar slots. Widgets listed after it stay visible. Position is the only signal, so the existing drag-to-reorder gesture (and omarchy bar move) becomes the "move a widget in/out of the tray" control.

Why

The system tray only shows StatusNotifier icons from running apps. This lets users tuck less-used bar widgets (custom plugins, secondary status widgets) behind the tray chevron so they stay hidden until hovered, freeing bar space.

Changes

  • shell/plugins/bar/BarModel.js — pinTrayToInner() splits the section at the tray: pre-tray entries are attached to the tray entry as widgets and removed from the section; post-tray entries remain.
  • shell/plugins/bar/widgets/Tray.qml — renders settings.widgets in the reveal drawer through a new NestedBarWidget loader that mirrors the bar host's ModuleSlot contract (injects bar / moduleName / settings). Drawer extent now accounts for widget width/height on both horizontal and vertical bars.
  • test/shell.d/bar-test.sh — updates the two pinTrayToInner assertions and adds coverage for the nesting behavior.

Testing

  • bar-test.sh, tray-test.sh, and bar-widget-contract-test.sh all pass.
  • Live-tested on a running shell: three widgets listed before the tray load inside it with no QML errors.

Limitation

Only registered bar widgets render inside the tray. Custom command / qml modules (entries with type / exec / source) aren't in the widget registry and are skipped if placed above the tray.

Entries listed before omarchy.tray in a bar section now render inside the tray's reveal drawer instead of as their own bar slots; entries listed after it stay visible. Position is the only signal, so the existing drag-to-reorder and `omarchy bar move` gestures determine what collapses.

- pinTrayToInner attaches pre-tray entries as settings.widgets on the tray entry and removes them from the section
- Tray.qml renders those widgets in the drawer via a NestedBarWidget loader that mirrors the bar host's ModuleSlot bar/moduleName/settings contract
- bar-test.sh covers the nesting behavior
Copilot AI balanced review requested due to automatic review settings August 16, 2026 17:38

Copilot AI left a comment

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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the bar’s tray behavior so widgets appearing before the tray in a section are collapsed into the tray’s reveal drawer, and extends UI + tests to support rendering those nested widgets.

Changes:

  • Update pinTrayToInner() to move “pre-tray” entries into tray.settings.widgets and keep “post-tray” entries beside the tray.
  • Extend Tray.qml to render collapsed widgets inside the tray drawer and adjust sizing/visibility accordingly.
  • Expand shell tests to validate nesting behavior, ordering, and preservation of existing tray settings.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
test/shell.d/bar-test.sh Updates expectations and adds coverage for nesting entries into tray settings.
shell/plugins/bar/widgets/Tray.qml Renders settings.widgets inside tray drawer and updates drawer sizing/visibility logic.
shell/plugins/bar/BarModel.js Changes normalization logic to collapse pre-tray entries into the tray entry.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread shell/plugins/bar/widgets/Tray.qml Resolved
Comment thread shell/plugins/bar/BarModel.js Resolved
Comment thread shell/plugins/bar/BarModel.js Resolved
Comment thread shell/plugins/bar/BarModel.js Resolved
Copilot AI review requested due to automatic review settings August 16, 2026 17:51

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Suppressed comments (2)

shell/plugins/bar/BarModel.js:47

  • trayCopy.widgets = inner.slice() overwrites any existing widgets setting that might already be present on a configured tray entry. If users can define tray widgets explicitly (or if future code does), this change silently discards that configuration. Consider preserving/merging existing source.widgets (when it’s an array) with inner instead of overwriting it.
  var source = isPlainObject(values[trayIndex]) ? values[trayIndex] : { id: "omarchy.tray" }
  var trayCopy = {}
  for (var k in source) trayCopy[k] = source[k]
  trayCopy.widgets = inner.slice()

shell/plugins/bar/BarModel.js:46

  • Copying settings via for...in can pull in inherited enumerable properties and can propagate special keys like __proto__/constructor, which is a common vector for prototype-pollution style issues when user-controlled config is involved. Prefer copying only own enumerable keys (e.g., iterate Object.keys(source) and optionally exclude __proto__, constructor, prototype) when building trayCopy.
  var source = isPlainObject(values[trayIndex]) ? values[trayIndex] : { id: "omarchy.tray" }
  var trayCopy = {}
  for (var k in source) trayCopy[k] = source[k]

Comment thread shell/plugins/bar/widgets/Tray.qml Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants