Skip to content

Add outline style for workspace selection - #9559

Closed
austinywang wants to merge 2 commits into
mainfrom
issue-7460-sidebar-active-workspace-indicator-that
Closed

austinywang wants to merge 2 commits into
mainfrom
issue-7460-sidebar-active-workspace-indicator-that

Conversation

@austinywang

@austinywang austinywang commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add an Outline workspace indicator style that preserves the workspace-color fill and draws the configured selection color as a 1.5-point active-row border.
  • Share background, border, and foreground policy between the AppKit and legacy SwiftUI sidebar row paths.
  • Expose the new style in Settings, the configuration schema/reference, and the localized indicator label.

Fixes #7460

Testing

  • Regression proof before the production fix: ./scripts/reload-cloud.sh xctest --tag sym7460-red3 --scheme cmux-unit --only-testing cmuxTests/SidebarAppKitRowCellTests (fleet run sym7460-red3-461055e1ea59) failed the new test on all four intended assertions: decoded style, preserved fill, 1.5-point border, and selection-color stroke.
  • Tagged app build: ./scripts/reload-cloud.sh --tag sym7460 --launch via the cloud Blacksmith path, run 30884758925, including deep-signature verification.
  • Socket-driven dogfood against /tmp/cmux-debug-sym7460.sock: with workspace color #C0392B, workspaceColors.indicatorStyle = outline, and selection color #123456, the active row retained the red fill and showed a distinct dark outline. Pixel sampling measured the border as srgba(27,51,83,1) and the interior as srgba(93,47,43,1).
  • Quit the tagged app after verification; the tagged CLI now returns connection refused for /tmp/cmux-debug-sym7460.sock.
  • ./scripts/lint-pbxproj-test-wiring.sh
  • Parsed Resources/Localizable.xcstrings and web/data/cmux.schema.json with jq; audited the changed Swift/UI strings and verified the Outline label matches the existing indicator locales.

Checklist

  • I tested the change in a tagged dev build
  • I added or updated tests for behavior changes
  • I updated the settings reference and schema
  • All code review bot comments are resolved
  • All human review comments are resolved

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Adds an Outline active-workspace indicator that keeps the workspace fill and draws a 1.5pt border using the selection color. Unifies sidebar selection visuals across AppKit and SwiftUI, exposes the option in Settings and the config schema. Fixes #7460.

  • New Features

    • New outline indicator style in Settings with a localized label; selection color subtitle now says “Background or outline.”
    • Active rows use a 1.5pt selection-color border for outline while preserving the workspace fill; inverted foreground is off for outline.
    • Centralized background/border/foreground logic shared by AppKit and SwiftUI.
    • Schema/docs updated to include outline; tests verify style decoding, preserved fill, 1.5pt stroke, and selection-color usage.
  • Bug Fixes

    • Better contrast for active text, badges, spinners, metadata, and progress across indicator styles.

Written for commit 2ab0cc7. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Added an outline-style indicator for the active workspace.
    • Active workspace rows now support configurable outline colors while preserving their existing fill color.
    • Updated workspace style labels and settings descriptions to include the new outline option.
  • Documentation

    • Updated settings references and schema documentation with the outline indicator and selection-color behavior.
  • Bug Fixes

    • Improved active workspace text, badges, metadata, and progress styling for consistent contrast across indicator styles.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Workspace outline indicator

Layer / File(s) Summary
Indicator contract and settings metadata
Packages/macOS/CmuxSettings/..., Resources/Localizable.xcstrings, web/data/cmux.schema.json, skills/cmux-settings/references/all-keys.md
Adds the public outline indicator style, localized display text, schema support, and updated selection-color descriptions.
Workspace row appearance rules
Sources/Sidebar/SidebarAppearanceSupport.swift
Adds shared border and foreground helpers. Outline rows retain workspace colors and use the resolved selection color for the border.
Sidebar rendering and regression coverage
Sources/ContentView.swift, Sources/Sidebar/AppKitList/Cells/*, cmuxTests/SidebarAppKitRowCellTests.swift
Applies shared border and foreground decisions across workspace-row content. Adds tests for outline background, border width, and border color.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

  • Issue 8262 — Covers the outline indicator behavior and regression tests for preserving workspace fill color and applying a selection-colored border.

Possibly related PRs

Suggested reviewers: azooz2003-bit, lawrencecchen


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (2 errors, 1 warning)

Check name Status Explanation Resolution
Cmux Full Internationalization ❌ Error The changed Swift strings cover only en/ja and en/ja/ko/uk, not all 20 Localizable.xcstrings locales; the changed schema description is raw English with no matching entries in web/messages. Add translated catalog values for all supported app locales, and use a schema descriptionKey with matching localized entries in every web/messages locale.
Cmux No Ambient Global State ❌ Error Sources/Sidebar/SidebarAppearanceSupport.swift:282 and 366 add internal file-scope functions used by ContentView and AppKit rows as shared API. Move row policy into a constructable SidebarWorkspaceRowAppearancePolicy, inject it into both row paths at their render seams, and keep only private/fileprivate local helpers.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (22 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes satisfy issue #7460 by preserving the workspace color and adding a configurable 1.5-point selection-color outline.
Out of Scope Changes check ✅ Passed The implementation, tests, localization, schema, and documentation changes are directly related to the linked issue objectives.
Cmux Swift Actor Isolation ✅ Passed The diff adds no async/service or Sendable reference boundary; the enum remains Sendable, UI changes stay in SwiftUI/AppKit MainActor paths, and new helpers are used only by those UI paths.
Cmux Swift Blocking Runtime ✅ Passed The two-commit Swift diff adds no semaphores, waits, sleeps, delayed dispatch, polling, main-queue sync, timers, or manual locks; test changes are deterministic scaffolding.
Cmux Browser Automation Off-Main ✅ Passed The PR changes only workspace sidebar/settings files; governed TerminalController, socket policy, and tests are unchanged, with no browser automation tokens in the diff.
Cmux Expensive Synchronous Load ✅ Passed The Swift diff adds only enum, color, border, and foreground logic; it adds no agent-history loader, file I/O, directory scan, or large JSON parsing on an interactive path.
Cmux Cache Substitution Correctness ✅ Passed The Swift diff changes sidebar presentation and style configuration only. It does not replace an authoritative read in persistence, history, undo, or snapshot code with a cache.
Cmux No Hacky Sleeps ✅ Passed The patch changes only Swift, localization, schema, and documentation files; it adds no covered TypeScript, JavaScript, shell, or build/runtime delay code.
Cmux Algorithmic Complexity ✅ Passed The production diff adds constant-time enum, color, and border decisions. It introduces no loops, collection scans, sorting/filtering, joins, or per-target rescans in scalable paths.
Cmux Swift Concurrency ✅ Passed The PR adds only synchronous enum, color-policy, view, and regression-test logic; added Swift lines contain no Dispatch queues, Combine state, completion APIs, or fire-and-forget Tasks.
Cmux Swift @Concurrent ✅ Passed The full PR diff adds no @concurrent, nonisolated async, or heavy async work; its only new isolation marker is @MainActor on a synchronous UI test suite.
Cmux Swift Package Boundaries ✅ Passed The new app-target code is sidebar rendering glue: it uses NSColor/ColorScheme and app-specific WorkspaceTabColorSettings for AppKit and SwiftUI rows; the value enum remains in CmuxSettings.
Cmux Swiftpm Lockfiles ✅ Passed PASS: The HEAD diff changes only CmuxSettings/CmuxSettingsUI source and app files; it has no Package.swift, Package.resolved, .gitignore, workflow, or Xcode project changes.
Cmux Swift Logging ✅ Passed The full PR diff adds no print, debugPrint, dump, NSLog, Logger, file/stdout logging, or secret-bearing diagnostics; existing cmuxDebugLog calls are unchanged.
Cmux User-Facing Error Privacy ✅ Passed The production diff adds only workspace indicator UI text, localization, styling, and configuration documentation; it adds no user-facing error, alert, command output, or recovery copy.
Cmux Swiftui State Layout ✅ Passed The aggregate Swift diff adds no new ObservableObject/@published, GeometryReader, lazy-row store reference, or render-time state mutation; changes use immutable snapshots and styling helpers, while...
Cmux Architecture Rethink ✅ Passed The PR adds immutable border policy and shared pure helpers used by both SwiftUI and AppKit; the diff adds no timing repair, polling, locks, observers, side channels, or new lifecycle owner.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed The PR changes sidebar styling, settings, localization, and tests only; no standalone NSWindow, NSPanel, NSWindowController, Window, or WindowGroup code is added or materially changed.
Cmux Source Artifacts ✅ Passed All 11 PR paths are intentional Swift source, tests, localization, schema, or documentation changes; no temp, cache, build, log, screenshot, recording, or artifact path appears in the diff.
Cmux No Test Or Debug Seam In Production Source ✅ Passed Production Swift diff adds only workspace-style, border, and foreground logic; it adds no test/debug accessor, build guard, visibility widening, or test seam.
Title check ✅ Passed The title clearly and concisely describes the main change: adding an outline style for workspace selection.
Description check ✅ Passed The description covers the change, rationale, testing, documentation, and checklist, but it omits the required Demo Video section.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch issue-7460-sidebar-active-workspace-indicator-that
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-7460-sidebar-active-workspace-indicator-that

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@austinywang

Copy link
Copy Markdown
Contributor Author

@codex review
@coderabbitai review
@greptile-apps review
@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 4, 2026

Copy link
Copy Markdown

@codex review
@coderabbitai review
@greptile-apps review
@cubic-dev-ai review

@austinywang I can't start this review because your workspace has reached its free monthly review limit. cubic has reviewed 245,275 of the 240,000 allowed lines of code this month. Reviews resume on 1 September 2026 (in 28 days). Paid plans include much higher monthly review limits. Upgrade now to resume reviews.

To help optimise your usage, you can tune cubic to get the most out of your usage limits:

Learn more →

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

@austinywang I will review pull request #9559.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Resources/Localizable.xcstrings`:
- Around line 214050-214078: Update the localization entry
sidebar.activeTabIndicator.outline to include translated stringUnit values for
ar, bs, da, de, es, fr, it, km, nb, pl, pt-BR, ru, th, tr, zh-Hans, and zh-Hant,
while preserving the existing translations.

In `@web/data/cmux.schema.json`:
- Around line 1150-1153: Update the selectionColor schema definition to
reference a descriptionKey for its localized description, add the corresponding
maintained entries in the English and Japanese message catalogs, and regenerate
the schema reference document so the localized description is reflected
consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d313bd96-cb78-44ec-9d5a-9817edf4abb3

📥 Commits

Reviewing files that changed from the base of the PR and between 1cee402 and 0b710ee.

📒 Files selected for processing (11)
  • Packages/macOS/CmuxSettings/Sources/CmuxSettings/Values/WorkspaceIndicatorStyle.swift
  • Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/WorkspaceColorsSection.swift
  • Resources/Localizable.xcstrings
  • Sources/ContentView.swift
  • Sources/Sidebar/AppKitList/Cells/SidebarWorkspaceRowCellView.swift
  • Sources/Sidebar/AppKitList/Cells/SidebarWorkspaceRowSupportViews.swift
  • Sources/Sidebar/SidebarAppearanceSupport.swift
  • Sources/WorkspaceIndicatorStyle+Display.swift
  • cmuxTests/SidebarAppKitRowCellTests.swift
  • skills/cmux-settings/references/all-keys.md
  • web/data/cmux.schema.json

Comment on lines +214050 to +214078
"sidebar.activeTabIndicator.outline": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Outline"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "アウトライン"
}
},
"ko": {
"stringUnit": {
"state": "translated",
"value": "윤곽선"
}
},
"uk": {
"stringUnit": {
"state": "translated",
"value": "Контур"
}
}
}
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Add translations for every supported locale.

sidebar.activeTabIndicator.outline currently defines only en, ja, ko, and uk. Add entries for ar, bs, da, de, es, fr, it, km, nb, pl, pt-BR, ru, th, tr, zh-Hans, and zh-Hant before merge.

As per path instructions, new localization keys must include translated values for every locale supported by the touched catalog.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Resources/Localizable.xcstrings` around lines 214050 - 214078, Update the
localization entry sidebar.activeTabIndicator.outline to include translated
stringUnit values for ar, bs, da, de, es, fr, it, km, nb, pl, pt-BR, ru, th, tr,
zh-Hans, and zh-Hant, while preserving the existing translations.

Sources: Path instructions, Learnings

Comment thread web/data/cmux.schema.json
Comment on lines 1150 to +1153
"selectionColor": {
"$ref": "#/$defs/colorHexOrNull",
"default": null,
"description": "Override the selected workspace background color."
"description": "Override the selected workspace background or outline color."

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Localize the changed schema description.

Line 1153 adds user-facing outline behavior as raw English text. Add a descriptionKey, add the matching maintained web catalog entries, and regenerate the reference document.

As per path instructions, user-facing schema descriptions must have matching localized message coverage. Based on learnings, schema-description keys are maintained in web/messages/en.json and web/messages/ja.json.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/data/cmux.schema.json` around lines 1150 - 1153, Update the
selectionColor schema definition to reference a descriptionKey for its localized
description, add the corresponding maintained entries in the English and
Japanese message catalogs, and regenerate the schema reference document so the
localized description is reflected consistently.

Sources: Coding guidelines, Path instructions, Learnings

@austinywang
austinywang force-pushed the issue-7460-sidebar-active-workspace-indicator-that branch from 8df5934 to 2ab0cc7 Compare August 4, 2026 08:03
@lawrencecchen lawrencecchen added the stale-revisit Closed after 30+ days without activity; preserved for possible revisit or reopening. label Sep 23, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in cmux backlog Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale-revisit Closed after 30+ days without activity; preserved for possible revisit or reopening.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sidebar: active workspace indicator that preserves the workspace color (outline/border style)

3 participants