Skip to content

Fix inconsistent theme chrome on non-mounted workspaces#1432

Closed
lederniermagicien wants to merge 1 commit intomanaflow-ai:mainfrom
lederniermagicien:fix/theme-chrome-all-workspaces
Closed

Fix inconsistent theme chrome on non-mounted workspaces#1432
lederniermagicien wants to merge 1 commit intomanaflow-ai:mainfrom
lederniermagicien:fix/theme-chrome-all-workspaces

Conversation

@lederniermagicien
Copy link
Copy Markdown

@lederniermagicien lederniermagicien commented Mar 14, 2026

Problem

When the system appearance changes (light/dark mode toggle) or Ghostty reloads its config, the default background color updates and a ghosttyDefaultBackgroundDidChange notification fires. However, only the currently-mounted WorkspaceContentView (one workspace at a time, per WorkspaceMountPolicy.maxMountedWorkspaces=1) observes this notification and calls workspace.applyGhosttyChrome(). Non-mounted workspaces retain stale bonsplit chrome until the user switches to them and their view fires onAppear.

This causes inconsistent tab bar/split bar colors after:

  • System appearance toggles with multiple workspaces
  • Session restore creating workspaces before the first surface triggers a config reload

Fix

Observe ghosttyDefaultBackgroundDidChange in ContentView (which owns the full tabManager.tabs list) and push applyGhosttyChrome to every workspace. The existing isNoOp guard inside applyGhosttyChrome ensures workspaces already at the correct color are skipped.

Why this is safe

  • applyGhosttyChrome has a built-in no-op check: if the workspace's chrome hex already matches, it returns immediately
  • The notification is global, and each ContentView (one per window) iterates only its own tabManager.tabs
  • No new allocations, no new state — just pushing an existing value to workspaces that missed it

Summary by cubic

Fixes inconsistent tab/split chrome across workspaces by updating all tabs when the default background changes. When system appearance or config reload updates the background, every workspace now refreshes immediately.

  • Bug Fixes
    • Listen for ghosttyDefaultBackgroundDidChange in ContentView and call applyGhosttyChrome for each workspace with the current background color/opacity.
    • Safe and cheap: no-op if chrome already matches, and each window only updates its own tabs.

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

Summary by CodeRabbit

  • Bug Fixes
    • Fixed appearance theme changes to propagate consistently across all UI elements, ensuring the app's visual styling updates immediately when the system theme changes.

When the system appearance changes (light/dark mode toggle) or Ghostty
reloads its config, the default background color updates and a
ghosttyDefaultBackgroundDidChange notification fires. However, only
the currently-mounted WorkspaceContentView (one workspace at a time,
per WorkspaceMountPolicy.maxMountedWorkspaces=1) observes this
notification and calls workspace.applyGhosttyChrome(). Non-mounted
workspaces retain stale bonsplit chrome until the user switches to
them and their view fires onAppear.

This causes inconsistent tab bar/split bar colors after:
- System appearance toggles with multiple workspaces
- Session restore creating workspaces before the first surface
  triggers a config reload

Fix: observe ghosttyDefaultBackgroundDidChange in ContentView (which
owns the full tabManager.tabs list) and push applyGhosttyChrome to
every workspace. The existing isNoOp guard inside applyGhosttyChrome
ensures workspaces already at the correct color are skipped.
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 14, 2026

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

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: db7941d2-628f-495e-9976-de16833720df

📥 Commits

Reviewing files that changed from the base of the PR and between 6c203b5 and 0646798.

📒 Files selected for processing (1)
  • Sources/ContentView.swift

📝 Walkthrough

Walkthrough

A new listener for appearance changes is added to ContentView that detects Ghostty background color and opacity updates, automatically propagating these changes to all mounted workspaces via applyGhosttyChrome. This ensures all split bar chrome reflects the current theme instantly.

Changes

Cohort / File(s) Summary
Appearance Change Listener
Sources/ContentView.swift
Adds a global observer for ghosttyDefaultBackgroundDidChange notifications that propagates updated background color and opacity to all mounted workspaces, ensuring immediate theme consistency across all tabs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 ✨ A listening ear to changes bright,
When Ghostty's colors shift from night,
All workspaces in harmony glow,
A unified theme that they all know!
The rabbit hops—thematic delight! 🌙

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description comprehensively covers the Problem, Fix, and Why sections. However, the Testing and Demo Video sections required by the template are missing. Add Testing section documenting how the fix was tested, and include a Demo Video URL showing the theme consistency across workspaces after the fix.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main fix: resolving inconsistent theme chrome on non-mounted workspaces.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

You can validate your CodeRabbit configuration file in your editor.

If your editor has YAML language server, you can enable auto-completion and validation by adding # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json at the top of your CodeRabbit configuration file.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file


Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

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