Skip to content

feat: let the workspace widget order its cells - #978

Open
lucacome wants to merge 1 commit into
stablebox:mainfrom
lucacome:feat/workspace-order
Open

lucacome wants to merge 1 commit into
stablebox:mainfrom
lucacome:feat/workspace-order

Conversation

@lucacome

@lucacome lucacome commented Dec 2, 2026

Copy link
Copy Markdown

Problem

Fixes #977.

The workspace cells can only show in alphabetical order. The window manager can't express a custom order either: AeroSpace has no order setting (AeroSpace#1816), and renaming workspaces is the only lever. A user who wants Z X C V B N M on the bottom keyboard row has no way to get it, because StableBar sorts whatever the source returns.

Changes

  • Add workspace.order, a list of workspace names in the order the cells show them, next to hideApps, hideWorkspaces and the other workspace options:
    • listed workspaces come first, in the list's order;
    • workspaces the list doesn't name keep the source's order after the listed ones;
    • names that aren't present are skipped, like widgetOrder;
    • without order, workspaces keep today's alphabetical order.
  • Apply it in WorkspaceFilter.apply(to:), so it follows the widget's own configuration, screen setups and profiles, and works with every workspace source.
  • Add Workspace order to the workspace inspector.
  • Update stablebar.schema.json and the workspace appearance docs.
  • Add workspaceOrderPutsNamedWorkspacesFirst.
{ "id": "workspaces", "type": "workspaces", "position": "left",
  "workspace": { "order": ["Z", "X", "C", "V", "B", "N", "M"] } }

Testing

  • swift build passes.
  • workspaceOrderPutsNamedWorkspacesFirst, displayedWorkspacesKeepEmptyVisibleSpacesOnTheirMonitor and hiddenAppsAndWorkspacesLeaveTheDisplayedWorkspaces pass.
  • The wider swift test --filter 'workspace|Workspace' run passes 74 of 75. The failing workspaceLabelsFollowTheBarFromLightToDark also fails on clean main in this environment (pixel rendering), so it is unrelated.
  • Manual check in a local development build: ["9", …, "1"] drew 9 8 7 6 5 4 3 2 1, and the keyboard list drew Z X C V B N M. The inspector shows Workspace order after Hide workspaces.
  • Not checked: windows moving between reordered cells by drag; the filter only reorders the list it hands the view.

Merging

Squash.

DeepSeek V4.1 Flash via OpenCode

@lucacome
lucacome requested a review from Seb-GRAF as a code owner December 2, 2026 01:27

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 8 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread docs/widgets.md Resolved
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Before and after

main at f98afd4 → this pull request at 880b7f6 · 203 screens drawn · 1 changed

Screen Change Where (image pixels)
scenes/settings-workspace-hidden-dark 88,938 pixels 502,1364 · 1584×78

scenes/settings-workspace-hidden-dark

Before After
Before After

Difference, changed pixels in red:

Difference

202 unchanged screens

docs/essentials-clock-settings-dark, docs/essentials-clock-settings-light, docs/essentials-dark, docs/essentials-light, docs/essentials-settings-dark, docs/essentials-settings-light, docs/hero-dark, docs/hero-light, docs/popups-dark, docs/popups-light, docs/settings-dark, docs/settings-light, docs/themes-dark, docs/themes-light, scenes/accessibility-guide-dark, scenes/app-menu-popup-dark, scenes/apple-menu-settings-dark, scenes/apple-menu-symbol-bar-dark, scenes/apple-menu-symbol-settings-dark, scenes/bar-dividers-dark, scenes/bottom-bar-popup-dark, scenes/chat-popup-dark, scenes/crowded-edit-bar-dark, scenes/disk-meter-bar-dark, scenes/dock-badges-bar-dark, scenes/edit-bar-wide-group-dark, scenes/essentials-clock-popup-dark, scenes/essentials-disk-popup-dark, scenes/filled-slider-popup-dark, scenes/glass-text-follows-background-bar-dark, scenes/glass-text-follows-background-bar-light, scenes/group-members-bar-dark, scenes/group-others-bar-dark, scenes/group-text-color-bar-dark, scenes/gruvbox-bar-dark, scenes/gruvbox-bar-light, scenes/horizontal-list-popup-dark, scenes/increase-contrast-bar-dark, scenes/increase-contrast-bar-light, scenes/increase-contrast-popup-dark, scenes/increase-contrast-popup-light, scenes/input-source-popup-dark, scenes/labeled-metric-built-in-dark, scenes/labeled-metric-catppuccin-dark, scenes/labeled-metric-catppuccin-light, scenes/meeting-live-popup-dark, scenes/meeting-soon-bar-dark, scenes/menu-bar-items-widget-settings-dark, scenes/menu-bar-items-widget-style-dark, scenes/merged-status-bar-dark, scenes/notch-flare-bar-dark, scenes/output-device-popup-dark, scenes/package-template-clash-bar-dark, scenes/popup-gap-bar-dark, scenes/popup-spacing-bar-dark, scenes/popup-view-dark, scenes/preset-dashboard-bar-dark, scenes/preset-developer-bar-dark, scenes/preset-everyday-bar-dark, scenes/preset-minimal-bar-dark, scenes/preset-workday-bar-dark, scenes/privacy-both-bar-dark, scenes/privacy-hide-when-idle-bar-dark, scenes/privacy-idle-bar-dark, scenes/privacy-microphone-bar-dark, scenes/privacy-settings-dark, scenes/quick-toggles-bar-dark, scenes/quick-toggles-displays-popup-dark, scenes/quick-toggles-every-tile-popup-dark, scenes/quick-toggles-network-popup-dark, scenes/quick-toggles-networks-popup-dark, scenes/quick-toggles-popup-dark, scenes/reduce-transparency-bar-dark, scenes/reduce-transparency-bar-light, scenes/reduce-transparency-glass-bar-dark, scenes/reduce-transparency-glass-bar-light, scenes/reduce-transparency-text-follows-background-bar-dark, scenes/reduce-transparency-text-follows-background-bar-light, scenes/ring-bar-dark, scenes/settings-bar-dark, scenes/settings-bar-link-dark, scenes/settings-bar-link-review-dark, scenes/settings-bar-link-workspace-color-dark, scenes/settings-bar-look-dark, scenes/settings-bar-look-light, scenes/settings-bar-placement-bottom-dark, scenes/settings-bar-placement-dark, scenes/settings-calendar-picker-dark, scenes/settings-calendar-widget-dark, scenes/settings-clock-widget-dark, scenes/settings-crashes-dark, scenes/settings-disk-widget-dark, scenes/settings-feedback-dark, scenes/settings-general-dark, scenes/settings-general-kiwidesk-dark, scenes/settings-general-macos15-dark, scenes/settings-general-macos27-dark, scenes/settings-general-manager-not-found-dark, scenes/settings-general-move-dark, scenes/settings-general-move-failed-dark, scenes/settings-general-move-moving-dark, scenes/settings-general-move-replace-dark, scenes/settings-general-setup-open-dark, scenes/settings-general-spaces-dark, scenes/settings-general-yabai-gap-dark, scenes/settings-group-dark, scenes/settings-group-defaults-dark, scenes/settings-group-defaults-light, scenes/settings-group-theme-color-dark, scenes/settings-group-theme-color-light, scenes/settings-help-dark, scenes/settings-help-starred-dark, scenes/settings-labeled-metric-dark, scenes/settings-narrow-dark, scenes/settings-package-dark, scenes/settings-package-widget-dark, scenes/settings-profiles-conditions-dark, scenes/settings-profiles-dark, scenes/settings-profiles-groups-dark, scenes/settings-profiles-theme-dark, scenes/settings-quick-toggles-dark, scenes/settings-quits-dark, scenes/settings-store-dark, scenes/settings-theme-dark, scenes/settings-theme-edits-dark, scenes/settings-theme-edits-light, scenes/settings-theme-groups-dark, scenes/settings-theme-light, scenes/settings-theme-link-dark, scenes/settings-theme-link-light, scenes/settings-theme-origins-dark, scenes/settings-theme-versions-dark, scenes/settings-tiled-dark, scenes/settings-tiled-narrowest-dark, scenes/settings-uninstall-dark, scenes/settings-uninstall-failed-dark, scenes/settings-widget-backgrounds-dark, scenes/settings-widget-backgrounds-light, scenes/settings-widget-colors-dark, scenes/settings-widget-colors-light, scenes/settings-widget-style-theme-edits-dark, scenes/settings-widget-style-theme-edits-light, scenes/setup-allow-aerospace-gap-dark, scenes/setup-allow-automation-dark, scenes/setup-allow-below-menu-bar-dark, scenes/setup-allow-dark, scenes/setup-allow-dot-dark, scenes/setup-allow-macos27-dark, scenes/setup-allow-offline-dark, scenes/setup-allow-spaces-dark, scenes/setup-allow-workday-dark, scenes/setup-choose-dark, scenes/setup-choose-new-dark, scenes/setup-choose-no-battery-dark, scenes/setup-done-dark, scenes/setup-intro-dark, scenes/setup-intro-wallpaper-dark, scenes/setup-move-existing-dark, scenes/setup-move-failed-dark, scenes/setup-move-ready-dark, scenes/setup-move-replace-dark, scenes/shadow-offsets-bar-dark, scenes/shadow-offsets-bar-light, scenes/share-my-bar-dark, scenes/share-my-bar-dock-dark, scenes/share-my-bar-glass-dark, scenes/share-my-bar-glass-light, scenes/share-my-bar-landscape-dark, scenes/share-my-bar-link-dark, scenes/share-my-bar-macbook-dark, scenes/share-my-bar-post-dark, scenes/slider-end-stop-popup-dark, scenes/sound-details-popup-dark, scenes/stablebar-widget-bar-dark, scenes/stablebar-widget-settings-dark, scenes/starter-bar-dark, scenes/starter-edit-bar-dark, scenes/symbol-variants-bar-dark, scenes/system-monitor-memory-bar-dark, scenes/system-monitor-shows-settings-dark, scenes/system-monitor-split-warning-bar-dark, scenes/text-follows-background-bar-dark, scenes/text-follows-background-bar-light, scenes/themed-slider-inline-dark, scenes/themed-slider-inline-light, scenes/themed-slider-popup-dark, scenes/themed-slider-popup-light, scenes/themed-slider-tooltip-dark, scenes/themed-slider-tooltip-light, scenes/tinted-app-icons-bar-dark, scenes/tinted-app-icons-bar-light, scenes/tinted-image-bar-dark, scenes/tinted-image-bar-light, scenes/update-popup-dark, scenes/update-popup-star-github-cli-dark, scenes/update-popup-star-thanks-dark, scenes/workspace-badges-bar-dark, scenes/workspace-cells-bar-dark, scenes/workspace-focused-window-bar-dark, scenes/workspace-focused-window-padding-bar-dark, and 2 more

Visual review: 1 screen changed: a maintainer adds visual-ok after looking.

@M4n0x

M4n0x commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the PR, nice one! Looks good, the filter is the right place for it. Checked if we could just take the order from AeroSpace but it always sorts workspaces by name on its side and doesn't expose persistent-workspaces, so a list is the only way until AeroSpace#1816 lands

The Commit messages check is red though, the first commit has body lines over 100 chars and fix docs needs a type, squashing both into one with a wrapped body should do it

Small things in the docs, "Without it, AeroSpace's workspaces stay in alphabetical order" reads like it's AeroSpace only, maybe "Without it, workspaces keep the source's order (alphabetical with AeroSpace)". And order matches the workspace name like hideWorkspaces, with OmniWM or Rift that's not always the label shown in the bar, worth a word imo. A small scene with order set would be nice too so the bot draws the bar itself, like scenes/workspace-badges-bar.json

Add workspace.order, a list of workspace names in the order the cells
show them. Listed workspaces come first, workspaces it does not name keep
the source order after them, and names that are not present are skipped,
like widgetOrder for widgets. Without the key, workspaces keep the
source's order, alphabetical with AeroSpace. The list matches a
workspace's name, which with OmniWM or Rift can differ from the label the
cell shows.

Expose it as Workspace order in the workspace inspector, document it with
the other workspace options, and draw a scene of a bar using it.
@lucacome
lucacome force-pushed the feat/workspace-order branch from 880b7f6 to 6e995ce Compare December 2, 2026 22:25
@lucacome
lucacome requested a review from M4n0x as a code owner December 2, 2026 22:25
@lucacome

lucacome commented Dec 2, 2026

Copy link
Copy Markdown
Author

Thanks for the review and fast turnaround @M4n0x !

I've pushed the fixes and squashed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Let the workspace widget show workspaces in a configured order

2 participants