Skip to content

Bar widget group - #6961

Open
GeekyRiolu wants to merge 20 commits into
omacom:quattrofrom
GeekyRiolu:bar-widget-group
Open

GeekyRiolu wants to merge 20 commits into
omacom:quattrofrom
GeekyRiolu:bar-widget-group

Conversation

@GeekyRiolu

@GeekyRiolu GeekyRiolu commented Aug 15, 2026 •

Copy link
Copy Markdown

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

  • Nesting primitive. A group is just another entry in the flat bar.layout.<section> array whose items[] holds ordinary entries, so groups can go in any section and you can have more than one. Existing flat layouts are untouched no migration.
  • One shared drawer, not a fork. The collapse/expand is extracted into 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 OutCubic
    reveal instead of drifting. BarCollapsible has a space-saving mode (groups collapse to just the chevron) and a reserve-space mode (the tray keeps its width, chevron migrating).
  • Recursion done right. The group renderer lives in its own file (BarGroup.qml) and receives its child list as a runtime Component, so the group → slot → group recursion doesn't make the bar's inline components form a QML cycle.
  • Distinct chevron. A group defaults to an ellipsis glyph so a group next to the tray doesn't read as a second tray drawer; override with "icon".

Screenshots

Collapsed Expanded
1-group-collapsed 2-group-expanded

Tray drawer (‹) and a group (⋯) side by side, visually distinct:
3-tray-and-group-distinct-chevrons.png
3-tray-and-group-distinct-chevrons

Testing

  • test/shell.d/bar-group-test.sh BarModel/normalization + guards that the tray shares BarCollapsible (can't silently re-fork).
  • test/acceptance.d/bar-group-test.sh graphical: collapsed + expanded states.
  • qmllint clean; verified live on Omarchy 4.0.
  • Existing tray / tray-menu tests still pass.

GeekyRiolu and others added 3 commits August 15, 2026 16:09
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>
Copilot AI balanced review requested due to automatic review settings August 15, 2026 11:45

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.

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 new BarGroup.qml and detected in BarModel.js.
  • Refactors the tray drawer to use the shared qs.Ui.BarCollapsible component (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.

Comment thread shell/plugins/bar/BarModel.js Resolved
Comment thread shell/Ui/BarCollapsible.qml Resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 15, 2026 11:54

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 11 out of 11 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

shell/Ui/BarCollapsible.qml:125

  • revealClip is declared after chevron, so it will be stacked above the chevron by default. In reserveSpace mode 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., raise chevron’s z, or lower revealClip’s z) 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

Comment thread shell/plugins/bar/BarModel.js Resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 15, 2026 12:00

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 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 Row is no longer vertically centered within the tray bar height (previously it used anchors.verticalCenter). If TrayItem doesn't naturally size to root.barSize, this will render the drawer icons top-aligned. Consider restoring vertical centering (e.g., center the Row inside the BarCollapsible content 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 Column is no longer horizontally centered (previously it used anchors.horizontalCenter). If TrayItem is narrower than root.barSize, the drawer icons can appear left-aligned inside the drawer area. Consider restoring horizontal centering for the Column within 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: and easing.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 3 delays will slow down the acceptance suite and can still be flaky if rendering takes longer on slower systems. Since BarCollapsible has a known animation duration (600ms), consider reducing these sleeps to a tighter bound (e.g., just above the animation duration) or replacing them with a wait_until condition 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"

GeekyRiolu and others added 2 commits August 15, 2026 17:43
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>
Copilot AI review requested due to automatic review settings August 15, 2026 12:13

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 11 out of 11 changed files in this pull request and generated no new comments.

Suppressed comments (2)

shell/Ui/BarCollapsible.qml:52

  • pinnedOpen is described as being seeded from collapsedByDefault, but it’s currently a live binding (pinnedOpen: !collapsedByDefault). This means changing collapsedByDefault later (e.g., via config reload / property update) will flip pinnedOpen unless the user has already interacted (which breaks the binding), producing inconsistent “seed vs. follow” behavior. Consider making pinnedOpen an independent boolean and initializing it once (e.g., in Component.onCompleted, or via an explicit initializer flag) so collapsedByDefault truly 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, while BarModel.isGroupEntry() explicitly normalizes via String(entry.type || "") === "group". Aligning these checks avoids subtle mismatches (e.g., non-string type values 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 normalize entry.type to 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
    }

GeekyRiolu and others added 2 commits August 15, 2026 17:52
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>
Copilot AI review requested due to automatic review settings August 15, 2026 12:22

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 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 receive undefined/null when a group omits items (or sets it to null), which can crash if normalizeLayoutSection assumes an array. Consider defaulting to an empty array (e.g., normalize group.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
    }

Comment thread shell/plugins/bar/widgets/Tray.qml Outdated
Comment on lines 231 to 244
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
Comment thread shell/plugins/bar/widgets/Tray.qml Outdated
Comment on lines 278 to 291
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>
Copilot AI review requested due to automatic review settings August 15, 2026 12:28

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 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/omarchy can 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 in restore() use systemctl --user unset-environment OMARCHY_PATH when it was previously unset; only call set-environment when 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/omarchy can 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 in restore() use systemctl --user unset-environment OMARCHY_PATH when it was previously unset; only call set-environment when 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 items is a local Array, this returns the original entry.items reference. 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 in shell/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.

GeekyRiolu and others added 3 commits August 15, 2026 18:09
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>
Copilot AI review requested due to automatic review settings August 15, 2026 12:39

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 11 out of 11 changed files in this pull request and generated no new comments.

Suppressed comments (2)

shell/Commons/Util.qml:129

  • group.items is normalized unconditionally. If a config provides { "type": "group" } (or items is missing / not an array), this can throw inside normalizeLayoutSection(...) depending on its implementation. Since the rest of this PR treats “no items” as empty (e.g., BarModel.groupItems()), consider coercing group.items to 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

  • pinnedOpen is 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 initializing pinnedOpen without a binding and only seeding it once in Component.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>
Copilot AI review requested due to automatic review settings August 15, 2026 13:05

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

  • BarCollapsible visibility is currently keyed off root.allItems.length, while the collapsible content is driven by root.drawerItems. If allItems can be non-empty while drawerItems is empty (e.g., pinned-only scenarios), this can render a chevron/reserved space with no drawer content and shift pinned items unexpectedly. Prefer driving visible (and therefore drawerBlockWidth/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

  • BarCollapsible visibility is currently keyed off root.allItems.length, while the collapsible content is driven by root.drawerItems. If allItems can be non-empty while drawerItems is empty (e.g., pinned-only scenarios), this can render a chevron/reserved space with no drawer content and shift pinned items unexpectedly. Prefer driving visible (and therefore drawerBlockWidth/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_PATH as “unset” when it is set to an empty value (OMARCHY_PATH=), so restore() 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')

GeekyRiolu and others added 2 commits August 15, 2026 18:42
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>
Copilot AI review requested due to automatic review settings August 15, 2026 13:12

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 11 out of 11 changed files in this pull request and generated 1 comment.

Comment thread shell/plugins/bar/BarGroup.qml Resolved
@GeekyRiolu

Copy link
Copy Markdown
Author

Addressed:

  • groupItems returns a fresh Array in both branches (real Array semantics, no
    in-place mutation; handles cross-realm arrays)
  • Containment mask uses width/height consistently
  • Drawer content centered on the cross axis (restores the tray's centering; no-op for groups)
  • Group detection uses the same String(type) coercion as BarModel
  • Tray drawers sized explicitly
  • Acceptance test restores OMARCHY_PATH exactly (detects it by presence, incl. empty)
  • README wording; animation-test regex loosened for reformatting

Left intentionally, with reasons:

  • Tray drawer visible: allItems.length > 0 (not drawerItems): matches the existing
    tray and keeps the chevron and its right-click manage popup reachable when
    every item is pinned. An empty drawer reserves no width, so nothing shifts.
  • pinnedOpen is a live binding on collapsedByDefault (not frozen): BarGroup sets the
    group's entry and thus collapsedByDefault right after load, so seeding once in
    Component.onCompleted would lock in the pre-entry default and ignore a configured
    collapsed: false. A chevron click still breaks the binding for user control.
  • normalizeLayoutSection(group.items) already returns [] for undefined/null/non-array.
  • The group-type predicate is duplicated (Util + BarModel) but aligned; centralizing
    across the Commons QML singleton and plugin JS isn't worth the coupling.
  • Source-regex assertions guard QML structure the harness can't execute at runtime;
    behavior is covered by the BarModel.* unit assertions.
  • Acceptance settle uses a fixed sleep: no clean "settled" signal, and tightening it
    would be more flaky on slow systems.

Before Stock Bar
0-before-stock-bar

Collapsed
1-collapsed

Expanded
2-expanded

@CtByte

CtByte commented Aug 20, 2026

Copy link
Copy Markdown

I built the same thing as a local plugin before I found this, so it is good to see it going upstream — the collapsible-chevron shape is right, and having it as a layout entry rather than a widget is better than what I did.

A settings panel is the piece users reach for next. Editing items in shell.json is fine once, but "what is in the drawer" is exactly the sort of thing you want to change by clicking, and a panel listing the grouped entries with a way to add and remove them covers it. Screenshot of mine below — a work in progress and a concept rather than something finished.

image

(I've edited out some irrelevant details 🙂 )

It fits particularly well with groups opting out of dragging: if a widget cannot be dragged into or out of a group, there is otherwise no way to change the contents without hand-editing the config, so the panel becomes the interaction rather than a convenience on top of one.

If you do go that way, mutateShellConfig looks like the right tool rather than updateEntryInline — it is what the bar's own drag already goes through, and it hands over the whole config instead of matching by id. updateEntryInline would be wrong twice over: it matches by widget id, and it replaces the entry it finds, so pointed at a group it would drop type and items. The awkward case is an id-less group, which the docs suggest is the common one — that would have to be located positionally rather than by id, which is presumably what "optional, for addressing" is getting at.

On the gesture, right-click on the chevron looks like the natural way into a panel: it is already what opens the tray's manage popup, this keeps that binding through chevronPressed, and left-click and hover are both taken by pinOnClick and expandOnHover.

@GeekyRiolu

Copy link
Copy Markdown
Author

Hi @meirdick this implements the request in #6355: a type: "group" bar-layout
entry that tucks widgets behind a chevron and reveals them on hover, the same way
the system tray drawer works. Would love your take on whether the UX matches what
you had in mind.

It's ready for review: backward-compatible (existing flat layouts are unchanged, no
migration), and the tray drawer now shares the same collapsible component so the two
can't drift. I've worked through the automated review notes and it's green with no
conflicts. Screenshots (before → collapsed → expanded) are in the description.

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>
@codenamekt

Copy link
Copy Markdown

Verification: Omacloud Test Harness

⚠️ Changes Requested — Core implementation functional, but PR acceptance test produces a vacuous pass in clean CI environments (conditionally invisible widgets yield 0px visual change).

PR #6961
Title Bar widget group
Author @GeekyRiolu
Head db2bb31e901a
Base quattro
Verification verifiable-graphical
Substrate qemu-ssh / docker-hyprland
Duration 42s

11 file(s) including shell/QML changes — screenshot and acceptance verification apply

TAP: 34 passed · 0 failed · 0 skipped

Test Status TAP
test/shell.d/bar-group-test.sh passed 30/30
test/acceptance.d/bar-group-test.sh passed 4/4

🔍 Test Integrity & Diagnostic Findings

  • ❌ vacuous_screenshot_delta: Author's test layout (system-update, bluetooth, network) produces 0 pixel delta between collapsed and expanded states in clean CI/headless environments because all three widgets evaluate to visible: false (0px width). Both captured screenshots (success-bar-group-collapsed.png and success-bar-group-expanded.png) are byte-for-byte identical.

Captured Artifacts

  • success-bar-group-collapsed.png:
success-bar-group-collapsed
  • success-bar-group-expanded.png:
success-bar-group-expanded

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

Copy link
Copy Markdown
Author

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 system-update, bluetooth and network, and every one of those hides itself when its backing state is missing. On a clean CI image none of that state exists, so the group measured 0px wide in both states. It's actually 5 of the 6 widgets in that layout, not 3:

widget guard clean CI
omarchy.system-update visible: updateAvailable no pending update → hidden
omarchy.bluetooth visible: adapter !== null no adapter → hidden
omarchy.network — no connection → no icon
omarchy.tray visible: pinnedItems.length > 0 || drawerCount > 0 no tray apps → hidden
omarchy.power visible: batteryPresent no battery → hidden
omarchy.audio — visible — the lone speaker in both captures

ModuleSlot sizes to activeItem.visible ? activeItem.implicitWidth : 0, so the group had nothing to hide or reveal. And the test only asserted that the bar layer existed, so nothing failed.

The fix. The group's children are now custom command modules echoing fixed text, which render on any machine regardless of hardware. That text is the assertion, using the harness's own OCR helper:

  • collapsed → screen_lacks GROUPALPHA

  • expanded → screen_contains GROUPALPHA, screen_contains GROUPBETA

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 test/acceptance.d/base-test.sh: screen_contains had no negative counterpart even though layer_absent and window_absent exist, so I added screen_lacks alongside them.

Verification. Run on a real 4.x session, and I confirmed the sentinel text is legible to tesseract at the exact grim -s 2 scale screen_contains uses, so the assertion holds at CI resolution:

  • collapsed → ⋯ 🔊 (chevron up, children hidden)

  • expanded → ⋯ GROUPALPHA GROUPBETA 🔊

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 3-collapsed-bar

Expanded
4-expanded-bar

Zoomed
6-right-section-zoom

@omarchybot omarchybot added the enhancement New feature or request label Sep 27, 2026
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.
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.

5 participants