Skip to content

Add macOS icon selector in Settings + custom dark icon#690

Open
rogierx wants to merge 1 commit intomanaflow-ai:mainfrom
rogierx:feat/macos-icon-selector-dark
Open

Add macOS icon selector in Settings + custom dark icon#690
rogierx wants to merge 1 commit intomanaflow-ai:mainfrom
rogierx:feat/macos-icon-selector-dark

Conversation

@rogierx
Copy link

@rogierx rogierx commented Feb 28, 2026

This PR introduces a dedicated macOS app icon selector in Settings and includes a custom dark icon.

What changed

  • Added macOS Icon setting directly under Theme.
  • Added visual preview options for Default and Dark.
  • Icon selection updates the app icon immediately and persists via appIconThemeMode.
  • Added icon assets:
    • DockIconDark.imageset
    • DockIconDefaultPreview.imageset
  • Fixed oversized spacing around the Sidebar Branch Layout row.
  • Removed duplicate focus ring border on icon selection buttons.
  • Fixed a debug-mode crash path in FileDropOverlayView hit-test diagnostics.

Credit

Design credit: custom dark icon by @rogierx.

Validation

  • xcodebuild -project GhosttyTabs.xcodeproj -scheme cmux -configuration Debug -destination "platform=macOS" -derivedDataPath /tmp/cmux-darkicon-test build
  • Runtime verification with a second cmux DEV instance alongside existing /Applications/cmux.app
  • Verified icon mode switching (default/dark) does not terminate app ✅

Summary by CodeRabbit

Release Notes

  • New Features
    • Added dark app icon theme option for macOS, selectable from Settings
    • App icon automatically updates when theme preference changes
    • Includes migration support for existing theme settings
- add macOS Icon setting under Theme with visual Default/Dark preview buttons

- persist selection via appIconThemeMode and apply icon immediately in Dock/Cmd+Tab

- include a custom dark macOS icon provided by @rogierx (DockIconDark.imageset)

- add DockIconDefaultPreview.imageset for side-by-side icon previews in settings

- fix extra spacing around Sidebar Branch Layout picker row

- remove duplicate blue focus ring on icon option buttons

- fix debug crash path in FileDropOverlayView hit-test logging
@vercel
Copy link

vercel bot commented Feb 28, 2026

@rogierx is attempting to deploy a commit to the Manaflow Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link

coderabbitai bot commented Feb 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7143359 and 4577c87.

⛔ Files ignored due to path filters (4)
  • Assets.xcassets/DockIconDark.imageset/512.png is excluded by !**/*.png
  • Assets.xcassets/DockIconDark.imageset/512@2x.png is excluded by !**/*.png
  • Assets.xcassets/DockIconDefaultPreview.imageset/512.png is excluded by !**/*.png
  • Assets.xcassets/DockIconDefaultPreview.imageset/512@2x.png is excluded by !**/*.png
📒 Files selected for processing (5)
  • Assets.xcassets/DockIconDark.imageset/Contents.json
  • Assets.xcassets/DockIconDefaultPreview.imageset/Contents.json
  • Sources/AppDelegate.swift
  • Sources/ContentView.swift
  • Sources/cmuxApp.swift
💤 Files with no reviewable changes (1)
  • Sources/ContentView.swift

📝 Walkthrough

Walkthrough

This PR introduces application icon theming support, allowing users to switch between default and dark dock icons. It adds new asset catalogs for dark icon variants, implements AppIconThemeMode settings with migration from legacy AppearanceMode, integrates UI controls in Settings, and wires icon refresh logic into AppDelegate to apply theme changes at runtime.

Changes

Cohort / File(s) Summary
Asset Catalogs
Assets.xcassets/DockIcon{Dark,DefaultPreview}.imageset/Contents.json
New asset manifest files defining dark and default preview dock icon variants at 1x and 2x scales.
App Icon Theming
Sources/AppDelegate.swift
Adds private asset name constant and theming-aware logic to switch dock icon between dark and default variants based on user theme setting; includes public refreshApplicationIconTheme() hook and internal applyApplicationIconTheme() helper integrated with shortcut defaults observer.
Theming UI & Settings
Sources/cmuxApp.swift
Introduces AppIconThemeMode enum, AppIconThemeSettings helper with migration from AppearanceMode, new AppIconOptionButton view for icon theme selection, UI support in SettingsView with preview images, lifecycle hooks to refresh icon theme on setting changes, and reset logic propagation.
Minor Cleanup
Sources/ContentView.swift
Removes temporary visibility hack from hit-testing diagnostic in FileDropOverlayView.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Settings as SettingsView
    participant Store as UserDefaults
    participant AppDel as AppDelegate
    participant NSApp as NSApplication

    User->>Settings: Select Dark Icon Theme
    Settings->>Store: Update appIconThemeMode
    activate Store
    Store->>AppDel: Notify via shortcut observer
    deactivate Store
    AppDel->>AppDel: applyApplicationIconTheme()
    AppDel->>AppDel: Load dark icon asset
    AppDel->>NSApp: NSApplication.shared.applicationIconImage
    NSApp->>NSApp: Update Dock icon display
    Note over NSApp: Dark icon now visible in Dock
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 The rabbit hops with pride today,
Dark icons now have come to play!
Settings dance, themes take their flight,
The dock glows dark, the assets bright. 🌙✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add macOS icon selector in Settings + custom dark icon' accurately reflects the main changes: adding icon theme selection UI in Settings and introducing a dark icon variant.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@greptile-apps
Copy link

greptile-apps bot commented Feb 28, 2026

Greptile Summary

Adds a dedicated macOS icon selector in Settings, decoupling icon theme from appearance mode. Users can now choose between Default and Dark icons independently of their light/dark theme preference.

Key changes:

  • New AppIconThemeMode enum and AppIconThemeSettings with migration from old appearance-based icon control
  • Settings UI shows visual icon previews with live switching via NSApplication.shared.applicationIconImage
  • Icon selection persists via @AppStorage and updates through multiple refresh paths (onChange handler, UserDefaults observer, and appearance change hook)
  • Fixed debug crash in FileDropOverlayView by removing problematic isHidden toggle during hit-test diagnostics
  • Added icon assets: DockIconDark and DockIconDefaultPreview imagesets

Confidence Score: 4/5

  • This PR is safe to merge with well-tested functionality and no critical issues
  • Well-structured implementation with proper migration logic, error handling, and validation. The icon refresh mechanism has multiple call paths creating minor redundancy, but all are idempotent and harmless. The debug crash fix is straightforward and correct.
  • No files require special attention

Important Files Changed

Filename Overview
Sources/cmuxApp.swift Added macOS icon selector UI with live switching, migration logic from old appearance-based icons, and integration with AppDelegate refresh calls
Sources/AppDelegate.swift Implemented icon theme application logic that reads user preferences and updates NSApplication.shared.applicationIconImage with proper fallbacks
Sources/ContentView.swift Removed isHidden toggle in hit-test diagnostics that was causing debug-mode crashes

Sequence Diagram

sequenceDiagram
    participant User
    participant SettingsView
    participant AppStorage
    participant AppDelegate
    participant NSApplication

    User->>SettingsView: Select icon (Default/Dark)
    SettingsView->>AppStorage: Update appIconThemeMode
    
    Note over AppStorage,AppDelegate: Multiple refresh paths trigger icon update
    
    AppStorage->>SettingsView: .onChange fires
    SettingsView->>AppDelegate: refreshApplicationIconTheme()
    
    AppStorage->>AppDelegate: UserDefaults.didChangeNotification
    AppDelegate->>AppDelegate: applyApplicationIconTheme()
    
    Note over SettingsView,AppDelegate: Also called when appearance changes
    
    AppDelegate->>AppStorage: Read appIconThemeMode
    AppDelegate->>AppDelegate: Determine icon (default/dark)
    AppDelegate->>NSApplication: Update applicationIconImage
    NSApplication-->>User: Icon updates in Dock/Cmd+Tab
Loading

Last reviewed commit: 4577c87

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

Labels

None yet

1 participant