Repository navigation
Bar widget group - #6961
Bar widget group#6961GeekyRiolu wants to merge 20 commits into
Conversation
Introduce a `type: "group"` bar-layout entry that wraps child widgets behind a chevron and reveals them on hover, mirroring the system tray drawer. Groups nest ordinary layout entries, so existing flat layouts keep working with no migration. - BarCollapsible (qs.Ui): shared hover-to-reveal container using the tray drawer's 600ms OutCubic motion, so the two do not drift. - BarGroup: the group renderer, kept in its own file rather than an inline component so the group -> slot -> group recursion does not make the bar's inline components form a QML cycle. It receives the child ModuleList as a runtime Component to keep that cycle broken. - Util.normalizeLayout preserves group entries and normalizes their items recursively (an id-less group would otherwise be dropped). - BarModel: isGroupEntry/groupItems (tolerant of cross-realm arrays). A change inside a group rebuilds the section; groups and their children are excluded from bar drag as both source and target. - Bar.qml ModuleSlot renders a group via BarCollapsible + a nested ModuleList. - Document the shape in the bar README and shell docs; cover it with a BarModel unit test and a graphical acceptance test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The tray drawer and the widget group were both animating a collapse/expand with their own copies of the same 600ms OutCubic slide. Fold the tray onto the shared BarCollapsible so the two cannot drift. - BarCollapsible gains a reserveSpace mode (the tray keeps its full extent while collapsed, chevron migrating and content sliding beneath it, with the empty area masked from the pointer) alongside the group's space-saving mode, plus a chevronPressed signal and a pinOnClick toggle. - Tray.qml renders its drawer through BarCollapsible in both orientations, keeping its pinned items, manage popup, and submenus; the tray's own expanded/revealProgress/revealExtent/drawerExtent state and reveal Behavior are removed as the container now owns them. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A group placed next to the system tray showed the same chevron as the tray drawer, so the two read as one control. Default the group to an ellipsis glyph instead; an entry can still override it with the "icon" setting. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds collapsible “widget groups” to the bar layout and factors the tray drawer + group drawer animation into a shared BarCollapsible component, with accompanying docs and tests to guard against regressions.
Changes:
- Introduces
type: "group"layout entries rendered via a newBarGroup.qmland detected inBarModel.js. - Refactors the tray drawer to use the shared
qs.Ui.BarCollapsiblecomponent (matching motion/interaction with groups). - Adds shell + acceptance tests and documents the new layout feature.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/shell.d/bar-group-test.sh | Adds unit-style assertions covering group detection, layout normalization, and the “cycle fix” approach. |
| test/acceptance.d/bar-group-test.sh | Adds acceptance coverage ensuring grouped widgets render in collapsed/expanded states. |
| shell/plugins/bar/widgets/Tray.qml | Refactors tray drawer UI/animation to use BarCollapsible. |
| shell/plugins/bar/README.md | Documents type: "group" layout entries and their settings/behavior. |
| shell/plugins/bar/BarModel.js | Adds group helpers (isGroupEntry, groupItems) exported for use by QML. |
| shell/plugins/bar/BarGroup.qml | New file-type component that renders grouped widgets using BarCollapsible. |
| shell/plugins/bar/Bar.qml | Adds group loading/routing, and disables dragging/drop targets for groups and their children. |
| shell/Ui/qmldir | Registers BarCollapsible in the qs.Ui module. |
| shell/Ui/BarCollapsible.qml | Adds shared collapsible container with reserve-space mode used by tray + groups. |
| shell/Commons/Util.qml | Preserves and recursively normalizes type: "group" entries during layout normalization. |
| docs/omarchy-shell.md | Documents the new group entry in bar layout rules and links to bar README. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
shell/Ui/BarCollapsible.qml:125
revealClipis declared afterchevron, so it will be stacked above the chevron by default. InreserveSpacemode the content region can overlap the chevron’s area during the slide, which risks the revealed content painting over (and potentially intercepting interactions intended for) the chevron. Make the stacking explicit (e.g., raisechevron’sz, or lowerrevealClip’sz) so the chevron always remains on top.
BarIconButton {
id: chevron
bar: root.bar
x: root.vertical ? 0 : root.chevronOffset
y: root.vertical ? root.chevronOffset : 0
width: implicitWidth
height: implicitHeight
text: root.icon
textRotation: root.vertical ? 90 : 0
onPressed: function(button) {
root.chevronPressed(button)
if (root.pinOnClick && button === Qt.LeftButton) root.pinnedOpen = !root.pinnedOpen
}
}
// The revealed slice. Clipped so the content is wiped/slid in from the chevron
// as the slice grows, and so a partially-open drawer never paints past its edge.
Item {
id: revealClip
x: root.vertical ? 0 : chevron.implicitWidth
y: root.vertical ? chevron.implicitHeight : 0
width: root.vertical ? root.barSize : Math.round(root.clipExtent)
height: root.vertical ? Math.round(root.clipExtent) : root.barSize
clip: true
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.
Suppressed comments (4)
shell/plugins/bar/widgets/Tray.qml:250
- The drawer content
Rowis no longer vertically centered within the tray bar height (previously it usedanchors.verticalCenter). IfTrayItemdoesn't naturally size toroot.barSize, this will render the drawer icons top-aligned. Consider restoring vertical centering (e.g., center theRowinside theBarCollapsiblecontent loader area) so the drawer icons are consistently aligned with pinned items.
BarCollapsible {
id: horizontalDrawer
bar: root.bar
reserveSpace: true
pinOnClick: false
animationDuration: root.animationDuration
visible: root.allItems.length > 0
onChevronPressed: function(button) {
if (button === Qt.RightButton) root.managePopupOpen = !root.managePopupOpen
}
contentComponent: Component {
Row {
spacing: root.trayItemGap
layer.enabled: true
Repeater {
model: root.drawerItems
TrayItem {}
}
}
}
shell/plugins/bar/widgets/Tray.qml:298
- Similar to the horizontal case, the drawer content
Columnis no longer horizontally centered (previously it usedanchors.horizontalCenter). IfTrayItemis narrower thanroot.barSize, the drawer icons can appear left-aligned inside the drawer area. Consider restoring horizontal centering for theColumnwithin the collapsible content area.
BarCollapsible {
id: verticalDrawer
bar: root.bar
reserveSpace: true
pinOnClick: false
animationDuration: root.animationDuration
visible: root.allItems.length > 0
onChevronPressed: function(button) {
if (button === Qt.RightButton) root.managePopupOpen = !root.managePopupOpen
}
contentComponent: Component {
Column {
spacing: root.trayItemGap
layer.enabled: true
Repeater {
model: root.drawerItems
TrayItem {}
}
}
}
}
test/shell.d/bar-group-test.sh:84
- These assertions are quite formatting-sensitive (e.g., they assume
duration:andeasing.type:appear on the same line with a;). Minor QML reformatting could break the test without changing behavior. Consider making the regex whitespace/newline-tolerant (e.g., allow arbitrary\\s*/[\s\S]*?between tokens) so the test validates semantics rather than exact formatting.
assert(
/duration: root\.animationDuration; easing\.type: Easing\.OutCubic/.test(collapsibleSource),
'the collapsible animates its reveal with an OutCubic curve'
)
assert(/animationDuration: 600/.test(collapsibleSource), 'the collapsible matches the tray drawer duration')
test/acceptance.d/bar-group-test.sh:95
- The fixed
sleep 3delays will slow down the acceptance suite and can still be flaky if rendering takes longer on slower systems. SinceBarCollapsiblehas a known animation duration (600ms), consider reducing these sleeps to a tighter bound (e.g., just above the animation duration) or replacing them with await_untilcondition that indicates the UI has settled (so screenshots are taken after the drawer animation completes).
wait_until "shell restarts on the synced checkout with a collapsed group" 40 layer_on_screen "omarchy-bar"
sleep 3
screenshot "success-bar-group-collapsed"
pass "bar renders a collapsed widget group without dropping it"
# Expanded (collapsed:false starts the drawer open) so a screenshot captures the
# revealed widgets — the state a hover produces. Adding/removing a group is a
# structural change, so a config reload rebuilds the section.
write_group_config false
omarchy-shell shell reloadConfig >/dev/null 2>&1 || omarchy-restart-shell >/dev/null 2>&1 || true
sleep 3
wait_until "bar renders with an expanded group" 20 layer_on_screen "omarchy-bar"
The drawer content was top/left-aligned within the bar. Center it on the cross axis so content shorter than the bar (e.g. tray icons when a theme sets icon-slot below the bar size) sits centered with the pinned items, restoring the tray drawer's original centering. No-op for widget groups, whose children are already bar-height. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The regex required exact spacing between duration and easing; make it whitespace/newline-tolerant so a QML reformat cannot break the test without a behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.
Suppressed comments (2)
shell/Ui/BarCollapsible.qml:52
pinnedOpenis described as being seeded fromcollapsedByDefault, but it’s currently a live binding (pinnedOpen: !collapsedByDefault). This means changingcollapsedByDefaultlater (e.g., via config reload / property update) will flippinnedOpenunless the user has already interacted (which breaks the binding), producing inconsistent “seed vs. follow” behavior. Consider makingpinnedOpenan independent boolean and initializing it once (e.g., inComponent.onCompleted, or via an explicit initializer flag) socollapsedByDefaulttruly only seeds initial state.
// A hover reveals transiently; a chevron click pins the drawer open so it
// survives the pointer leaving. collapsedByDefault seeds the pinned state.
property bool pinnedOpen: !collapsedByDefault
property bool hovered: false
readonly property bool open: pinnedOpen || (expandOnHover && hovered)
shell/Commons/Util.qml:129
- Group detection here uses a strict
entry.type === "group"check, whileBarModel.isGroupEntry()explicitly normalizes viaString(entry.type || "") === "group". Aligning these checks avoids subtle mismatches (e.g., non-stringtypevalues coming from QML/JS coercions) where BarModel might treat an entry as a group but normalization would drop/ignore it. A concrete fix is to normalizeentry.typeto a string in this branch as well (and ideally share the predicate to keep behavior consistent).
if (isPlainObject(entry) && entry.type === "group") {
var group = cloneJson(entry)
if (group.id) group.id = canonicalWidgetId(group.id)
group.items = normalizeLayoutSection(group.items)
return group
}
pinnedOpen was a live binding on collapsedByDefault, so a later change to collapsedByDefault could retroactively flip it (unless a chevron click had already broken the binding) — inconsistent seed-vs-follow behavior. Freeze it after completion so collapsedByDefault only seeds the initial state. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Util.normalizeLayoutEntry matched entry.type === "group" strictly while BarModel.isGroupEntry coerces via String(entry.type || ""). Use the same coercion in normalization so the two never disagree on what is a group. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Suppressed comments (1)
shell/Commons/Util.qml:129
normalizeLayoutSection(group.items)will receiveundefined/nullwhen a group omitsitems(or sets it tonull), which can crash ifnormalizeLayoutSectionassumes an array. Consider defaulting to an empty array (e.g., normalizegroup.items || []) so id-less groups without items don’t break config loading.
if (isPlainObject(entry) && String(entry.type || "") === "group") {
var group = cloneJson(entry)
if (group.id) group.id = canonicalWidgetId(group.id)
group.items = normalizeLayoutSection(group.items)
return group
}
| BarCollapsible { | ||
| id: horizontalDrawer | ||
| bar: root.bar | ||
| reserveSpace: true | ||
| pinOnClick: false | ||
| animationDuration: root.animationDuration | ||
| visible: root.allItems.length > 0 | ||
|
|
||
| HoverHandler { | ||
| onHoveredChanged: root.expanded = hovered | ||
| onChevronPressed: function(button) { | ||
| if (button === Qt.RightButton) root.managePopupOpen = !root.managePopupOpen | ||
| } | ||
|
|
||
| BarIconButton { | ||
| id: expandIcon | ||
| bar: root.bar | ||
| width: implicitWidth | ||
| height: implicitHeight | ||
| x: root.drawerExtent - root.revealExtent | ||
| text: "\uf053" | ||
| onPressed: function(button) { | ||
| if (button === Qt.RightButton) root.managePopupOpen = !root.managePopupOpen | ||
| } | ||
| } | ||
|
|
||
| Item { | ||
| id: trayClip | ||
| x: expandIcon.width | ||
| anchors.verticalCenter: parent.verticalCenter | ||
| width: root.drawerExtent | ||
| height: root.barSize | ||
| clip: true | ||
|
|
||
| contentComponent: Component { | ||
| Row { | ||
| id: trayIcons | ||
| x: root.drawerExtent - root.revealExtent | ||
| anchors.verticalCenter: parent.verticalCenter | ||
| spacing: root.trayItemGap | ||
| layer.enabled: true |
| BarCollapsible { | ||
| id: verticalDrawer | ||
| bar: root.bar | ||
| reserveSpace: true | ||
| pinOnClick: false | ||
| animationDuration: root.animationDuration | ||
| visible: root.allItems.length > 0 | ||
|
|
||
| HoverHandler { | ||
| onHoveredChanged: root.expanded = hovered | ||
| } | ||
|
|
||
| BarIconButton { | ||
| id: expandIcon | ||
| bar: root.bar | ||
| width: implicitWidth | ||
| height: implicitHeight | ||
| y: root.drawerExtent - root.revealExtent | ||
| text: "\uf053" | ||
| textRotation: 90 | ||
| onPressed: function(button) { | ||
| if (button === Qt.RightButton) root.managePopupOpen = !root.managePopupOpen | ||
| } | ||
| onChevronPressed: function(button) { | ||
| if (button === Qt.RightButton) root.managePopupOpen = !root.managePopupOpen | ||
| } | ||
|
|
||
| Item { | ||
| id: trayClip | ||
| y: expandIcon.height | ||
| anchors.horizontalCenter: parent.horizontalCenter | ||
| width: root.barSize | ||
| height: root.drawerExtent | ||
| clip: true | ||
|
|
||
| contentComponent: Component { | ||
| Column { | ||
| id: trayIcons | ||
| y: root.drawerExtent - root.revealExtent | ||
| anchors.horizontalCenter: parent.horizontalCenter | ||
| spacing: root.trayItemGap | ||
| layer.enabled: true |
The BarCollapsible drawers relied on an Item's implicit-size default for their width/height. That works, but the original tray sized its drawer area explicitly; restore that so the hover/click bounds are unambiguous. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.
Suppressed comments (5)
test/acceptance.d/bar-group-test.sh:21
- This restores OMARCHY_PATH by always setting it to a value, even if it was originally unset. If OMARCHY_PATH isn’t set in the user manager env, defaulting to
/usr/share/omarchycan restore the session to a different path than the system’s actual default and permanently change the user environment. Consider tracking whether OMARCHY_PATH existed (e.g.,had_omarchy_path=1/0) and inrestore()usesystemctl --user unset-environment OMARCHY_PATHwhen it was previously unset; only callset-environmentwhen it previously existed.
original_path=$(systemctl --user show-environment 2>/dev/null | sed -n 's/^OMARCHY_PATH=//p' | tail -1)
: "${original_path:=/usr/share/omarchy}"
test/acceptance.d/bar-group-test.sh:43
- This restores OMARCHY_PATH by always setting it to a value, even if it was originally unset. If OMARCHY_PATH isn’t set in the user manager env, defaulting to
/usr/share/omarchycan restore the session to a different path than the system’s actual default and permanently change the user environment. Consider tracking whether OMARCHY_PATH existed (e.g.,had_omarchy_path=1/0) and inrestore()usesystemctl --user unset-environment OMARCHY_PATHwhen it was previously unset; only callset-environmentwhen it previously existed.
restore() {
if (( had_config )); then
cp "$backup" "$config"
else
rm -f "$config"
fi
rm -f "$backup"
systemctl --user set-environment OMARCHY_PATH="$original_path" >/dev/null 2>&1 || true
omarchy-restart-shell >/dev/null 2>&1 || true
}
shell/plugins/bar/BarModel.js:151
- When
itemsis a local Array, this returns the originalentry.itemsreference. That makes it easy for downstream QML/JS (e.g., ModuleList consumers) to accidentally mutate the config-derived layout in place. Returning a shallow copy consistently (e.g., for both the Array and array-like branches) would reduce accidental side effects and make the function’s behavior more uniform for callers.
function groupItems(entry) {
if (!isGroupEntry(entry)) return []
var items = entry.items
// Array.isArray() returns false for an array created in another QML JS realm
// (the entry is built in Bar.qml but read from BarGroup.qml), so accept
// array-like objects too rather than dropping the children. Convert any
// accepted array-like object into a real local Array so QML/JS consumers can
// safely use Array semantics.
if (Array.isArray(items)) return items
if (items && typeof items === "object" && typeof items.length === "number") {
var result = []
for (var i = 0; i < items.length; ++i) result.push(items[i])
return result
}
return []
}
shell/Commons/Util.qml:129
- Group detection (
String(entry.type || \"\") === \"group\") is duplicated here and again inshell/plugins/bar/BarModel.js(isGroupEntry). If these drift (e.g., supporting aliases, future schema changes), normalization and rendering can disagree. A more robust approach is to centralize this predicate in a shared module (e.g.,Commons) or at least define a single exported constant/utility used by both places.
// A group wraps child entries behind a collapsible chevron. It has no widget
// id of its own (one is optional, for addressing), so it must be recognized
// before the id branch below, which would otherwise drop it. Its children
// are normalized recursively so the same rules apply at every depth.
if (isPlainObject(entry) && String(entry.type || "") === "group") {
var group = cloneJson(entry)
if (group.id) group.id = canonicalWidgetId(group.id)
group.items = normalizeLayoutSection(group.items)
return group
}
shell/plugins/bar/README.md:112
- The phrasing is a bit unclear/grammatically incomplete. Consider rewording to something like: “With it set to
false, click the chevron to toggle.” to make the behavior explicit.
- `expandOnHover` — reveal on hover (default `true`). With it `false`, click the
chevron to toggle.
The Array branch returned entry.items directly while the array-like branch built a copy — inconsistent, and returning the original let callers mutate the config-derived layout in place. Return a shallow copy in both branches. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… test The restore always set OMARCHY_PATH, so a session where it was unset would be left with it set to a default. Track whether it existed and unset it on restore when it did not, only setting it back when it was there originally. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.
Suppressed comments (2)
shell/Commons/Util.qml:129
group.itemsis normalized unconditionally. If a config provides{ "type": "group" }(oritemsis missing / not an array), this can throw insidenormalizeLayoutSection(...)depending on its implementation. Since the rest of this PR treats “no items” as empty (e.g.,BarModel.groupItems()), consider coercinggroup.itemsto an empty array (or validating it) before normalizing so group entries remain safe to omit/leave empty.
if (isPlainObject(entry) && String(entry.type || "") === "group") {
var group = cloneJson(entry)
if (group.id) group.id = canonicalWidgetId(group.id)
group.items = normalizeLayoutSection(group.items)
return group
}
shell/Ui/BarCollapsible.qml:54
pinnedOpenis both declared with a binding and then assigned on completion to “freeze” it. This works, but it’s slightly redundant/unclear because the assignment breaks the binding anyway. Consider initializingpinnedOpenwithout a binding and only seeding it once inComponent.onCompleted, which makes the “seed then decouple” intent more explicit and avoids a short-lived binding.
property bool pinnedOpen: !collapsedByDefault
Component.onCompleted: pinnedOpen = !collapsedByDefault
property bool hovered: false
The earlier freeze (Component.onCompleted: pinnedOpen = !collapsedByDefault) ran before BarGroup assigns the group's entry, so collapsedByDefault was still its default (true) at freeze time and pinnedOpen got locked collapsed — a group configured collapsed:false stayed collapsed. Drop the freeze: the live binding tracks collapsedByDefault (which BarGroup sets right after load), and a chevron click still breaks the binding to hand control to the user. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.
Suppressed comments (6)
shell/plugins/bar/widgets/Tray.qml:254
BarCollapsiblevisibility is currently keyed offroot.allItems.length, while the collapsible content is driven byroot.drawerItems. IfallItemscan be non-empty whiledrawerItemsis empty (e.g., pinned-only scenarios), this can render a chevron/reserved space with no drawer content and shift pinned items unexpectedly. Prefer drivingvisible(and thereforedrawerBlockWidth/drawerBlockHeight) from the same source as the content (e.g.,root.drawerItems.length > 0).
visible: root.allItems.length > 0
onChevronPressed: function(button) {
if (button === Qt.RightButton) root.managePopupOpen = !root.managePopupOpen
}
contentComponent: Component {
Row {
spacing: root.trayItemGap
layer.enabled: true
Repeater {
model: root.drawerItems
TrayItem {}
}
}
}
shell/plugins/bar/widgets/Tray.qml:305
BarCollapsiblevisibility is currently keyed offroot.allItems.length, while the collapsible content is driven byroot.drawerItems. IfallItemscan be non-empty whiledrawerItemsis empty (e.g., pinned-only scenarios), this can render a chevron/reserved space with no drawer content and shift pinned items unexpectedly. Prefer drivingvisible(and thereforedrawerBlockWidth/drawerBlockHeight) from the same source as the content (e.g.,root.drawerItems.length > 0).
visible: root.allItems.length > 0
onChevronPressed: function(button) {
if (button === Qt.RightButton) root.managePopupOpen = !root.managePopupOpen
}
contentComponent: Component {
Column {
spacing: root.trayItemGap
layer.enabled: true
Repeater {
model: root.drawerItems
TrayItem {}
}
}
}
test/acceptance.d/bar-group-test.sh:25
- This treats
OMARCHY_PATHas “unset” when it is set to an empty value (OMARCHY_PATH=), sorestore()will unset it instead of restoring the empty value. If you want to restore the environment exactly, track presence separately from value (e.g., detect^OMARCHY_PATH=vs. relying on a non-empty value), and store the (possibly empty) value for restoration.
original_path=$(systemctl --user show-environment 2>/dev/null | sed -n 's/^OMARCHY_PATH=//p' | tail -1)
had_omarchy_path=0
[[ -n $original_path ]] && had_omarchy_path=1
test/shell.d/bar-group-test.sh:52
- Several assertions validate behavior by regex-matching implementation details in QML/JS source text. This makes the test suite fragile to harmless refactors (renames, formatting, small control-flow rewrites) while not necessarily increasing behavioral confidence. Where possible, prefer asserting observable behavior (e.g., via exported JS helpers like
BarModel.*, or by running the relevant QML through a runtime check) and keep source-text regex checks narrowly scoped to the specific regression that cannot be validated otherwise.
assert(/entry\.type[\s\S]*?=== "group"/.test(utilSource), 'layout normalization preserves group entries')
assert(
/group\.items = normalizeLayoutSection\(group\.items\)/.test(utilSource),
test/shell.d/bar-group-test.sh:57
- Several assertions validate behavior by regex-matching implementation details in QML/JS source text. This makes the test suite fragile to harmless refactors (renames, formatting, small control-flow rewrites) while not necessarily increasing behavioral confidence. Where possible, prefer asserting observable behavior (e.g., via exported JS helpers like
BarModel.*, or by running the relevant QML through a runtime check) and keep source-text regex checks narrowly scoped to the specific regression that cannot be validated otherwise.
assert(/readonly property bool isGroup: customType === "group"/.test(barSource), 'bar marks a group slot')
assert(/if \(isGroup\) return groupLoader\.item/.test(barSource), 'bar routes a group slot to the group loader')
test/shell.d/bar-group-test.sh:63
- Several assertions validate behavior by regex-matching implementation details in QML/JS source text. This makes the test suite fragile to harmless refactors (renames, formatting, small control-flow rewrites) while not necessarily increasing behavioral confidence. Where possible, prefer asserting observable behavior (e.g., via exported JS helpers like
BarModel.*, or by running the relevant QML through a runtime check) and keep source-text regex checks narrowly scoped to the specific regression that cannot be validated otherwise.
assert(/source: slot\.isGroup \? Qt\.resolvedUrl\("BarGroup\.qml"\)/.test(barSource), 'bar loads a group from the BarGroup file, not an inline component')
Restore should reproduce the session env exactly. Keying "had it" off a non-empty value treated OMARCHY_PATH= (set but empty) as absent and would unset it on restore. Detect the variable by its line and store the (possibly empty) value to restore. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Note that the regex assertions guard QML structure the node harness can't execute at runtime (behavior is covered by the BarModel helper assertions), so they read as intentional rather than fragile. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Addressed:
Left intentionally, with reasons:
|
|
Hi @meirdick this implements the request in #6355: a It's ready for review: backward-compatible (existing flat layouts are unchanged, no |
Bring the branch up to date with quattro (the base had moved ~399 commits). Only Bar.qml conflicted: kept both the group's `isGroup` property and upstream's new ModuleSlot plugin-API properties (registryMetadata/firstParty/pluginApiId); everything else auto-merged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Verification: Omacloud Test Harness
TAP: 34 passed · 0 failed · 0 skipped
🔍 Test Integrity & Diagnostic Findings
Captured Artifacts
Verified automatically with Omacloud Test Harness |
The test built its group from system-update, bluetooth and network. Each of those hides itself when its backing state is missing, and a clean CI image has none of it — no pending update, no adapter, no connection — so the group measured 0px wide in both states and the collapsed and expanded captures came out byte-identical. The run passed while proving nothing. Build the group from custom `command` modules echoing fixed text instead. That output renders on any machine, and it is now the assertion: the text must be absent while the group is collapsed and present once it is open. Drop the tray and power widgets from the layout, which were invisible in CI for the same reason, and restart rather than reload between the two states so a stale render cannot stand in for the new one. Add screen_lacks to the acceptance harness as the negative counterpart to screen_contains, mirroring layer_absent and window_absent.
|
Thanks @codenamekt for catching this the finding is correct, and I could reproduce it. Fixed in b81e980. Why the delta was zero. The group's children were
The fix. The group's children are now custom
I also restart rather than reload between the two states, so a stale render can't stand in for the new one, and dropped the tray and power widgets from the layout since they were invisible in CI for the same reason. That takes the test from 4 assertions that couldn't fail to 5 that can. One small addition to Verification. Run on a real 4.x session, and I confirmed the sentinel text is legible to tesseract at the exact
To be explicit about one thing: the feature itself was never broken only the test was. The screenshots below are the two states the updated test now asserts on. Collapsed |
Sync this fork's feature branch with basecamp/omarchy quattro so the pull request applies cleanly; upstream had moved 619 commits ahead. Only Tray.qml conflicted. Upstream's no-animations mode (omacom#13550) had wrapped the tray's reveal animation in Style.duration(), while this branch had already moved that animation out of Tray.qml into the shared BarCollapsible. Resolved by dropping the tray's now-dead Behavior and routing BarCollapsible's duration through Style.duration() instead, so the tray drawer and widget groups both honor reduceMotion rather than silently opting out of it. Guarded by a new assertion in the group test.
Sync this fork's feature branch with basecamp/omarchy quattro so the pull request applies cleanly; upstream had moved 280 commits ahead. Withdraw the tray migration. Upstream has since built tray-specific drawer behavior on the tray's own reveal machinery — a tray section that bar widgets can be dragged into, hold-open while a menu or panel is up, and open-on-drag — none of which the shared collapsible models. Rebasing that onto BarCollapsible would mean rewriting work upstream has not finished, and every further tray change would conflict here. Tray.qml is now taken from upstream untouched, and BarCollapsible serves the widget group alone. That leaves the collapsible's reserve-space mode, its chevron-press signal and its pin-on-click switch with no caller, so drop them. Each removed branch was the arm the group already took (reserveSpace was always false for a group), so the group's layout is unchanged by construction. Bar.qml's conflict was additive: keep both this branch's groupListComponent and upstream's new traySectionComponent.




Adds a
type: "group"bar-layout entry that tucks widgets behind a collapsible chevron and reveals them on hover the same drawer UX the system tray already provides. Addresses #6355.{ "type": "group", "collapsed": true, "items": [ { "id": "omarchy.agents" }, { "id": "omarchy.system-update" }, { "id": "omarchy.bluetooth" } ] }Design
bar.layout.<section>array whoseitems[]holds ordinary entries, so groups can go in any section and you can have more than one. Existing flat layouts are untouched no migration.shell/Ui/BarCollapsible.qml, and the tray drawer is migrated onto it, so the group and the tray share a single implementation of the 600ms OutCubicreveal instead of drifting.
BarCollapsiblehas a space-saving mode (groups collapse to just the chevron) and a reserve-space mode (the tray keeps its width, chevron migrating).BarGroup.qml) and receives its child list as a runtimeComponent, so the group → slot → group recursion doesn't make the bar's inline components form a QML cycle."icon".Screenshots
Tray drawer (

‹) and a group (⋯) side by side, visually distinct:3-tray-and-group-distinct-chevrons.png
Testing
test/shell.d/bar-group-test.shBarModel/normalization + guards that the tray sharesBarCollapsible(can't silently re-fork).test/acceptance.d/bar-group-test.shgraphical: collapsed + expanded states.qmllintclean; verified live on Omarchy 4.0.tray/tray-menutests still pass.