Skip to content

Group bar widgets on shared ovals - #13570

Open
AbaddonTataken wants to merge 2 commits into
omacom:quattrofrom
AbaddonTataken:bar-groups
Open

AbaddonTataken wants to merge 2 commits into
omacom:quattrofrom
AbaddonTataken:bar-groups

Conversation

@AbaddonTataken

Copy link
Copy Markdown

What

Any bar layout entry can carry a "group" name. Consecutive visible entries in a section with the same name sit on one soft oval, which makes a busy bar easier to scan:

"right": [
  { "id": "omarchy.bluetooth", "group": "connect" },
  { "id": "omarchy.network", "group": "connect" },
  { "id": "omarchy.audio", "group": "av" },
  { "id": "omarchy.monitor", "group": "av" },
  { "id": "omarchy.power", "group": "power" }
]
  • Padding inside each oval, one gap between a group and its neighbours, and no doubled gap between two adjacent groups.
  • omarchy bar set <id> group <name> regroups live (no shell restart).
  • Widgets that hide themselves (media with nothing playing, the update icon) drop out of their group and the oval reshapes; they rejoin when they come back.
  • The anchored center (centerAnchor) works too: widgets before the anchor, the anchor, and widgets after it group as one sequence, so e.g. clock + keyboard layout share one oval across the anchor.
  • Themes colour the ovals with [bar] group-background / group-background-alpha in shell.toml (default: theme foreground at 8%).

Entries without group are laid out exactly as before; a bar with no groups is unchanged.

How

  • Layout math is pure and unit-tested in BarModel.js: groupInsets(groups, pad, gap) gives each visible slot its lead/trail inset; groupSpans(slots, pad) turns laid-out slots into oval spans.
  • ModuleSlot gets group, leadInset, trailInset and shown; its loaders and open-panel mark sit inside the insets, so widgets keep their own geometry.
  • ModuleList recomputes insets when its entries or a slot's visibility change and redraws ovals on positioningComplete. In the anchored center, the before/after lists hand this to the section (groupHost), which maps all three pieces into one coordinate space and draws the ovals itself.
  • applySettingsDelta updates a slot's group and regroups its section, so live bar set changes take effect without a reload.
  • New theme token wired through Color.bar.group and default/themed/shell.toml.tpl.

Docs

manual/05-the-top-bar.md (new "Grouping widgets" section), shell/plugins/bar/README.md, docs/omarchy-shell.md (layout key and theme token).

Tests

  • test/shell.d/bar-test.sh: groupInsets / groupSpans cases (padding, gaps, adjacent groups, ungrouped, missing input), and source checks that lists lay groups out through BarModel, ovals use the theme token, live group changes regroup, the anchored center groups across the anchor, and the template defines the token.
  • ./test/all: 4086 passing (11 new), no new failures. The 8 failures on my machine fail identically on unmodified quattro (environment: omasnap not installed, no omarchy-iso checkout, kernel headers, browser launcher, VS Code theme, cache cleanup, network portal fixture, a pre_remove hook).

Visual verification

Verified on a running session with the default layout plus groups (workspaces; clock + keyboard layout across the center anchor; bluetooth + network; audio + display; power), then omarchy bar set omarchy.power group av live: power joined the audio/display oval without a restart.

Screenshots (initial grouping, and after the live bar set) are attached below.

🤖 Generated with Claude Code

Layout entries may carry a `group` name; consecutive visible entries
sharing it sit on one oval, with padding inside and a gap to their
neighbours (BarModel.groupInsets/groupSpans). The anchored center groups
its before-list, anchor and after-list as one sequence, so a group can run
across the center anchor. `omarchy bar set <id> group <name>` regroups
live, widgets that hide drop out of their group, and themes colour the
ovals with `[bar] group-background` in shell.toml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@llstrk

llstrk commented Sep 29, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Outcome: Two live updates leave stale group layout; open PR #13139 reuses group.

Anchor keeps a stale group

applySettingsDelta overwrites the slot.group binding; the anchor slot survives rebuilds. After omarchy bar set omarchy.clock group X, a rebuild dropping the group (such as omarchy bar defaults after a reorder) keeps the clock in X.

Suggested change: restore the binding in onEntryChanged.

Reproducer (fails at 5c7cccb; a QML model built from Bar.qml lines)

Center anchor keeps a stale group after a live group change

Reproduces the anchor slot keeping the group set by applySettingsDelta after a later layout rebuild hands it an entry without a group. The anchor slot (centerAnchorModule) is not inside a Repeater, so it is the one slot object that survives rebuilds.

Reviewed head: 5c7cccb. Qt 6.11.2, offscreen platform.

Run from a scratch directory holding this file and a copy of shell/plugins/bar/BarModel.js from the PR head:

QT_QPA_PLATFORM=offscreen /usr/lib/qt6/bin/qmltestrunner -input tst_anchor_group_stale.qml

tst_anchor_group_stale.qml:

// Stale group on the center anchor after a live `omarchy bar set <anchor> group ...`.
// Lines tagged "Bar.qml:N" are copied from shell/plugins/bar/Bar.qml at 5c7cccbf.
// Run from a directory holding this file and shell/plugins/bar/BarModel.js:
//   QT_QPA_PLATFORM=offscreen /usr/lib/qt6/bin/qmltestrunner -input tst_anchor_group_stale.qml
import QtQuick
import QtTest
import "BarModel.js" as BarModel

Item {
  id: root

  function entrySettings(entry) { return BarModel.entrySettings(entry) }
  function entryId(entry) { return BarModel.entryId(entry) }

  // centerAnchorModule (Bar.qml:1633) is declared directly in the center section,
  // not inside a Repeater, so a layout rebuild re-evaluates its `entry` binding on
  // the same object instead of creating a new slot.
  Item {
    id: anchorSlot
    property var entry: ({ id: "omarchy.clock", format: "dddd HH:mm" })
    property string region: "center"
    readonly property string moduleName: root.entryId(entry)
    readonly property var moduleSettings: root.entrySettings(entry)                  // Bar.qml:2020
    property string group: moduleSettings.group ? String(moduleSettings.group) : ""  // Bar.qml:2024
  }

  // applySettingsDelta's new lines (Bar.qml:612-616), reached by
  // `omarchy bar set omarchy.clock group time` through the inline settings delta.
  function applySettingsDelta(entry) {
    var settings = entrySettings(entry)
    var slot = anchorSlot
    var group = settings.group ? String(settings.group) : ""
    if (slot.group !== group) {
      slot.group = group
    }
  }

  TestCase {
    name: "AnchorGroup"

    function test_anchor_group_follows_its_entry_after_a_rebuild() {
      // 1. omarchy bar set omarchy.clock group time
      applySettingsDelta({ id: "omarchy.clock", format: "dddd HH:mm", group: "time" })
      compare(anchorSlot.group, "time")

      // 2. A later change that rebuilds the layout (for example `omarchy bar defaults`
      //    after any reorder) hands the anchor slot a fresh entry without `group`.
      anchorSlot.entry = { id: "omarchy.clock", format: "dddd HH:mm" }
      compare(anchorSlot.moduleSettings.group, undefined, "the new entry has no group")
      compare(anchorSlot.group, "", "the anchor's group follows the new entry")
    }
  }
}

Actual output (exit 1):

********* Start testing of qmltestrunner *********
Config: Using QtTest library 6.11.2, Qt 6.11.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 16.2.1 20260810), omarchy 4.0.4
PASS   : qmltestrunner::AnchorGroup::initTestCase()
FAIL!  : qmltestrunner::AnchorGroup::test_anchor_group_follows_its_entry_after_a_rebuild() the anchor's group follows the new entry
   Actual   (): time
   Expected (): 
   Loc: [/tmp/r/tst_anchor_group_stale.qml(50)]
PASS   : qmltestrunner::AnchorGroup::cleanupTestCase()
Totals: 2 passed, 1 failed, 0 skipped, 0 blacklisted, 2ms
********* Finished testing of qmltestrunner *********

Padding ignores text size

Insets ignore Style.space() changes to groupPad/groupGap. At a live 1.5× text size, a model's ovals overhang by 4 px and overlap by 2 px.

Suggested change: call scheduleGroups() when groupPad or groupGap changes.

Reproducer (fails at 5c7cccb; a QML model built from Bar.qml lines; shows the stale inset, while the 4 and 2 px figures come from a fuller model that also grows the widgets)

Group padding does not follow a live text-size or spacing-scale change

Reproduces groupPad/groupGap updating with Style.space() while the insets already written onto the slots keep the old values, because no handler reruns updateGroupInsets when the pad or gap changes.

Reviewed head: 5c7cccb. Qt 6.11.2, offscreen platform.

Run from a scratch directory holding this file and a copy of shell/plugins/bar/BarModel.js from the PR head:

QT_QPA_PLATFORM=offscreen /usr/lib/qt6/bin/qmltestrunner -input tst_spacing_scale_insets.qml

tst_spacing_scale_insets.qml:

// Group padding after a live text-size or spacing-scale change.
// Lines tagged "Bar.qml:N" are copied from shell/plugins/bar/Bar.qml at 5c7cccbf and
// Style.space from shell/Commons/Style.qml (Style.* replaced by root.*).
// Run from a directory holding this file and shell/plugins/bar/BarModel.js:
//   QT_QPA_PLATFORM=offscreen /usr/lib/qt6/bin/qmltestrunner -input tst_spacing_scale_insets.qml
import QtQuick
import QtTest
import "BarModel.js" as BarModel

Item {
  id: root

  // Style.qml:211-223. `omarchy display text size 18` sets [font] base-size = 18,
  // so fontScale and effectiveSpacingScale become 1.5 while the shell runs.
  property real effectiveSpacingScale: 1.0
  function spaceReal(px) { var n = Number(px); if (!isFinite(n) || n <= 0) return 0; return n * effectiveSpacingScale }
  function space(px) { var n = spaceReal(px); if (n <= 0) return 0; return Math.max(1, Math.round(n)) }

  Item {
    id: moduleListRoot
    readonly property real groupPad: root.space(7)   // Bar.qml:1875
    readonly property real groupGap: root.space(6)   // Bar.qml:1876
    // What updateGroupInsets (Bar.qml:1895-1905) writes onto the slots. It is scheduled
    // from applySettingsDelta, onEntriesChanged, onLoaded, Repeater itemAdded/itemRemoved
    // and ModuleSlot.onShownChanged (Bar.qml:615, 1935-1936, 1967-1968, 1999-2000, 2028);
    // nothing reruns it when groupPad or groupGap change.
    property var slotInsets: []
    function updateGroupInsets() {
      slotInsets = BarModel.groupInsets(["g1", "g1", "g2"], groupPad, groupGap)
    }
    Component.onCompleted: updateGroupInsets()
  }

  TestCase {
    name: "SpacingScale"

    function test_insets_follow_a_live_spacing_scale_change() {
      compare(moduleListRoot.slotInsets[0].lead, 7)
      root.effectiveSpacingScale = 1.5
      wait(50)
      console.log("groupPad", moduleListRoot.groupPad, "first slot lead inset", moduleListRoot.slotInsets[0].lead)
      compare(moduleListRoot.groupPad, 11)
      compare(moduleListRoot.slotInsets[0].lead, moduleListRoot.groupPad, "padding follows the new scale")
    }
  }
}

Actual output (exit 1):

********* Start testing of qmltestrunner *********
Config: Using QtTest library 6.11.2, Qt 6.11.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 16.2.1 20260810), omarchy 4.0.4
PASS   : qmltestrunner::SpacingScale::initTestCase()
QDEBUG : qmltestrunner::SpacingScale::test_insets_follow_a_live_spacing_scale_change() qml: groupPad 11 first slot lead inset 7
FAIL!  : qmltestrunner::SpacingScale::test_insets_follow_a_live_spacing_scale_change() padding follows the new scale
   Actual   (): 7
   Expected (): 11
   Loc: [/tmp/r/tst_spacing_scale_insets.qml(43)]
PASS   : qmltestrunner::SpacingScale::cleanupTestCase()
Totals: 2 passed, 1 failed, 0 skipped, 0 blacklisted, 53ms
********* Finished testing of qmltestrunner *********

Overlap with #13139

#13139 ends pill runs where "group" changes. On top of it, this PR has 13 Bar.qml conflicts. Impact: one group key would drive both ovals and pill runs.

Suggested change: agree on group with #13139.

More findings

Open-panel mark is longer at group ends

The fallback mark length (Bar.qml:2061) is 0.55 × the padded slot width, so in the manual's example bluetooth and audio get longer marks than network (24 vs 17 px for 30 px widgets).

Suggested change: subtract slot.leadInset + slot.trailInset in the fallback.

Open-panel mark is longer on widgets at the ends of a group

Reproduces the open-panel mark fallback length being computed from the padded slot width, so bluetooth and audio at the ends of the manual's example group get a 24px mark while network in the middle (and any ungrouped widget) gets 17px.

Reviewed head: 5c7cccb. Qt 6.11.2, offscreen platform.

Run from a scratch directory holding this file and a copy of shell/plugins/bar/BarModel.js from the PR head:

QT_QPA_PLATFORM=offscreen /usr/lib/qt6/bin/qmltestrunner -input tst_panel_mark_extent.qml

tst_panel_mark_extent.qml:

// Open-panel mark length for widgets at the ends of a group.
// Lines tagged "Bar.qml:N" are copied from shell/plugins/bar/Bar.qml at 5c7cccbf
// (Style.space replaced by root.space at spacing scale 1, a shown 30px widget).
// Run from a directory holding this file and shell/plugins/bar/BarModel.js:
//   QT_QPA_PLATFORM=offscreen /usr/lib/qt6/bin/qmltestrunner -input tst_panel_mark_extent.qml
import QtQuick
import QtTest
import "BarModel.js" as BarModel

Item {
  id: root
  property bool vertical: false
  function space(px) { return Math.max(1, Math.round(px)) }

  component Slot: Item {
    id: slot
    property real leadInset: 0
    property real trailInset: 0
    implicitWidth: 30 + leadInset + trailInset   // Bar.qml:2063, horizontal and shown
    width: implicitWidth
    height: 26
    // Bar.qml:2061, the fallback used by widgets without an openPanelIndicatorWidth hint
    readonly property real panelIndicatorExtent: Math.max(root.space(10), Math.round((root.vertical ? slot.height : slot.width) * 0.55))
  }

  // Right section of the manual's example: agents, then bluetooth/network/audio in
  // group "controls", then monitor. Insets come from the PR's BarModel.groupInsets
  // with groupPad = Style.space(7) and groupGap = Style.space(6) (Bar.qml:1875-1876).
  readonly property var insets: BarModel.groupInsets(["", "controls", "controls", "controls", ""], space(7), space(6))

  Slot { id: agents; leadInset: root.insets[0].lead; trailInset: root.insets[0].trail }
  Slot { id: bluetooth; leadInset: root.insets[1].lead; trailInset: root.insets[1].trail }
  Slot { id: network; leadInset: root.insets[2].lead; trailInset: root.insets[2].trail }
  Slot { id: audio; leadInset: root.insets[3].lead; trailInset: root.insets[3].trail }

  TestCase {
    name: "PanelMark"

    function test_equal_widgets_get_equal_marks_inside_a_group() {
      console.log("extents agents/bluetooth/network/audio:",
                  agents.panelIndicatorExtent, bluetooth.panelIndicatorExtent,
                  network.panelIndicatorExtent, audio.panelIndicatorExtent)
      compare(network.panelIndicatorExtent, agents.panelIndicatorExtent, "middle of a group matches an ungrouped widget")
      compare(bluetooth.panelIndicatorExtent, network.panelIndicatorExtent, "group start matches group middle")
      compare(audio.panelIndicatorExtent, network.panelIndicatorExtent, "group end matches group middle")
    }
  }
}

Actual output (exit 1):

********* Start testing of qmltestrunner *********
Config: Using QtTest library 6.11.2, Qt 6.11.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 16.2.1 20260810), omarchy 4.0.4
PASS   : qmltestrunner::PanelMark::initTestCase()
QDEBUG : qmltestrunner::PanelMark::test_equal_widgets_get_equal_marks_inside_a_group() qml: extents agents/bluetooth/network/audio: 17 24 17 24
FAIL!  : qmltestrunner::PanelMark::test_equal_widgets_get_equal_marks_inside_a_group() group start matches group middle
   Actual   (): 24
   Expected (): 17
   Loc: [/tmp/r/tst_panel_mark_extent.qml(44)]
PASS   : qmltestrunner::PanelMark::cleanupTestCase()
Totals: 2 passed, 1 failed, 0 skipped, 0 blacklisted, 2ms
********* Finished testing of qmltestrunner *********

Anchored center ovals vanish while the anchor is hidden

Center ovals take their thickness from the anchor slot, which is 0×0 while hidden, so they collapse to zero thickness while a self-hiding centerAnchor (for example media) is hidden.

Suggested change: use the section's own cross size, as plain lists do.

Anchored center ovals collapse to zero thickness when the anchor hides

Reproduces the anchored center deriving every oval's cross-axis size from the anchor slot, which has zero size while the anchor widget hides itself.

Reviewed head: 5c7cccb. Qt 6.11.2, offscreen platform.

Run from a scratch directory holding this file and a copy of shell/plugins/bar/BarModel.js from the PR head:

QT_QPA_PLATFORM=offscreen /usr/lib/qt6/bin/qmltestrunner -input tst_hidden_anchor_oval.qml

tst_hidden_anchor_oval.qml:

// Anchored center: oval thickness when the anchor widget hides itself.
// Lines tagged "Bar.qml:N" are copied from shell/plugins/bar/Bar.qml at 5c7cccbf
// (horizontal bar, barSize 26, Style.space at scale 1).
// Run from a directory holding this file and shell/plugins/bar/BarModel.js:
//   QT_QPA_PLATFORM=offscreen /usr/lib/qt6/bin/qmltestrunner -input tst_hidden_anchor_oval.qml
import QtQuick
import QtTest
import "BarModel.js" as BarModel

Item {
  id: root
  property bool vertical: false
  function space(px) { return Math.max(1, Math.round(px)) }

  // The anchor slot's size: Bar.qml:2063-2064 with a 60x26 widget that can hide.
  Item {
    id: centerAnchorModule
    property bool shown: true
    implicitWidth: shown ? 60 : 0
    implicitHeight: shown ? 26 : 0
    width: implicitWidth
    height: implicitHeight
  }

  // The center host's cross-axis size for every oval (Bar.qml:1594, 1596-1597).
  function centerOvalThickness() {
    var vertical = root.vertical
    var slotCross = vertical ? centerAnchorModule.width : centerAnchorModule.height
    var inset = root.space(4)
    var thickness = Math.max(0, slotCross - inset * 2)
    return thickness
  }

  TestCase {
    name: "HiddenAnchor"

    function test_neighbour_group_keeps_its_oval_when_the_anchor_hides() {
      // Center layout [Q t, anchor t, R t]: with the anchor hidden, Q and R are
      // still one visible run (groupSlots drops hidden slots), so one oval is drawn.
      var spans = BarModel.groupSpans([
        { group: "t", start: 400, end: 437, lead: 7, trail: 0 },
        { group: "t", start: 437, end: 484, lead: 0, trail: 7 }
      ], root.space(7))
      compare(spans.length, 1)
      compare(centerOvalThickness(), 18, "thickness with the anchor shown")
      centerAnchorModule.shown = false
      console.log("thickness with the anchor hidden:", centerOvalThickness())
      verify(centerOvalThickness() > 0, "Q and R keep a visible oval")
    }
  }
}

Actual output (exit 1):

********* Start testing of qmltestrunner *********
Config: Using QtTest library 6.11.2, Qt 6.11.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 16.2.1 20260810), omarchy 4.0.4
PASS   : qmltestrunner::HiddenAnchor::initTestCase()
QDEBUG : qmltestrunner::HiddenAnchor::test_neighbour_group_keeps_its_oval_when_the_anchor_hides() qml: thickness with the anchor hidden: 0
FAIL!  : qmltestrunner::HiddenAnchor::test_neighbour_group_keeps_its_oval_when_the_anchor_hides() 'Q and R keep a visible oval' returned FALSE. ()
   Loc: [/tmp/r/tst_hidden_anchor_oval.qml(48)]
PASS   : qmltestrunner::HiddenAnchor::cleanupTestCase()
Totals: 2 passed, 1 failed, 0 skipped, 0 blacklisted, 2ms
********* Finished testing of qmltestrunner *********

Anchor at a group end sits off centre

anchors.centerIn centres the padded slot, so an anchor at one end of a group sits (lead − trail) / 2 off centre (6 px, then 3 px when its neighbour hides), unlike the "dead center" promise in manual/05-the-top-bar.md.

Suggested change: offset the anchor by (trailInset − leadInset) / 2 along the bar.

Anchored widget leaves the exact centre when it sits at a group end

Reproduces the anchor's content shifting by (lead inset - trail inset) / 2 because the padded slot, not the widget, is centred; the shift changes when the neighbour on the other side hides.

Reviewed head: 5c7cccb. Qt 6.11.2, offscreen platform.

Run from a scratch directory holding this file and a copy of shell/plugins/bar/BarModel.js from the PR head:

QT_QPA_PLATFORM=offscreen /usr/lib/qt6/bin/qmltestrunner -input tst_anchor_offset.qml

tst_anchor_offset.qml:

// Anchored widget position when it sits at one end of a group.
// Lines tagged "Bar.qml:N" are copied from shell/plugins/bar/Bar.qml at 5c7cccbf
// (horizontal bar, Style.space at scale 1, a 60px anchor widget in a 1000px bar).
// Run from a directory holding this file and shell/plugins/bar/BarModel.js:
//   QT_QPA_PLATFORM=offscreen /usr/lib/qt6/bin/qmltestrunner -input tst_anchor_offset.qml
import QtQuick
import QtTest
import "BarModel.js" as BarModel

Item {
  id: root
  width: 1000
  height: 26
  function space(px) { return Math.max(1, Math.round(px)) }

  // Center layout [elsewhen, clock (anchor) in group "time", weather in group "time"]
  // with elsewhen shown or hidden. Insets from the PR's BarModel.groupInsets.
  property bool leftNeighbourShown: true
  readonly property var insets: leftNeighbourShown
    ? BarModel.groupInsets(["", "time", "time"], space(7), space(6))
    : BarModel.groupInsets(["time", "time"], space(7), space(6))
  readonly property var clockInsets: leftNeighbourShown ? insets[1] : insets[0]

  Item {
    id: centerAnchorModule
    property real leadInset: root.clockInsets.lead
    property real trailInset: root.clockInsets.trail
    implicitWidth: 60 + leadInset + trailInset     // Bar.qml:2063
    width: implicitWidth
    height: 26
    anchors.centerIn: parent                         // Bar.qml:1643

    Item {
      id: widget
      anchors.fill: parent
      anchors.leftMargin: centerAnchorModule.leadInset    // Bar.qml:2108
      anchors.rightMargin: centerAnchorModule.trailInset  // Bar.qml:2109
    }
  }

  TestCase {
    name: "AnchorOffset"
    when: windowShown

    function offset() { return widget.mapToItem(root, widget.width / 2, 0).x - root.width / 2 }

    function test_anchor_widget_stays_on_the_centre() {
      var shownOffset = offset()
      root.leftNeighbourShown = false
      wait(20)
      var hiddenOffset = offset()
      console.log("clock centre offset, left neighbour shown/hidden:", shownOffset, hiddenOffset)
      compare(shownOffset, 0, "clock centred with its left neighbour shown")
      compare(hiddenOffset, 0, "clock centred with its left neighbour hidden")
    }
  }
}

Actual output (exit 1):

********* Start testing of qmltestrunner *********
Config: Using QtTest library 6.11.2, Qt 6.11.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 16.2.1 20260810), omarchy 4.0.4
PASS   : qmltestrunner::AnchorOffset::initTestCase()
QDEBUG : qmltestrunner::AnchorOffset::test_anchor_widget_stays_on_the_centre() qml: clock centre offset, left neighbour shown/hidden: 6 3
FAIL!  : qmltestrunner::AnchorOffset::test_anchor_widget_stays_on_the_centre() clock centred with its left neighbour shown
   Actual   (): 6
   Expected (): 0
   Loc: [/tmp/r/tst_anchor_offset.qml(53)]
PASS   : qmltestrunner::AnchorOffset::cleanupTestCase()
Totals: 2 passed, 1 failed, 0 skipped, 0 blacklisted, 22ms
********* Finished testing of qmltestrunner *********
Details

Verified (offscreen QML harness built from Bar.qml components, plus the PR's tests in a sandbox):

  • Insets and ovals for mixed groups: padding inside, one 6 px gap between neighbours, no doubled gap between adjacent groups.
  • Hidden widgets drop out and rejoin; a group runs across the center anchor on horizontal and vertical bars.
  • The inline settings path that omarchy bar set <id> group <name> reaches (CLI traced in source) regroups live, and group "" clears it.
  • Without group, slot and open-panel mark geometry match the merge-base (0 differences for 7 slots in 3 arrangements).
  • bar-test.sh passes at the head (99 checks, 88 at the merge-base).

Optional test improvement: 7 of 10 deliberate code mutations still pass bar-test.sh. The live-regroup regex /slot\.group = group[\s\S]*?scheduleGroups\(\)/ still matches after the regroup call is deleted, because it runs on to a later scheduleGroups(). Limiting it to applySettingsDelta would make it guard that call.

The live-regroup assertion passes without the regroup call

Test-validity reproducer. test/shell.d/bar-test.sh asserts /slot\.group = group[\s\S]*?scheduleGroups\(\)/ for "changing a widget group live regroups its section". The lazy [\s\S]*? can run on to any later scheduleGroups() in Bar.qml, so the assertion still passes when the call it is meant to guard is removed.

Reviewed head: 5c7cccb.

Steps, in a disposable copy of the PR head:

  1. Delete line 615 of shell/plugins/bar/Bar.qml, the regroup call in applySettingsDelta.
  2. Run bash test/shell.d/bar-test.sh.

Mutation applied (diff -r of the unmodified head against the copy):

diff -r a/shell/plugins/bar/Bar.qml b/shell/plugins/bar/Bar.qml
615d614
<           if (slot.list) slot.list.scheduleGroups()

Actual result: exit status 0, 99 ok lines, no not ok lines (the unmodified head also prints 99 ok lines). The assertion line from the run output:

ok - changing a widget group live regroups its section

In the mutated file the regex match runs from slot.group = group (line 614) to the center section's function scheduleGroups() { Qt.callLater(updateGroupInsets) } (line 1604 of the mutated file, 1605 at head).

Same method, other behaviours the new tests do not cover (each change applied alone to a copy of the head; bar-test.sh exit status and ok count):

head                         exit=0 ok=99 notok=0
base                         exit=0 ok=88 notok=0
base-with-head-test          exit=1 ok=12 notok=0
M1-double-gap                exit=1 ok=12 notok=1
M2-span-no-pad               exit=1 ok=15 notok=1
M3-delta-no-schedule         exit=0 ok=99 notok=0
M4-no-shown-handler          exit=0 ok=99 notok=0
M5-no-loader-margins         exit=0 ok=99 notok=0
M6-no-positioning-hook       exit=0 ok=99 notok=0
M7-no-color-token            exit=0 ok=99 notok=0
M8-delta-no-group            exit=1 ok=21 notok=1
M9-no-shown-filter           exit=0 ok=99 notok=0
M10-anchor-excluded          exit=0 ok=99 notok=0

M1 (doubled gap between adjacent groups), M2 (oval misses its padding) and M8 (the live group assignment removed) fail. M3 (live regroup call removed), M4 (hidden-widget regroup handler removed), M5 (content insets removed), M6 (oval refresh after repositioning removed), M7 (Color.bar.group removed), M9 (hidden widgets no longer filtered from groups) and M10 (center anchor excluded from groups) all pass. base-with-head-test is the PR's test file run against the merge-base sources: it stops with TypeError: bar.groupInsets is not a function.

Overlap check: merged as text with git merge-file: quattro plus #13139 is clean, quattro plus this PR is clean, and this PR on top of #13139 gives 13 conflicting hunks in shell/plugins/bar/Bar.qml. #6961 ("Bar widget group") also touches ModuleList but already conflicts with quattro.


Review information

Test scope: Source, PR tests, offscreen QML models at 5c7cccbf; no live desktop.

AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check.

Opt out: To stop receiving these reviews, reply to this comment saying so.

@cristian-fleischer

Copy link
Copy Markdown

Hi @AbaddonTataken, llstrk's review points at the overlap with #13139, which uses "group" to split pill runs. Both are backgrounds behind runs of widgets, so maybe it's best to settle on one meaning for the key. Happy to look at merging the ideas: your ovals could be a pill style, or #13139 could take your group semantics. Context for the whole set: #13136.

- The center anchor slot survives rebuilds, so a live `group` change
  left it grouped; it now rebinds to its entry on entry change.
- Group padding and gap follow a live text-size change.
- The open-panel mark ignores the group padding when sizing itself.
- Anchored center ovals take their thickness from the section, so they
  survive the anchor hiding itself.
- The anchor is centred on its widget, not its padded slot, at a group end.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@AbaddonTataken

Copy link
Copy Markdown
Author

Thanks @cristian-fleischer, and thanks @llstrk for the review.

All six findings are fixed in fbe2812: the center anchor now follows its entry after a live group change, group padding follows a live text size, the open-panel mark and the anchor's centring ignore the group padding, and the anchored-center ovals no longer collapse while the anchor hides.

On group vs #13139: I agree the key should mean one thing. Both PRs use it as "neighbours with the same name belong together", and differ only in what is drawn behind the run. I'd rather not ship two backgrounds for the same run, so my suggestion is to keep group as the run key as in #13139 and make this PR's oval a pill style on top of it (shape and the group-background token), keeping the live omarchy bar set <id> group <name> and the anchored-center handling here. I'm happy to rework it that way once #13139's direction is settled.

@greptile-apps

greptile-apps Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Adds visual grouping feature to bar widget layout.

The PR appears safe to merge; no actionable issues were found.

What we checked:

  • Hidden widgets leave empty ovals: Hidden widgets get zero slot size and are left out of the group calculations. A change in visibility schedules regrouping.
  • Live changes keep old groups: The settings update changes the slot’s group and asks its list to regroup. Anchored lists pass that request to the shared center.

Summary

Adds shared oval backgrounds for neighbouring bar widgets with the same group name.

  • Supports live group changes and widgets that hide themselves.
  • Groups the anchored center across its before-list, anchor, and after-list.
  • Adds theme colours, documentation, and tests for the layout calculations.
  • No actionable issues found. Tests and desktop visuals were not run during this review.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Entries["Layout entries and visible widgets"] --> Insets["BarModel.groupInsets"]
  Insets --> Slots["ModuleSlot padding"]
  Slots --> Positions["Row, Column, or anchored center"]
  Positions --> Spans["BarModel.groupSpans"]
  Spans --> Ovals["GroupOvals"]
  Theme["Color.bar.group"] --> Ovals
Loading

Reviews (1) · Last reviewed commit: "Fix group layout bugs found in review" · Reviewed by Greptile

@cristian-fleischer

Copy link
Copy Markdown

Thanks, agreed: group stays the run key and the oval becomes a pill style. I'm porting #13139 onto the reworked bar first, then it should be easy to build on.

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.

4 participants