Skip to content

Extract About Titlebar Debug subsystem from cmuxApp.swift into CmuxDebugWindowsUI - #6175

Closed
azooz2003-bit wants to merge 1 commit into
mainfrom
feat-debug-windows-extraction
Closed

azooz2003-bit wants to merge 1 commit into
mainfrom
feat-debug-windows-extraction

Conversation

@azooz2003-bit

@azooz2003-bit azooz2003-bit commented Jun 15, 2026 •

Copy link
Copy Markdown
Collaborator

Pulls the self-contained About-titlebar debug cluster out of the cmuxApp.swift god file into a new domain UI package, CmuxDebugWindowsUI, as a Coordinator plus value types, an @Observable store, an NSWindowController, and a SwiftUI view.

What moved (Sources/cmuxApp.swift -> Packages/CmuxDebugWindowsUI)

  • AboutWindowKind, TitlebarVisibilityOption, TitlebarToolbarStyleOption value enums
  • AboutTitlebarDebugOptions value type
  • AboutTitlebarDebugStore (was a singleton ObservableObject -> @MainActor @Observable, single writer of the options)
  • AboutTitlebarDebugWindowController (NSWindowController)
  • AboutTitlebarDebugView (SwiftUI editor)

New: DebugWindowsCoordinator (@MainActor @Observable) owns the store and lazily owns the window controller; WindowDecorating protocol seam. One major public type per file, DocC /// on every public symbol, swiftLanguageMode(.v6) + ExistentialAny/InternalImportsByDefault.

Seams (constructor-injected; every god-type reach inverted)

  • AppDelegate.shared?.applyWindowDecorations(to:) -> WindowDecorating protocol. AppDelegate conforms directly (it already exposes the matching method) and is injected into DebugWindowsCoordinator at the composition root. The coordinator and store hold the decorator weakly to avoid a retain cycle, since AppDelegate is the singleton that owns the coordinator.
  • The .shared singleton store/controller are gone; the app owns one coordinator on AppDelegate (debugWindowsCoordinator / aboutTitlebarDebugStore). The concrete conformer stays in the app target.

Byte-identical behavior

  • Window identifiers, titles, style-mask bits, toolbar identifier, min/max sizes, the copy-config payload text, and the didSet-driven reapply are preserved exactly. Every call site (Debug menu, openAllDebugWindows, DebugWindowControlsView, the About/Acknowledgments window controllers) is a thin forward to the app-owned coordinator/store, so the runtime sequence is unchanged.
  • applyToOpenWindows now guards a nil NSApp (no-op only in a headless unit-test process; NSApp is always present in the running app), which is what lets the store be unit-tested.

Tests

7 Swift-Testing behavior tests with a fake WindowDecorating: defaults are non-overriding, disabled overrides fall back to kind defaults, enabled overrides apply title/style-mask/visibility, empty title falls back, toolbar toggles, reset restores defaults, copy-config payload contains current values. swift build + swift test green in the package.

Stats

  • Est. lines removed from giant: 405 (cmuxApp.swift 4920 -> 4515).
  • AppDelegate.swift +11 for composition-root wiring; .github/swift-file-length-budget.tsv reconciled (cmuxApp ratcheted down, AppDelegate bumped).
  • scripts/lint-ios-package-conventions.sh -> OK, zero new lint:allow.

Left behind (intentional, not a clean leaf)

The #if DEBUG controllers still in cmuxApp.swift (SidebarDebug, MenuBarExtraDebug, BackgroundDebug, StartupAppearance, SplitButtonLayout, TabBarBackdropLab, BrowserProfilePopover/ImportHint, FileExplorerStyle, DebugWindowControls, DebugWindowConfigSnapshot) reach into many app-target settings/catalog/*Option types and Workspace/GhosttyApp statics across multiple files, so extracting them needs multi-file seam inversion beyond this PR. The About-titlebar cluster is the one fully self-contained, non-DEBUG leaf.

NOTE: the full app build is validated by CI; per refactor policy it was not run locally.

🤖 Generated with Claude Code


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


Summary by cubic

Extracted the About titlebar debug subsystem from Sources/cmuxApp.swift into a new package, CmuxDebugWindowsUI, to decouple it from the app and make it testable. Behavior is unchanged; existing debug menu actions and About/Acknowledgments windows work as before.

  • Refactors
    • Added CmuxDebugWindowsUI with DebugWindowsCoordinator, AboutTitlebarDebugStore (@MainActor @Observable), AboutTitlebarDebugWindowController, AboutTitlebarDebugView, and value types.
    • Introduced WindowDecorating protocol; AppDelegate conforms and is injected into the coordinator; references held weakly to avoid cycles.
    • Replaced previous singletons with app-owned instances on AppDelegate (debugWindowsCoordinator, aboutTitlebarDebugStore); updated call sites to forward to them.
    • Preserved window IDs, titles, style-mask bits, toolbar behavior, and didSet-driven reapply.
    • applyToOpenWindows now no-ops if NSApp is nil to enable unit tests.
    • Added 7 behavior tests; new package uses Swift 6 (swiftLanguageMode(.v6)) and enables ExistentialAny/InternalImportsByDefault.

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

Review in cubic

Summary by CodeRabbit

Release Notes

  • New Features

    • Added "About Titlebar Debug" window enabling users to test and configure window titlebar appearance settings, including title visibility, toolbar styles, and window decorations
    • Ability to copy debug configuration to clipboard for sharing settings
  • Tests

    • Added test coverage for debug window functionality

…bugWindowsUI

Pull the self-contained About-titlebar debug cluster out of the cmuxApp.swift
god file into a new domain UI package, CmuxDebugWindowsUI, as a Coordinator plus
value types, store, window controller, and SwiftUI view.

What moved (cmuxApp.swift -> Packages/CmuxDebugWindowsUI):
- AboutWindowKind, TitlebarVisibilityOption, TitlebarToolbarStyleOption value enums
- AboutTitlebarDebugOptions value type
- AboutTitlebarDebugStore (was a singleton ObservableObject -> @mainactor @observable)
- AboutTitlebarDebugWindowController (NSWindowController)
- AboutTitlebarDebugView (SwiftUI)
New: DebugWindowsCoordinator (@mainactor @observable) owns the store + lazily owns
the window controller; WindowDecorating protocol seam.

Seams (constructor-injected, god-type reaches inverted):
- AppDelegate.shared?.applyWindowDecorations(to:) -> WindowDecorating protocol.
  AppDelegate conforms directly (it already has the matching method) and is
  injected into DebugWindowsCoordinator at the composition root, held WEAKLY by
  the coordinator/store to avoid a retain cycle (AppDelegate is the singleton
  owner of the coordinator).
- The singleton .shared store/controller are replaced by app-owned instances on
  AppDelegate (debugWindowsCoordinator / aboutTitlebarDebugStore).

Byte-identical behavior:
- Window identifiers, titles, style-mask bits, toolbar identifiers, min/max
  sizes, copy-config payload text, and the didSet-driven reapply are preserved
  exactly. Call sites (Debug menu, openAllDebugWindows, DebugWindowControlsView,
  About/Acknowledgments window controllers) are thin forwards to the app-owned
  coordinator/store, so the runtime sequence is unchanged.
- applyToOpenWindows now guards a nil NSApp (no-op only in a headless test
  process; NSApp is always present in the running app), enabling unit tests.

Tests: 7 Testing-framework behavior tests with a fake WindowDecorating
(defaults, enabled/disabled overrides, empty-title fallback, toolbar toggle,
reset, copy-config payload).

Est lines removed from giant: 405 (cmuxApp.swift 4920 -> 4515). Budget reconciled
(cmuxApp ratcheted down; AppDelegate +11 for composition-root wiring).

Left behind (intentional, not a clean leaf): the #if DEBUG controllers still in
cmuxApp.swift (SidebarDebug, MenuBarExtraDebug, BackgroundDebug, StartupAppearance,
SplitButtonLayout, TabBarBackdropLab, BrowserProfilePopover/ImportHint,
FileExplorerStyle, DebugWindowControls, DebugWindowConfigSnapshot) reach into many
app-target settings/catalog/Option types and Workspace/GhosttyApp statics across
multiple files, so extracting them requires multi-file seam inversion beyond this
PR. The AboutTitlebar cluster is the one fully self-contained, non-DEBUG leaf.

NOTE: app build validated by CI (not run locally per refactor policy).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 15, 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 15, 2026 7:53pm
cmux-staging Building Building Preview, Comment Jun 15, 2026 7:53pm

@coderabbitai

coderabbitai Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

A new local Swift package CmuxDebugWindowsUI is created to hold the About Titlebar Debug subsystem. Value types, a WindowDecorating seam protocol, an observable store, a SwiftUI view, an NSWindowController, and a DebugWindowsCoordinator are added in the package. The ~412 lines of inline implementation are removed from cmuxApp.swift, all call sites are rerouted through AppDelegate.debugWindowsCoordinator, and AppDelegate conforms to WindowDecorating.

Changes

CmuxDebugWindowsUI Package Extraction

Layer / File(s) Summary
Package manifest, seam protocol, and value types
Packages/CmuxDebugWindowsUI/Package.swift, Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Seams/WindowDecorating.swift, Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Values/AboutWindowKind.swift, Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Values/AboutTitlebarDebugOptions.swift, Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Values/TitlebarVisibilityOption.swift, Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Values/TitlebarToolbarStyleOption.swift
Package.swift declares the Swift 6 / macOS 14 library; WindowDecorating protocol requires applyWindowDecorations(to:); AboutWindowKind, AboutTitlebarDebugOptions, TitlebarVisibilityOption, and TitlebarToolbarStyleOption define the data contract for all titlebar override settings.
AboutTitlebarDebugStore
Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Stores/AboutTitlebarDebugStore.swift
Observable MainActor store managing per-kind options with update/reset/applyToOpenWindows/applyCurrentOptions APIs; private apply(_:to:for:) drives all NSWindow mutations (title, visibility, toolbar, style-mask bits, sizing, shadow); copyConfigToPasteboard() serializes the current state.
SwiftUI view, NSWindowController, and coordinator
Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Views/AboutTitlebarDebugView.swift, Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Windows/AboutTitlebarDebugWindowController.swift, Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Coordinator/DebugWindowsCoordinator.swift
AboutTitlebarDebugView provides the full SwiftUI editor with store-backed bindings; AboutTitlebarDebugWindowController creates an NSPanel hosting the view with decorator applied; DebugWindowsCoordinator lazily instantiates and reuses the controller on showAboutTitlebarDebugWindow().
App integration and Xcode project wiring
Sources/AppDelegate.swift, Sources/cmuxApp.swift, cmux.xcodeproj/project.pbxproj
AppDelegate gains debugWindowsCoordinator/aboutTitlebarDebugStore and conforms to WindowDecorating; cmuxApp.swift removes 412 lines of inline implementation and routes all four call sites through the coordinator; project.pbxproj links the local package product.
Store tests
Packages/CmuxDebugWindowsUI/Tests/CmuxDebugWindowsUITests/AboutTitlebarDebugStoreTests.swift
Tests cover default/non-overriding behavior, override-enabled application, whitespace-title fallback to fallbackTitle, toolbar toggle, reset, and pasteboard payload content using a FakeWindowDecorator test double.

Sequence Diagram(s)

sequenceDiagram
  participant DebugMenu as Debug Menu / DebugWindowControlsView
  participant AppDelegate
  participant DebugWindowsCoordinator
  participant AboutTitlebarDebugWindowController
  participant AboutTitlebarDebugStore
  participant NSWindow as About NSWindow

  DebugMenu->>AppDelegate: shared?.debugWindowsCoordinator.showAboutTitlebarDebugWindow()
  AppDelegate->>DebugWindowsCoordinator: showAboutTitlebarDebugWindow()
  alt first call
    DebugWindowsCoordinator->>AboutTitlebarDebugWindowController: init(store:, decorator: AppDelegate)
    AboutTitlebarDebugWindowController->>AppDelegate: applyWindowDecorations(to: panel)
  end
  DebugWindowsCoordinator->>AboutTitlebarDebugWindowController: show()
  AboutTitlebarDebugWindowController->>AboutTitlebarDebugStore: applyToOpenWindows()
  AboutTitlebarDebugStore->>NSWindow: apply options (title, styleMask, toolbar, sizing, shadow)

  Note over AppDelegate,NSWindow: AboutWindowController.show() path
  AppDelegate->>AboutTitlebarDebugStore: applyCurrentOptions(to: window, for: .about)
  AboutTitlebarDebugStore->>NSWindow: apply options on newly shown About window
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐇 A package was born from a tangled old file,
The titlebar store hopped away with great style.
The coordinator leaps, the seam protocol bounds,
Four hundred removed lines — what glorious grounds!
Now cleanly extracted, each type in its place,
This rabbit approves of the newly made space. ✨


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 PR introduces user-facing Swift UI text in 6 files without localizing to all 20 supported locales (en, ja, de, es, fr, it, ko, uk, zh-Hans, zh-Hant, ar, bs, da, nb, pl, pt-BR, ru, th, tr, km). Wrap all bare English strings in AboutWindowKind, TitlebarVisibilityOption, TitlebarToolbarStyleOption, AboutTitlebarDebugOptions, and AboutTitlebarDebugView with String(localized:defaultValue:) and add matching entries to Resources/Loca...
Cmux Source Artifacts ❌ Error 28 source control artifacts added: .claude/scheduled_tasks.lock (runtime state), .claude/skills/* symlinks (21), .agents/skills symlink, plus .claude/commands, .coderabbit.yaml, .vercelignore—none... Remove .claude/, .agents/, .coderabbit.yaml, .vercelignore from the commit; add narrow .gitignore entries for tool metadata like .claude/ and .agents/ if not already present.
Docstring Coverage ⚠️ Warning Docstring coverage is 41.94% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (18 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main refactoring: extracting the About Titlebar Debug subsystem from cmuxApp.swift into a new CmuxDebugWindowsUI package.
Description check ✅ Passed The description is comprehensive and addresses all template sections: what changed, why (moving to a separate package for decoupling and testability), testing approach (7 behavior tests included), and checklist completion.
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 All value types are correctly Sendable; both observable stores have explicit @MainActor isolation; the seam protocol is @MainActor; weak references prevent retain cycles. The WindowController lacks...
Cmux Swift Blocking Runtime ✅ Passed No blocking or timing-based synchronization patterns introduced. PR uses @MainActor/@observable for thread-safe coordination instead of semaphores, locks, sleeps, or polling.
Cmux Expensive Synchronous Load ✅ Passed No expensive synchronous loads added to main actor or interactive paths; all operations are lightweight window property modifications, string trimming, and UI updates without file I/O, network, or...
Cmux Cache Substitution Correctness ✅ Passed AboutTitlebarDebugStore is transient debug UI state, initialized with fresh hardcoded defaults, never persisted to UserDefaults/disk, with no load/save mechanisms. Not a cache substitution issue.
Cmux No Hacky Sleeps ✅ Passed PR contains only Swift code and Xcode project config; the rule explicitly states Swift timing primitives are covered by a different rule, so this rule does not apply.
Cmux Algorithmic Complexity ✅ Passed PR extracts About-titlebar debug code from cmuxApp.swift into CmuxDebugWindowsUI package with byte-identical behavior. Single loop iterates NSApp.windows (fixed-size ~1-10), all other collections a...
Cmux Swift Concurrency ✅ Passed PR introduces no legacy async patterns. New CmuxDebugWindowsUI package uses @MainActor/@observable (Swift 6 modern), no DispatchQueue/Combine/completion-handlers/fire-and-forget-Tasks. WindowDecora...
Cmux Swift @Concurrent ✅ Passed No async/await functions or @concurrent violations found in the PR. All new types (DebugWindowsCoordinator, AboutTitlebarDebugStore, WindowDecorating protocol, AboutTitlebarDebugWindowController, A...
Cmux Swift File And Package Boundaries ✅ Passed PR extracts self-contained About-titlebar debug subsystem (650 production lines) into focused CmuxDebugWindowsUI package with clear responsibilities per file, shrinks cmuxApp.swift by 405 lines (>2...
Cmux Swift Logging ✅ Passed PR adds zero new logging violations. All 11 new package files and modified AppDelegate.swift contain no print, debugPrint, dump, NSLog, or Logger calls. The NSLog in cmuxApp.swift is pre-existing c...
Cmux User-Facing Error Privacy ✅ Passed The PR adds debug UI code that contains no user-facing error messages or alerts with privacy violations. All strings reference only the "cmux" product name and standard macOS window properties; no...
Cmux Swiftui State Layout ✅ Passed PR introduces modern @Observable state management (DebugWindowsCoordinator, AboutTitlebarDebugStore) without legacy ObservableObject/@Published/@StateObject/@EnvironmentObject patterns. AboutTitleb...
Cmux Architecture Rethink ✅ Passed PR introduces proper ownership hierarchy with clear single writer (AboutTitlebarDebugStore), no timing/blocking patterns, single entry point through lazy AppDelegate property, and safe weak referen...
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed NSPanel window in AboutTitlebarDebugWindowController has stable identifier "cmux.aboutTitlebarDebug" properly registered in cmuxAuxiliaryWindowIdentifiers, enabling standard close-shortcut ownershi...
✨ 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-debug-windows-extraction

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.

@greptile-apps

greptile-apps Bot commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

Extracts the About Titlebar Debug cluster from cmuxApp.swift into a new CmuxDebugWindowsUI SwiftPM package, removing ~405 lines from the god file. The refactor replaces a ObservableObject/@Published singleton with a @MainActor @Observable store, inverts the AppDelegate.shared singleton reach into a constructor-injected WindowDecorating protocol seam, and ships 7 behavior tests covering the store's full public API.

  • Architecture: DebugWindowsCoordinator owns the AboutTitlebarDebugStore and lazily creates AboutTitlebarDebugWindowController; AppDelegate conforms to WindowDecorating and is injected at the composition root, eliminating all global singleton access from the package.
  • Package hygiene: Swift 6 language mode, ExistentialAny, and InternalImportsByDefault are enabled; public import re-exports AppKit/SwiftUI correctly for a UI-only package.
  • Call-site forwarding: Every AboutTitlebarDebugWindowController.shared.show() and AboutTitlebarDebugStore.shared.* call is replaced with coordinator/store forwarding via AppDelegate.shared?, which silently no-ops when AppDelegate.shared is nil — a minor behavioral change from the unconditional singleton calls in AboutWindowController.

Confidence Score: 4/5

Clean extraction with no functional regressions for the normal running app; a few small rough edges in the view-observation pattern and localization wiring are worth a follow-up but do not block the refactor.

The refactor is well-structured: singleton reach is fully inverted, the store is correctly migrated to @observable with working didSet behaviour, and the test suite validates the core store contracts. Three issues are worth attention: AboutWindowController now silently skips applyCurrentOptions if AppDelegate.shared is ever nil, contradicting the byte-identical-behaviour claim; AboutTitlebarDebugView holds the store as private let without @bindable, so SwiftUI observation of most store properties is delegated entirely to child-view render passes rather than anchored at this view boundary; and the two String(localized:) calls inside the package have an implicit main-bundle dependency with no package-local catalog. None of these cause visible bugs in the running app today.

Sources/cmuxApp.swift (AboutWindowController call sites), Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Views/AboutTitlebarDebugView.swift, Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Windows/AboutTitlebarDebugWindowController.swift

Important Files Changed

Filename Overview
Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Coordinator/DebugWindowsCoordinator.swift New @mainactor @observable coordinator owning the store and lazy window controller; clean single-responsibility, 49 lines, correct weak-reference pattern for AppDelegate seam.
Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Stores/AboutTitlebarDebugStore.swift Core store migrated from ObservableObject/@published to @observable; didSet pattern preserved, NSApp nil-guard added for unit-test headless contexts, decorator seam cleanly injected.
Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Views/AboutTitlebarDebugView.swift Migrated to @observable store held as private let; manual Binding construction leaves most store properties untracked at this view boundary, making observation coverage fragile for conditionally rendered children.
Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Windows/AboutTitlebarDebugWindowController.swift New public NSWindowController with injected store and decorator; String(localized:) calls without bundle: parameter implicitly depend on the main app bundle rather than a package-local catalog.
Sources/cmuxApp.swift 405-line reduction; three AboutTitlebarDebugWindowController.shared call sites replaced with coordinator forwarding, but AboutWindowController now uses optional chaining that silently skips applyCurrentOptions when AppDelegate.shared is nil.
Sources/AppDelegate.swift Adds composition-root lazy vars and WindowDecorating conformance extension; +11 lines, budget updated correctly.
Packages/CmuxDebugWindowsUI/Package.swift Well-formed Swift 6 package with ExistentialAny and InternalImportsByDefault; missing defaultLocalization and Resources target given the localized strings used in the library.
Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Seams/WindowDecorating.swift Clean @mainactor protocol seam inverting the AppDelegate.shared reach; correct AnyObject constraint for weak-reference storage.
Packages/CmuxDebugWindowsUI/Tests/CmuxDebugWindowsUITests/AboutTitlebarDebugStoreTests.swift 7 @mainactor Swift Testing tests with a fake WindowDecorator covering defaults, override toggle, empty-title fallback, toolbar toggle, reset, and copy-config payload.
.github/swift-file-length-budget.tsv Budget correctly ratcheted: cmuxApp.swift reduced 4920→4515, AppDelegate.swift bumped 17778→17789.

Sequence Diagram

sequenceDiagram
    participant AM as AppDelegate (composition root)
    participant DC as DebugWindowsCoordinator
    participant ST as AboutTitlebarDebugStore
    participant WC as AboutTitlebarDebugWindowController
    participant AW as AboutWindowController
    participant WD as WindowDecorating (AppDelegate)

    AM->>DC: init(decorator: self)
    DC->>ST: init(decorator: decorator)

    Note over AM,WD: Debug menu / Open All action
    AM->>DC: showAboutTitlebarDebugWindow()
    DC->>WC: init(store:, decorator:) [lazy, first call only]
    WC->>WD: applyWindowDecorations(to: panel)
    DC->>WC: show()
    WC->>ST: applyToOpenWindows()
    ST->>WD: decorator?.applyWindowDecorations(to: window)

    Note over AM,WD: About window opens
    AW->>ST: applyCurrentOptions(to: window, for: .about)
    ST->>WD: decorator?.applyWindowDecorations(to: window)

    Note over AM,WD: User edits options in debug panel
    AM->>ST: "aboutOptions = newValue (via Binding)"
    ST-->>ST: didSet → applyToOpenWindows(for: .about)
    ST->>WD: decorator?.applyWindowDecorations(to: window)
Loading

Comments Outside Diff (2)

  1. Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Windows/AboutTitlebarDebugWindowController.swift, line 738-741 (link)

    P2 Localization keys look up the main app bundle, not the package bundle

    String(localized:defaultValue:) without a bundle: argument resolves against Bundle.main at runtime. That works today because these two keys (debug.aboutTitlebarDebug.title, debug.aboutTitlebarDebug.resetAbout) already exist in the main app's Localizable.xcstrings. However, Package.swift declares no defaultLocalization and no Resources/ target, so the package cannot carry its own string catalog. If the package is ever instantiated outside the main app (Xcode preview, standalone Swift test, future reuse), lookups silently fall through to defaultValue. Passing bundle: .main explicitly would document the dependency; adding a Resources/Localizable.xcstrings to the package target would make it self-contained.

  2. Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Views/AboutTitlebarDebugView.swift, line 584-592 (link)

    P2 @Observable store not observed via @Bindable; observation coverage relies on wrappedValue side-access

    store is a private let reference. SwiftUI's @Observable tracking requires at least one store.property access to happen during the view's own body sweep (not only inside child-view closures) for this view to register an invalidation subscription. The view achieves this only because overridesEnabled.wrappedValue is called inline in .disabled(...) and .opacity(...). All other bindings (title, visibility, style mask bits) are passed as Binding values whose get closures are never called during AboutTitlebarDebugView.body itself — observation of those fields is registered only by the SwiftUI Toggle/TextField/Picker children. If any of those child views are conditionally hidden or lazily rendered, their observation registrations may be dropped, making the parent view stale. The idiomatic and safer pattern is @Bindable var store: AboutTitlebarDebugStore (requires var), which lets the view construct typed bindings directly and ensures SwiftUI fully tracks the store's observable surface at this view's boundary.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Reviews (1): Last reviewed commit: "Extract About Titlebar Debug subsystem f..." | 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: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Sources/cmuxApp.swift (1)

2247-2260: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Apply the titlebar-debug store to the Licenses window too.

Only the About controller now applies the app-owned store. If a user changes the Acknowledgments/Licenses titlebar options before opening that window, AcknowledgmentsWindowController is created and shown without applying the moved debug state, so this no longer preserves the previous About/Acknowledgments behavior.

Proposed fix
         window.identifier = NSUserInterfaceItemIdentifier("cmux.licenses")
         window.center()
         window.contentView = NSHostingView(rootView: AcknowledgmentsView())
+        AppDelegate.shared?.aboutTitlebarDebugStore.applyCurrentOptions(to: window, for: .acknowledgments)
         super.init(window: window)
         window.delegate = self
@@
     func show() {
         guard let window else { return }
+        AppDelegate.shared?.aboutTitlebarDebugStore.applyCurrentOptions(to: window, for: .acknowledgments)
         window.makeKeyAndOrderFront(nil)
     }

This is based on the stated PR objective that the About/Acknowledgments window controllers should forward to the app-owned store.

Also applies to: 2280-2292

🤖 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 `@Sources/cmuxApp.swift` around lines 2247 - 2260, The titlebar-debug store is
only applied to the About window controller but not to the
AcknowledgmentsWindowController. In the AcknowledgmentsWindowController's
initialization and show methods (which correspond to the code at lines
2280-2292), apply the titlebar debug store using the same pattern as the About
controller: call
AppDelegate.shared?.aboutTitlebarDebugStore.applyCurrentOptions(to: window, for:
.about) after creating the window and in the show method to ensure that any
titlebar options changed by the user are preserved when the
Acknowledgments/Licenses window is opened.
🤖 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/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Values/AboutTitlebarDebugOptions.swift`:
- Around line 69-87: The windowTitle field in the defaults(for kind:) method
contains a bare English string "About cmux" that should be localized. Replace
the plain string literal with String(localized:defaultValue:) wrapper, using
"About cmux" as both the localization key and the default value, and ensure a
corresponding entry is added to Resources/Localizable.xcstrings to support
internationalization.

In
`@Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Values/AboutWindowKind.swift`:
- Around line 36-41: The fallbackTitle property in the AboutWindowKind enum
returns a bare English string "About cmux" without localization. Replace this
string with a localized version using String(localized:defaultValue:) where the
defaultValue parameter contains the current English text, and ensure a matching
entry exists in Resources/Localizable.xcstrings for the key to be used in the
localized call.
- Around line 19-24: The displayTitle property in the about case returns a
hard-coded English string that should be localized. Wrap the string "About
Window" with String(localized:defaultValue:) to enable localization, then add
corresponding translation entries in Resources/Localizable.xcstrings for all
supported locales. This ensures the debug UI string respects the app's
localization settings rather than displaying only in English.

In
`@Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Values/TitlebarToolbarStyleOption.swift`:
- Around line 23-36: The displayTitle property in TitlebarToolbarStyleOption
returns bare English strings that are user-facing. Wrap each string return value
("Automatic", "Expanded", "Preference", "Unified", "Unified Compact") with
String(localized:defaultValue:) where the defaultValue parameter contains the
current English text. Then add corresponding localization entries for each key
in Resources/Localizable.xcstrings to enable multi-language support.

In
`@Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Values/TitlebarVisibilityOption.swift`:
- Around line 17-24: The displayTitle property in TitlebarVisibilityOption
returns hardcoded English strings that are visible to users in the SwiftUI
Picker and must be localized according to coding guidelines. Replace each
hardcoded string return value ("Hidden" and "Visible") with
String(localized:defaultValue:) calls, providing the English string as the
defaultValue parameter. Additionally, add corresponding entries for these
localization keys in the Resources/Localizable.xcstrings file to ensure
translations can be provided for different languages.

In
`@Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Views/AboutTitlebarDebugView.swift`:
- Around line 27-107: The editor(for kind: AboutWindowKind) function and the
Actions GroupBox contain multiple hardcoded English user-facing strings that are
not localized, including "Actions", "Reset All", "Reapply to Open Windows",
"Copy Config", "Enable Debug Overrides", "When disabled, cmux uses normal
default titlebar behavior for this window.", "Window Title", "Title Visibility",
"Toolbar Style", "Show Toolbar", "Transparent Titlebar", "Movable by Window
Background", "Style Mask", "Titled", "Closable", "Miniaturizable", "Resizable",
"Full Size Content View", and "Apply Now". Replace each hardcoded string with
String(localized:) or use the Text(_:) initializer with corresponding
localization keys (for example, "debug.actions", "debug.resetAll", etc.), then
add all these localization keys with their English and translated values to
Resources/Localizable.xcstrings for all supported locales.

---

Outside diff comments:
In `@Sources/cmuxApp.swift`:
- Around line 2247-2260: The titlebar-debug store is only applied to the About
window controller but not to the AcknowledgmentsWindowController. In the
AcknowledgmentsWindowController's initialization and show methods (which
correspond to the code at lines 2280-2292), apply the titlebar debug store using
the same pattern as the About controller: call
AppDelegate.shared?.aboutTitlebarDebugStore.applyCurrentOptions(to: window, for:
.about) after creating the window and in the show method to ensure that any
titlebar options changed by the user are preserved when the
Acknowledgments/Licenses window is opened.
🪄 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: fc4dc262-fee1-4047-a9d3-52b3c17149a3

📥 Commits

Reviewing files that changed from the base of the PR and between 5321bec and c98f409.

⛔ Files ignored due to path filters (1)
  • .github/swift-file-length-budget.tsv is excluded by !**/*.tsv
📒 Files selected for processing (14)
  • Packages/CmuxDebugWindowsUI/Package.swift
  • Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Coordinator/DebugWindowsCoordinator.swift
  • Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Seams/WindowDecorating.swift
  • Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Stores/AboutTitlebarDebugStore.swift
  • Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Values/AboutTitlebarDebugOptions.swift
  • Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Values/AboutWindowKind.swift
  • Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Values/TitlebarToolbarStyleOption.swift
  • Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Values/TitlebarVisibilityOption.swift
  • Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Views/AboutTitlebarDebugView.swift
  • Packages/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Windows/AboutTitlebarDebugWindowController.swift
  • Packages/CmuxDebugWindowsUI/Tests/CmuxDebugWindowsUITests/AboutTitlebarDebugStoreTests.swift
  • Sources/AppDelegate.swift
  • Sources/cmuxApp.swift
  • cmux.xcodeproj/project.pbxproj

Comment on lines +69 to +87
public static func defaults(for kind: AboutWindowKind) -> AboutTitlebarDebugOptions {
switch kind {
case .about:
return AboutTitlebarDebugOptions(
overridesEnabled: false,
windowTitle: "About cmux",
titleVisibility: .hidden,
titlebarAppearsTransparent: true,
movableByWindowBackground: false,
titled: true,
closable: true,
miniaturizable: true,
resizable: false,
fullSizeContentView: false,
showToolbar: false,
toolbarStyle: .automatic
)
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize default window title in defaults factory.

Line 74 contains a bare English string "About cmux" for the windowTitle field. This value is displayed in the debug editor's text field when users open the About Titlebar Debug window. Per coding guidelines, all user-facing strings must use String(localized:defaultValue:) with matching entries in Resources/Localizable.xcstrings.

[full_internationalization]

🌐 Suggested localization fix
         case .about:
             return AboutTitlebarDebugOptions(
                 overridesEnabled: false,
-                windowTitle: "About cmux",
+                windowTitle: String(
+                    localized: "debug.aboutTitlebar.defaults.windowTitle",
+                    defaultValue: "About cmux"
+                ),
                 titleVisibility: .hidden,
🤖 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/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Values/AboutTitlebarDebugOptions.swift`
around lines 69 - 87, The windowTitle field in the defaults(for kind:) method
contains a bare English string "About cmux" that should be localized. Replace
the plain string literal with String(localized:defaultValue:) wrapper, using
"About cmux" as both the localization key and the default value, and ensure a
corresponding entry is added to Resources/Localizable.xcstrings to support
internationalization.

Source: Coding guidelines

Comment on lines +19 to +24
public var displayTitle: String {
switch self {
case .about:
return "About Window"
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize user-facing debug UI strings.

The displayTitle property returns a bare English string "About Window" that is shown in the debug editor UI. Per coding guidelines, all user-facing strings must use String(localized:defaultValue:) with matching entries in Resources/Localizable.xcstrings for all supported locales.

[full_internationalization]

🌐 Suggested localization fix
     public var displayTitle: String {
         switch self {
         case .about:
-            return "About Window"
+            return String(
+                localized: "debug.aboutTitlebar.kind.about.displayTitle",
+                defaultValue: "About Window"
+            )
         }
     }
🤖 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/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Values/AboutWindowKind.swift`
around lines 19 - 24, The displayTitle property in the about case returns a
hard-coded English string that should be localized. Wrap the string "About
Window" with String(localized:defaultValue:) to enable localization, then add
corresponding translation entries in Resources/Localizable.xcstrings for all
supported locales. This ensures the debug UI string respects the app's
localization settings rather than displaying only in English.

Source: Coding guidelines

Comment on lines +36 to +41
public var fallbackTitle: String {
switch self {
case .about:
return "About cmux"
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize fallback window title.

The fallbackTitle property returns a bare English string "About cmux" that is applied to NSWindow.title when the debug-overridden title is empty. Per coding guidelines, all user-facing strings must use String(localized:defaultValue:) with matching entries in Resources/Localizable.xcstrings.

[full_internationalization]

🌐 Suggested localization fix
     public var fallbackTitle: String {
         switch self {
         case .about:
-            return "About cmux"
+            return String(
+                localized: "debug.aboutTitlebar.kind.about.fallbackTitle",
+                defaultValue: "About cmux"
+            )
         }
     }
🤖 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/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Values/AboutWindowKind.swift`
around lines 36 - 41, The fallbackTitle property in the AboutWindowKind enum
returns a bare English string "About cmux" without localization. Replace this
string with a localized version using String(localized:defaultValue:) where the
defaultValue parameter contains the current English text, and ensure a matching
entry exists in Resources/Localizable.xcstrings for the key to be used in the
localized call.

Source: Coding guidelines

Comment on lines +23 to +36
public var displayTitle: String {
switch self {
case .automatic:
return "Automatic"
case .expanded:
return "Expanded"
case .preference:
return "Preference"
case .unified:
return "Unified"
case .unifiedCompact:
return "Unified Compact"
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize toolbar style picker labels.

The displayTitle property returns bare English strings ("Automatic", "Expanded", "Preference", "Unified", "Unified Compact") that are explicitly documented as "Human-readable label shown in the picker." These labels appear in the debug editor's SwiftUI Picker and are visible to users. Per coding guidelines, all user-facing strings must use String(localized:defaultValue:) with matching entries in Resources/Localizable.xcstrings.

[full_internationalization]

🌐 Suggested localization fix
     public var displayTitle: String {
         switch self {
         case .automatic:
-            return "Automatic"
+            return String(
+                localized: "debug.aboutTitlebar.toolbarStyle.automatic",
+                defaultValue: "Automatic"
+            )
         case .expanded:
-            return "Expanded"
+            return String(
+                localized: "debug.aboutTitlebar.toolbarStyle.expanded",
+                defaultValue: "Expanded"
+            )
         case .preference:
-            return "Preference"
+            return String(
+                localized: "debug.aboutTitlebar.toolbarStyle.preference",
+                defaultValue: "Preference"
+            )
         case .unified:
-            return "Unified"
+            return String(
+                localized: "debug.aboutTitlebar.toolbarStyle.unified",
+                defaultValue: "Unified"
+            )
         case .unifiedCompact:
-            return "Unified Compact"
+            return String(
+                localized: "debug.aboutTitlebar.toolbarStyle.unifiedCompact",
+                defaultValue: "Unified Compact"
+            )
         }
     }
🤖 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/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Values/TitlebarToolbarStyleOption.swift`
around lines 23 - 36, The displayTitle property in TitlebarToolbarStyleOption
returns bare English strings that are user-facing. Wrap each string return value
("Automatic", "Expanded", "Preference", "Unified", "Unified Compact") with
String(localized:defaultValue:) where the defaultValue parameter contains the
current English text. Then add corresponding localization entries for each key
in Resources/Localizable.xcstrings to enable multi-language support.

Source: Coding guidelines

Comment on lines +17 to +24
public var displayTitle: String {
switch self {
case .hidden:
return "Hidden"
case .visible:
return "Visible"
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize picker labels.

The displayTitle property returns bare English strings ("Hidden", "Visible") that are explicitly documented as "Human-readable label shown in the picker." These labels appear in the debug editor's SwiftUI Picker and are visible to users. Per coding guidelines, all user-facing strings must use String(localized:defaultValue:) with matching entries in Resources/Localizable.xcstrings.

[full_internationalization]

🌐 Suggested localization fix
     public var displayTitle: String {
         switch self {
         case .hidden:
-            return "Hidden"
+            return String(
+                localized: "debug.aboutTitlebar.titleVisibility.hidden",
+                defaultValue: "Hidden"
+            )
         case .visible:
-            return "Visible"
+            return String(
+                localized: "debug.aboutTitlebar.titleVisibility.visible",
+                defaultValue: "Visible"
+            )
         }
     }
🤖 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/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Values/TitlebarVisibilityOption.swift`
around lines 17 - 24, The displayTitle property in TitlebarVisibilityOption
returns hardcoded English strings that are visible to users in the SwiftUI
Picker and must be localized according to coding guidelines. Replace each
hardcoded string return value ("Hidden" and "Visible") with
String(localized:defaultValue:) calls, providing the English string as the
defaultValue parameter. Additionally, add corresponding entries for these
localization keys in the Resources/Localizable.xcstrings file to ensure
translations can be provided for different languages.

Source: Coding guidelines

Comment on lines +27 to +107
GroupBox("Actions") {
HStack(spacing: 10) {
Button("Reset All") {
store.reset(.about)
}
Button("Reapply to Open Windows") {
store.applyToOpenWindows()
}
Button("Copy Config") {
store.copyConfigToPasteboard()
}
}
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.top, 2)
}

Spacer(minLength: 0)
}
.padding(16)
.frame(maxWidth: .infinity, alignment: .topLeading)
}
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
}

private func editor(for kind: AboutWindowKind) -> some View {
let overridesEnabled = binding(for: kind, keyPath: \.overridesEnabled)

return GroupBox(kind.displayTitle) {
VStack(alignment: .leading, spacing: 10) {
Toggle("Enable Debug Overrides", isOn: overridesEnabled)

Text("When disabled, cmux uses normal default titlebar behavior for this window.")
.font(.caption)
.foregroundColor(.secondary)

Divider()

VStack(alignment: .leading, spacing: 10) {
HStack(spacing: 8) {
Text("Window Title")
TextField("", text: binding(for: kind, keyPath: \.windowTitle))
}

HStack(spacing: 10) {
Picker("Title Visibility", selection: binding(for: kind, keyPath: \.titleVisibility)) {
ForEach(TitlebarVisibilityOption.allCases) { option in
Text(option.displayTitle).tag(option)
}
}
Picker("Toolbar Style", selection: binding(for: kind, keyPath: \.toolbarStyle)) {
ForEach(TitlebarToolbarStyleOption.allCases) { option in
Text(option.displayTitle).tag(option)
}
}
}

Toggle("Show Toolbar", isOn: binding(for: kind, keyPath: \.showToolbar))
Toggle("Transparent Titlebar", isOn: binding(for: kind, keyPath: \.titlebarAppearsTransparent))
Toggle("Movable by Window Background", isOn: binding(for: kind, keyPath: \.movableByWindowBackground))

Divider()

Text("Style Mask")
.font(.caption)
.foregroundColor(.secondary)

Toggle("Titled", isOn: binding(for: kind, keyPath: \.titled))
Toggle("Closable", isOn: binding(for: kind, keyPath: \.closable))
Toggle("Miniaturizable", isOn: binding(for: kind, keyPath: \.miniaturizable))
Toggle("Resizable", isOn: binding(for: kind, keyPath: \.resizable))
Toggle("Full Size Content View", isOn: binding(for: kind, keyPath: \.fullSizeContentView))

HStack(spacing: 10) {
Button(String(localized: "debug.aboutTitlebarDebug.resetAbout", defaultValue: "Reset About")) {
store.reset(kind)
}
Button("Apply Now") {
store.applyToOpenWindows(for: kind)
}
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Localize all newly added UI labels in this editor.

This segment introduces many bare English user-facing strings, so non-English locales will get mixed-language UI. Route these labels/help text through localization keys and add matching translations in Resources/Localizable.xcstrings for all supported locales.

🌐 Example direction
- GroupBox("Actions") {
+ GroupBox(String(localized: "debug.aboutTitlebarDebug.actions", defaultValue: "Actions")) {

- Button("Reset All") {
+ Button(String(localized: "debug.aboutTitlebarDebug.resetAll", defaultValue: "Reset All")) {

- Text("When disabled, cmux uses normal default titlebar behavior for this window.")
+ Text(String(
+   localized: "debug.aboutTitlebarDebug.overridesDisabledHint",
+   defaultValue: "When disabled, cmux uses normal default titlebar behavior for this window."
+ ))

As per coding guidelines, “All user-facing strings must be localized” and Swift production text must have matching Resources/Localizable.xcstrings translations for every supported locale.

🤖 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/CmuxDebugWindowsUI/Sources/CmuxDebugWindowsUI/Views/AboutTitlebarDebugView.swift`
around lines 27 - 107, The editor(for kind: AboutWindowKind) function and the
Actions GroupBox contain multiple hardcoded English user-facing strings that are
not localized, including "Actions", "Reset All", "Reapply to Open Windows",
"Copy Config", "Enable Debug Overrides", "When disabled, cmux uses normal
default titlebar behavior for this window.", "Window Title", "Title Visibility",
"Toolbar Style", "Show Toolbar", "Transparent Titlebar", "Movable by Window
Background", "Style Mask", "Titled", "Closable", "Miniaturizable", "Resizable",
"Full Size Content View", and "Apply Now". Replace each hardcoded string with
String(localized:) or use the Text(_:) initializer with corresponding
localization keys (for example, "debug.actions", "debug.resetAll", etc.), then
add all these localization keys with their English and translated values to
Resources/Localizable.xcstrings for all supported locales.

Source: Coding guidelines

Comment thread Sources/cmuxApp.swift
Comment on lines 2244 to 2257
@@ -2662,7 +2257,7 @@ private final class AboutWindowController: NSWindowController, NSWindowDelegate

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Behavior change under nil AppDelegate.shared

The old code called AboutTitlebarDebugStore.shared.applyCurrentOptions(to: window, for: .about) unconditionally — applying debug options (and falling back to defaults when overrides were disabled) before applyWindowDecorations. The replacement AppDelegate.shared?.aboutTitlebarDebugStore.applyCurrentOptions(to: window, for: .about) silently skips applyCurrentOptions entirely when AppDelegate.shared is nil. That means neither the debug options nor the default titlebar treatment is applied on that call. In a normally-launched app this never fires, but it contradicts the PR's "byte-identical behaviour" claim and leaves a silent no-op gap if AppDelegate.shared is ever nil at window-open time (e.g. during teardown or in a future refactor that changes initialization order).

@azooz2003-bit

Copy link
Copy Markdown
Collaborator Author

Superseded by #6224 — consolidated into the existing CmuxFeedback/CmuxAppKitSupportUI package (no new micro-package) per over-engineering review. The extraction is preserved there.

This branch was successfully deployed

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