Fix titlebar icons invisible when sidebar closed with dark Ghostty theme in light macOS - #482
serafimcloud wants to merge 3 commits into
Conversation
… color The titlebar control icons (sidebar toggle, notifications bell, new tab plus) were rendered with the default macOS system accent color (blue) because no foreground color was specified. This looked out of place with dark themes like Cursor Dark. Apply .foregroundStyle(.secondary) to match the neutral appearance used elsewhere in the UI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@serafimcloud is attempting to deploy a commit to the Manaflow Team on Vercel. A member of the Team first needs to authorize it. |
…ility Use GhosttyApp.shared.defaultBackgroundColor to determine whether the terminal theme is light or dark, then set icon foreground accordingly. This matches the same approach used by fakeTitlebarTextColor in ContentView and ensures the sidebar, bell, and plus icons are visible on both light and dark Ghostty themes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When sidebar is open, icons sit on the system-themed sidebar background so they should use the default system appearance color. When sidebar is closed, the titlebar background comes from the Ghostty theme, so icons need to derive their color from GhosttyApp.shared.defaultBackgroundColor to remain visible. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 28f1473bf4
ℹ️ 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".
| } | ||
|
|
||
| private var iconForegroundColor: Color? { | ||
| let sidebarVisible = AppDelegate.shared?.sidebarState?.isVisible ?? false |
There was a problem hiding this comment.
Use window-local sidebar visibility for icon tint
iconForegroundColor reads AppDelegate.shared?.sidebarState?.isVisible, but AppDelegate.sidebarState is a single active-window pointer that gets reassigned in setActiveMainWindow (Sources/AppDelegate.swift). TitlebarControlsView is instantiated per window, so in multi-window sessions this can tint icons using another window’s sidebar state (for example, a window with an open sidebar can still get the “sidebar closed” tint when a different window is active), which reintroduces low-contrast icons in the wrong window.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 28f1473bf4
ℹ️ 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".
| let sidebarVisible = AppDelegate.shared?.sidebarState?.isVisible ?? false | ||
| guard !sidebarVisible else { return nil } | ||
| let bg = GhosttyApp.shared.defaultBackgroundColor | ||
| return bg.isLightColor |
There was a problem hiding this comment.
Bind icon tint to observable state
iconForegroundColor now derives the icon tint from AppDelegate.shared?.sidebarState?.isVisible and GhosttyApp.shared.defaultBackgroundColor, but TitlebarControlsView does not observe either source, so SwiftUI has no guaranteed invalidation when sidebar visibility or Ghostty theme changes. In practice, toggling the sidebar via keyboard/CLI or changing theme at runtime can leave stale icon colors (including the original invisible-on-dark case) until an unrelated re-render happens (e.g. hover or notification updates).
Useful? React with 👍 / 👎.
|
Thanks for this! Titlebar icons now take their color from the terminal background landed on main in #4359. You opened this first, so you got there first. Closing since main covers it now. |
Problem
When using a dark Ghostty theme (e.g. Cursor Dark
#141414) with macOS light system appearance and the sidebar closed, the three titlebar icons (sidebar toggle, bell, plus) are invisible — they're dark/black (from macOS light appearance) on a dark titlebar background (from Ghostty theme).The titlebar background correctly derives its color from the Ghostty theme, but the icons have no explicit foreground color, so they inherit from the macOS system appearance.
Solution
When the sidebar is closed, derive icon color from
GhosttyApp.shared.defaultBackgroundColor.isLightColor:When the sidebar is open, leave icons unchanged — they use the default system appearance color, which is correct since the sidebar background comes from the system theme, not Ghostty.
Test plan
🤖 Generated with Claude Code