Repository navigation
Collapse bar widgets listed before the tray into the tray drawer - #7163
Open
TMartinPPC wants to merge 2 commits into
Open
TMartinPPC wants to merge 2 commits into
TMartinPPC wants to merge 2 commits into
Conversation
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
Contributor
There was a problem hiding this comment.
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 intotray.settings.widgetsand keep “post-tray” entries beside the tray. - Extend
Tray.qmlto 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.
Contributor
There was a problem hiding this comment.
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 existingwidgetssetting 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 existingsource.widgets(when it’s an array) withinnerinstead 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...incan 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., iterateObject.keys(source)and optionally exclude__proto__,constructor,prototype) when buildingtrayCopy.
var source = isPlainObject(values[trayIndex]) ? values[trayIndex] : { id: "omarchy.tray" }
var trayCopy = {}
for (var k in source) trayCopy[k] = source[k]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bar widgets listed before
omarchy.trayin 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 (andomarchy 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 aswidgetsand removed from the section; post-tray entries remain.shell/plugins/bar/widgets/Tray.qml— renderssettings.widgetsin the reveal drawer through a newNestedBarWidgetloader that mirrors the bar host'sModuleSlotcontract (injectsbar/moduleName/settings). Drawer extent now accounts for widget width/height on both horizontal and vertical bars.test/shell.d/bar-test.sh— updates the twopinTrayToInnerassertions and adds coverage for the nesting behavior.Testing
bar-test.sh,tray-test.sh, andbar-widget-contract-test.shall pass.Limitation
Only registered bar widgets render inside the tray. Custom
command/qmlmodules (entries withtype/exec/source) aren't in the widget registry and are skipped if placed above the tray.