Skip to content

Remove terminal scrollbar workspace menu - #5072

Merged
lawrencecchen merged 5 commits into
mainfrom
feat-remove-scrollbar-context-menu
Jun 1, 2026
Merged

lawrencecchen merged 5 commits into
mainfrom
feat-remove-scrollbar-context-menu

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

Removes the Workspace Settings submenu from the workspace context menu so the terminal scroll bar is controlled from Settings instead. Also updates the Settings subtitle to avoid advertising a per-workspace menu action that no longer exists.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.


Note

Low Risk
UI and copy cleanup around a deprecated per-workspace preference; global terminal settings still govern scroll bars.

Overview
Removes per-workspace terminal scroll bar control from the sidebar: the Workspace Settings context submenu and its toggle are gone, along with the sidebar state, notifications, and GhosttyTerminalView logic that reacted to workspace overrides.

Scroll bar visibility is now driven only by global Settings (terminal.showScrollBar / TerminalScrollBarSettings); the on-state subtitle no longer mentions disabling it per workspace. Workspace.terminalScrollBarHidden stays in memory for legacy helpers/tests but is no longer persisted, observed in the sidebar, or applied when rendering.

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


Summary by cubic

Removed the Workspace Settings submenu and the per-workspace terminal scroll bar override. Scroll bar visibility now follows only Settings; legacy per-workspace state remains in-memory for compatibility but is ignored.

  • Refactors
    • Deleted context-menu UI and related observers/handlers in ContentView and GhosttyTerminalView.
    • Stopped persisting and hashing terminalScrollBarHidden; kept the property as a documented no-op and removed sidebar observation.
    • Removed localization keys for the submenu and updated Settings copy in TerminalSection.swift and cmuxApp.swift.

Written for commit a79b543. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Changes
    • Updated terminal scroll bar description text in English and Japanese to remove the per-workspace clause.
    • Terminal scroll bar is now controlled only by global/settings options; per-workspace overrides and session persistence for that setting were removed.
    • UI adjustments: context-menu entry for workspace scrollbar toggle removed and sidebar/context-menu behavior simplified.

@vercel

vercel Bot commented Jun 1, 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 Jun 1, 2026 3:57am
cmux-staging Building Building Preview, Comment Jun 1, 2026 3:57am

@coderabbitai

coderabbitai Bot commented Jun 1, 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

This PR removes per-workspace terminal scrollbar overrides: localization and Settings UI text updated, Workspace no longer stores/persists per-workspace scrollbar-hidden state, Ghostty now consults only global settings, ContentView/context-menu plumbing and observers were removed, and TabManager no longer fingerprints per-workspace scrollbar state.

Changes

Terminal Scroll Bar Setting Removal

Layer / File(s) Summary
Localization and Settings UI text
Resources/Localizable.xcstrings, Packages/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/TerminalSection.swift, Sources/cmuxApp.swift
Localized strings and Settings UI subtitle were edited (English and Japanese) to remove the clause that the terminal scroll bar can be disabled per workspace.
Workspace model & session persistence cleanup
Sources/Workspace.swift
terminalScrollBarHidden is no longer serialized into session snapshots, not restored from snapshots, sidebar observation wiring for that state was removed, and a comment notes legacy in-memory state.
Remove terminalScrollBarHidden from TabManager fingerprinting
Sources/TabManager.swift
sessionAutosaveFingerprint(...) no longer includes workspace.terminalScrollBarHidden in its hash inputs.
Ghostty terminal scrollbar visibility refactor
Sources/GhosttyTerminalView.swift
Removed owning-workspace observer/caching and helper; scrollbar gating now checks global Ghostty prefs and TerminalScrollBarSettings.isVisible() only.
ContentView: render-context refactor and context-menu removal
Sources/ContentView.swift
Removed per-workspace scrollbar precomputation and invalidation; added @State to freeze modifier-key shortcut-hint visibility while a context menu is open; removed "Hide Terminal Scroll Bar" context-menu item and its handler; updated TabItemView stored props and Equatable conformance.

Sequence Diagram

sequenceDiagram
  participant ContentView
  participant Workspace
  participant GhosttySurfaceScrollView
  participant SessionManager

  ContentView->>Workspace: stops reading/writing terminalScrollBarHidden (context-menu removed)
  ContentView->>GhosttySurfaceScrollView: render without per-workspace scrollbar flag
  GhosttySurfaceScrollView->>GhosttySurfaceScrollView: terminalScrollBarAllowedBySettings() checks GhosttyApp.shared.scrollbarVisibility() and TerminalScrollBarSettings.isVisible()
  SessionManager->>Workspace: build session snapshot without terminalScrollBarHidden
  SessionManager->>GhosttySurfaceScrollView: restore UI without per-workspace scrollbar state
Loading

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly Related PRs

  • manaflow-ai/cmux#4865: Adds batch APIs/workflow for setting per-workspace terminalScrollBarHidden; relates to per-workspace scrollbar handling which this PR removes.

Poem

🐇 I nudge a key, the menu clears,
One scrollbar rule across the spheres.
No per-workspace twist to chase,
Global flow, a tidier place.
Hops of joy in simpler space.


Caution

Pre-merge checks failed

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

  • Ignore

❌ Failed checks (1 error, 2 warnings)

Check name Status Explanation Resolution
Cmux Full Internationalization ❌ Error Three modified scrollbar setting strings lack translations for 18 of 20 supported locales. Policy requires changed keys have complete translations across all existing locales. Add translations for missing 18 locales to the three modified scrollbar strings in Resources/Localizable.xcstrings.
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.
Description check ⚠️ Warning The PR description provides the high-level rationale and summary, but lacks Testing section, demo video, review trigger block, and completed checklist as specified in the template. Add Testing section with how changes were tested, include a demo video link if applicable, include the Review Trigger block, and complete the checklist with checkmarks or explanations.
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately captures the main change: removing the terminal scrollbar workspace menu/context-menu controls.
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 PR removes workspace scrollbar code (-58/-48 lines) with zero new type declarations, async patterns, or actor isolation violations; improves isolation by eliminating cross-boundary state observation.
Cmux Swift Blocking Runtime ✅ Passed PR removes workspace scrollbar observation and context menu code, eliminating blocking patterns not introducing them.
Cmux No Hacky Sleeps ✅ Passed All PR changes are to Swift files and localization resources. The check applies only to TypeScript, JavaScript, shell, and non-Swift scripts; Swift is covered separately.
Cmux Algorithmic Complexity ✅ Passed PR removes workspace scrollbar control code only. No new algorithmic complexity introduced; existing loops simplified with fewer operations per iteration.
Cmux Swift Concurrency ✅ Passed PR removes terminal scrollbar workspace controls with no new legacy async patterns introduced; changes are deletions and UI text updates only.
Cmux Swift @Concurrent ✅ Passed PR only removes workspace terminal scrollbar state/observers and updates UI strings; no new async functions, @concurrent attributes, or concurrency violations introduced.
Cmux Swift File And Package Boundaries ✅ Passed PR removes terminal scrollbar feature with net -107 lines from oversized files. All changes are removals; no new responsibilities or mixed code added to violate boundaries.
Cmux Swift Logging ✅ Passed PR removes terminal scrollbar UI controls with no new logging statements added; all changes are code removals or localization updates.
Cmux User-Facing Error Privacy ✅ Passed PR removes per-workspace terminal scroll bar control. All user-facing strings comply with privacy rules: no upstream vendors, credentials, database details, billing IDs, or raw error messages exposed.
Cmux Swiftui State Layout ✅ Passed New @State for hint freezing in parent; rows receive immutable snapshots and closures, mutations in event handlers only, TabItemView.equatable handles properly.
Cmux Architecture Rethink ✅ Passed PR removes 22 lines of observer infrastructure for workspace scrollbar notifications and eliminates state generation counters. Zero new problematic patterns introduced.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PR removes terminal scrollbar workspace menu without adding or materially changing any standalone NSWindow/NSPanel/WindowGroup. Lint script passes; no new window identifiers introduced.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-remove-scrollbar-context-menu

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 and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 84090a7192

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/ContentView.swift
}
}

Menu(String(localized: "contextMenu.workspaceColor", defaultValue: "Workspace 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.

P2 Badge Stop honoring stale per-workspace scrollbar flags

When the Workspace Settings menu is removed, users who previously hid the scrollbar for a workspace can no longer unhide it: Workspace still persists/restores terminalScrollBarHidden, and GhosttyTerminalView.terminalScrollBarAllowedBySettings() still returns false when that flag is true, regardless of the global Settings toggle. In that state, turning “Show Terminal Scroll Bar” back on in Settings does not restore the scrollbar for affected/restored workspaces, so this removal needs either a migration/reset path or the per-workspace flag should stop being applied.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in the follow-up commits: the sidebar context menu no longer exposes the per-workspace control, terminal rendering no longer reads the per-workspace flag, and session snapshots no longer write or restore that flag. Existing persisted hidden flags are ignored so the global Settings toggle controls the scrollbar again.

— Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Verified again on the rebased head a79b543: the removed context-menu path is gone, GhosttyTerminalView no longer reads Workspace.terminalScrollBarHidden, Workspace session snapshots no longer write or restore terminalScrollBarHidden, and the autosave fingerprint no longer includes it. Existing persisted hidden flags are ignored, so the global Settings toggle controls scrollbar visibility.

— Claude Code

@greptile-apps

greptile-apps Bot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR removes the per-workspace terminal scroll bar override — the "Workspace Settings" context menu, its toggle action, the observer/notification chain that propagated the setting to GhosttyTerminalView, and its session-snapshot persistence — so scroll bar visibility is now governed solely by the global Settings toggle. Localization is fully updated for both English and Japanese across Localizable.xcstrings, TerminalSection.swift, and cmuxApp.swift.

  • ContentView.swift: Drops the sidebar workspaceTerminalScrollBarHiddenById dictionary, the terminalScrollBarVisibilityGeneration bump-and-read, the NotificationCenter observer, and the entire "Workspace Settings" context menu subtree.
  • GhosttyTerminalView.swift: Removes the per-workspace observer machinery; terminalScrollBarAllowedBySettings() no longer checks the per-workspace flag.
  • Workspace.swift / TabManager.swift: Snapshot save/restore and the session hasher no longer include terminalScrollBarHidden; the sidebar observation signal is also removed.

Confidence Score: 5/5

Safe to merge — this is a straightforward feature removal with no new logic introduced, and every changed code path is simpler than what it replaces.

All changes are deletions or simplifications: the observer chain, context menu, snapshot fields, and hasher entry are cleanly removed. Localization is updated in both supported locales. The retained terminalScrollBarHidden property is correctly documented as a no-op kept for test compatibility.

No files require special attention.

Important Files Changed

Filename Overview
Sources/ContentView.swift Removes the Workspace Settings context menu, its sidebar state, the precomputed workspaceTerminalScrollBarHiddenById dictionary, and the NotificationCenter observer. TabItemView.Equatable is updated to match.
Sources/GhosttyTerminalView.swift Removes workspace-specific scroll-bar observer machinery. terminalScrollBarAllowedBySettings() no longer checks the per-workspace flag; visibility now follows only the global setting.
Sources/Workspace.swift terminalScrollBarHidden kept as documented legacy in-memory state; no longer written/read from session snapshots and no longer drives a sidebar observation signal.
Sources/TabManager.swift Removes workspace.terminalScrollBarHidden from the session-snapshot hasher.
Resources/Localizable.xcstrings Removes contextMenu.workspaceSettings and hideTerminalScrollBar keys (en+ja), updates settings.terminal.scrollBar.subtitleOn in both locales.
Packages/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/TerminalSection.swift Updates subtitleOn defaultValue to remove per-workspace clause; consistent with xcstrings update.
Sources/cmuxApp.swift Same subtitle string update as TerminalSection.swift for the parallel SettingsView.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User opens terminal] --> B[terminalScrollBarAllowedBySettings]
    B --> C{scrollbarVisibility == .never?}
    C -- yes --> D[Hide scroll bar]
    C -- no --> E{TerminalScrollBarSettings.isVisible?}
    E -- no --> D
    E -- yes --> F[Show scroll bar]
Loading

Reviews (4): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

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

No issues found across 4 files

Re-trigger cubic

@lawrencecchen
lawrencecchen merged commit fad8f13 into main Jun 1, 2026
21 checks passed
@lawrencecchen
lawrencecchen deleted the feat-remove-scrollbar-context-menu branch June 1, 2026 04:51

This branch was successfully deployed

1 active deployment
Preview – cmux — a79b5439 Deployed Jun 1, 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