Skip to content

Show more notification content in the sidebar - #7965

Merged
lawrencecchen merged 13 commits into
mainfrom
task-expand-sidebar-notification-content
Jul 13, 2026
Merged

lawrencecchen merged 13 commits into
mainfrom
task-expand-sidebar-notification-content

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • expand inline workspace notification previews from 2 to 12 lines by default
  • add Settings > Sidebar > Notification Preview Lines with a supported range of 1–50
  • expose sidebar.notificationMessageLineLimit in cmux.json and its schema
  • cap display shaping at 4,096 characters while preserving lazy, equatable sidebar rows

Testing

  • swift test in Packages/macOS/CmuxSettings (251 passed)
  • swift test in Packages/macOS/CmuxSettingsUI (96 passed)
  • python3 scripts/swift_file_length_budget.py --base-ref origin/main
  • tagged cloud build: notif12 at 9f3cbd2a86
  • tagged UI preflight changed the Stepper from 12 to 4, verified the existing notification collapsed live to four lines, then restored 12
  • parsed Resources/Localizable.xcstrings and web/data/cmux.schema.json; new Settings copy includes English and Japanese

Configuration

{
  "sidebar": {
    "notificationMessageLineLimit": 12
  }
}

Note

Low Risk
Sidebar display and preferences only; values are clamped and bounded, with catalog/UI tests and schema coverage. No auth, security, or data-path changes.

Overview
Adds sidebar.notificationMessageLineLimit (default 12, range 1–50) so workspace notification previews below titles are no longer capped at a fixed two lines.

Settings & config: A new Sidebar Notification Preview Lines stepper (disabled when details are hidden or notification text is off) wires through UserDefaults, settings search, cmux.json parsing/template, and the web schema. English and Japanese strings are included.

Runtime: Sidebar rows read the clamped limit from settings, apply it to the latest notification subtitle via dynamic lineLimit, and pre-shape text with sidebarBoundedDisplayString (up to 4,096 characters) before render. iMessage conversation fallbacks still use two lines when there is no notification text.

Reviewed by Cursor Bugbot for commit 9b5ec3f. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • New Features
    • Added a sidebar setting to control how many lines of the latest notification appear beneath each workspace title (1–50, default 12).
    • Notification previews now dynamically apply the effective subtitle and respect the configured line limit for display.
    • Added a Stepper control in sidebar settings, disabled when notification previews are unavailable.
  • Documentation
    • Updated schema, default templates, and configuration documentation for the new setting.
  • Localization
    • Added localized label/subtitle text for the new setting.
  • Tests
    • Extended coverage for defaults, persistence round-trips, and settings row anchor resolution.

@vercel

vercel Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Jul 13, 2026 12:47pm
cmux-staging Building Building Preview, Comment Jul 13, 2026 12:47pm

@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

A new sidebar setting controls the maximum lines shown for the latest notification preview. The setting is validated, persisted, exposed through the settings UI and configuration schema, indexed for navigation, and applied to workspace subtitle rendering.

Changes

Notification preview line limit

Layer / File(s) Summary
Define and persist the line-limit setting
Packages/macOS/CmuxSettings/..., Sources/KeyboardShortcutSettingsFileStore*, Sources/CmuxSettingsJSONPathSupport.swift, web/data/cmux.schema.json, web/messages/*
Defines the 1–50 range and default of 12, parses and validates JSON values, persists valid values, and adds schema, template, supported-path, and documentation entries.
Expose the setting in sidebar settings
Packages/macOS/CmuxSettingsUI/..., Resources/Localizable.xcstrings, Sources/SettingsNavigation.swift
Adds observable sidebar state, a bounded Stepper row, localized text, search and anchor mappings, and row-path coverage.
Compute and render bounded subtitles
Sources/ContentView.swift
Selects the effective subtitle, applies the configured line and character limits, and renders notification previews with dynamic vertical sizing.
Validate settings contracts
Packages/macOS/CmuxSettings/Tests/..., Packages/macOS/CmuxSettingsUI/Tests/...
Verifies the default value, persistence round trip, and settings-row path reachability for the new setting.

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

Sequence Diagram(s)

sequenceDiagram
  participant SettingsUI
  participant SettingsStore
  participant ContentView
  SettingsUI->>SettingsStore: update notificationMessageLineLimit
  SettingsStore->>ContentView: provide persisted setting
  ContentView->>ContentView: clamp limit and select subtitle
  ContentView->>SettingsUI: render bounded notification preview
Loading

Important

Pre-merge checks failed

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

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Cmux Full Internationalization ❌ Error The new web/docs key exists only in web/messages/en.json and ja.json; 18 locales in web/i18n/routing.ts are missing it. Add matching translations for docs.configuration.schemaDescriptions.sidebar.notificationMessageLineLimit in every locale file under web/messages/.
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 (23 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed New code stays within @MainActor SwiftUI types or plain value/catalog code; no new implicit MainActor model, protocol, or background UI-store isolation issue appears.
Cmux Swift Blocking Runtime ✅ Passed Diff only adds a line-limit range and DefaultsKey; no new waits, sleeps, syncs, semaphores, or locks were introduced.
Cmux Browser Automation Off-Main ✅ Passed HEAD only changes SidebarCatalogSection.swift; the browser-automation rule targets TerminalController.swift and ControlCommandExecutionPolicy.swift, which are untouched, so routing is unaffected.
Cmux Expensive Synchronous Load ✅ Passed Touched code only adds sidebar setting wiring/UI and line-limit shaping; no new RestorableAgentSessionIndex.load, transcript/jsonl scan, or other heavy sync load on main/interactive paths.
Cmux Cache Substitution Correctness ✅ Passed No persistence/history/undo snapshot path swapped in a stale cache; the settings client is stateless and DefaultsValueModel refreshes on UserDefaults changes.
Cmux No Hacky Sleeps ✅ Passed PASS — The touched code is a Swift settings catalog file only; no TS/JS/shell/build/runtime script changes or sleep/poll/timer patterns were introduced.
Cmux Algorithmic Complexity ✅ Passed Changes only add bounded sidebar preview shaping (4096-char cap, 1–50 line range) and static settings entries; no new scalable nested scans or repeated sorts were introduced.
Cmux Swift Concurrency ✅ Passed No new legacy async patterns were introduced; the patch only adds settings/UI/data plumbing and leaves existing Task/DispatchQueue/Combine usage unchanged.
Cmux Swift @Concurrent ✅ Passed The only Swift diff adds sidebar defaults/constants; it introduces no async work, actor isolation, or @concurrent misuse.
Cmux Swift File And Package Boundaries ✅ Passed PASS: The PR adds a small new UI row and setting key, with only tiny glue edits to huge existing app files; no new oversized file or mixed-responsibility expansion.
Cmux Swiftpm Lockfiles ✅ Passed PR changes touch only source/UI/docs; no cmux-owned .gitignore, Package.swift, package-reference, or Package.resolved files changed.
Cmux Swift Logging ✅ Passed The diff only adds sidebar constants; no print/debugPrint/dump/NSLog or Logger changes appear in the changed hunk.
Cmux User-Facing Error Privacy ✅ Passed The diff only adds sidebar notification-preview settings, schema, and localization copy; no user-facing errors, alerts, or raw provider/internal details were introduced.
Cmux Swiftui State Layout ✅ Passed No new ObservableObject/@published or GeometryReader patterns; the new settings row uses existing @State DefaultsValueModel, and the workspace subtitle stays snapshot-based with no render-time writes.
Cmux Architecture Rethink ✅ Passed The new line-limit setting is threaded through the existing catalog/store/snapshot path; no new timing hacks, observers, or duplicate state owners were introduced.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PR only adds sidebar settings keys/range; no NSWindow/NSPanel/WindowGroup changes or cmuxAuxiliaryWindowIdentifiers touch, so the window rule doesn't apply.
Cmux Source Artifacts ✅ Passed All changed paths are intentional source, test, config, or localization files; none match the rule’s artifact or scratch-directory patterns.
Cmux No Test Or Debug Seam In Production Source ✅ Passed PR adds a real Sidebar preview setting/UI; no new test/debug-only accessors or #if DEBUG seams appear in production diffs, only legitimate internal access for the new extension.
Cmux No Ambient Global State ✅ Passed PR only adds instance state and a static let constant inside existing owning types; no new top-level API, mutable global var, or singleton was introduced.
Title check ✅ Passed The title clearly summarizes the main change: increasing sidebar notification preview content.
Description check ✅ Passed The description is mostly complete and matches the template's core sections, though the demo video and checklist sections are missing.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task-expand-sidebar-notification-content

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.

@greptile-apps

greptile-apps Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds configurable notification preview length to the workspace sidebar. The main changes are:

  • A 1–50 line setting with a default of 12.
  • Settings UI, UserDefaults, and cmux.json integration.
  • Bounded subtitle rendering for lazy sidebar rows.
  • Schema documentation and localized app and web copy.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
Sources/ContentView.swift Applies the clamped preview limit and bounds notification text before rendering sidebar rows.
Sources/KeyboardShortcutSettingsFileStore.swift Parses the new configuration value within the shared supported range.
Packages/macOS/CmuxSettings/Sources/CmuxSettings/Keys/SidebarCatalogSection.swift Defines the setting key, default value, and supported range.
Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/SidebarSection+NotificationPreview.swift Adds the range-constrained notification preview Stepper.
web/data/cmux.schema.json Documents and validates the new configuration field.
Resources/Localizable.xcstrings Adds English and Japanese copy for the new Settings control.

Reviews (9): Last reviewed commit: "Label notification preview line stepper" | Re-trigger Greptile

@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
`@Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/SidebarSection.swift`:
- Around line 13-20: The non-private `@State` properties in SidebarSection
conflict with SwiftLint’s private_swiftui_state rule. Keep state private in
SidebarSection and update the SidebarSection+NotificationPreview row builder to
receive the required values as parameters, preserving the existing notification
preview behavior.

In `@web/data/cmux.schema.json`:
- Around line 989-995: Add a stable descriptionKey of
schemaDescriptions.sidebar.notificationMessageLineLimit to the
notificationMessageLineLimit schema entry, then add matching English and
Japanese translations to the schema-description catalogs in web/messages/en.json
and web/messages/ja.json. Keep the existing description and schema behavior
unchanged, and do not modify Resources/Localizable.xcstrings.
🪄 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

Run ID: 8b332aba-643a-4ab5-bb9e-98891888e8ea

📥 Commits

Reviewing files that changed from the base of the PR and between bee53cc and 9f3cbd2.

📒 Files selected for processing (13)
  • Packages/macOS/CmuxSettings/Sources/CmuxSettings/Keys/SidebarCatalogSection.swift
  • Packages/macOS/CmuxSettings/Tests/CmuxSettingsTests/UserDefaultsSettingsClientTests.swift
  • Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Navigation/CuratedSettingEntry+Default.swift
  • Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/SidebarSection+NotificationPreview.swift
  • Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/SidebarSection.swift
  • Packages/macOS/CmuxSettingsUI/Tests/CmuxSettingsUITests/SettingsRowAnchorResolutionTests.swift
  • Resources/Localizable.xcstrings
  • Sources/CmuxSettingsJSONPathSupport.swift
  • Sources/ContentView.swift
  • Sources/KeyboardShortcutSettingsFileStore+Template.swift
  • Sources/KeyboardShortcutSettingsFileStore.swift
  • Sources/SettingsNavigation.swift
  • web/data/cmux.schema.json

Comment on lines +13 to +20
@State var hideAll: DefaultsValueModel<Bool>
@State private var wrapTitles: DefaultsValueModel<Bool>
@State private var showDesc: DefaultsValueModel<Bool>
@State private var branchVerticalLayout: DefaultsValueModel<Bool>
@State private var stackBranchDir: DefaultsValueModel<Bool>
@State private var pathLastOnly: DefaultsValueModel<Bool>
@State private var showNotification: DefaultsValueModel<Bool>
@State var showNotification: DefaultsValueModel<Bool>
@State var notificationMessageLineLimit: DefaultsValueModel<Int>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

SwiftLint private_swiftui_state warnings on non-private @State properties.

Lines 13, 19, and 20 dropped private from @State to allow access from the SidebarSection+NotificationPreview extension. This follows the established pattern already present at lines 31–33 (showAgentActivity, loadingSpinnerPosition, notificationBadgePosition). The trade-off is acceptable given the extension-based row extraction, but consider whether these properties could instead be passed as parameters to the row builder to keep @State private.

🧰 Tools
🪛 SwiftLint (0.65.0)

[Warning] 13-13: SwiftUI state properties should be private

(private_swiftui_state)


[Warning] 19-19: SwiftUI state properties should be private

(private_swiftui_state)


[Warning] 20-20: SwiftUI state properties should be private

(private_swiftui_state)

🤖 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
`@Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/SidebarSection.swift`
around lines 13 - 20, The non-private `@State` properties in SidebarSection
conflict with SwiftLint’s private_swiftui_state rule. Keep state private in
SidebarSection and update the SidebarSection+NotificationPreview row builder to
receive the required values as parameters, preserving the existing notification
preview behavior.

Source: Linters/SAST tools

Comment thread web/data/cmux.schema.json
@cursor

cursor Bot commented Jul 13, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@lawrencecchen
lawrencecchen merged commit e8c6ca9 into main Jul 13, 2026
34 checks passed
@lawrencecchen
lawrencecchen deleted the task-expand-sidebar-notification-content branch July 13, 2026 12:57
hhsw2015 pushed a commit to hhsw2015/cmux that referenced this pull request Jul 16, 2026
* Show more notification body content

* Expand inline notification previews

* Keep notification preview change within file budget

* Test notification preview line setting

* Make notification preview lines configurable

* Fix notification preview review gates

* Document notification preview settings API

* Test notification schema locale coverage

* Localize notification schema description

* Label notification preview line stepper

(cherry picked from commit e8c6ca9)
@lawrencecchen
lawrencecchen restored the task-expand-sidebar-notification-content branch July 18, 2026 10:25

This branch was successfully deployed

1 active deployment
Preview – cmux — 6db58277 Deployed Jul 13, 2026 by vercel[bot]
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.

1 participant