Skip to content

Fix Cloud VM panel text readability across all terminal themes - #7538

Merged
teamleaderleo merged 3 commits into
mainfrom
fix-cloudvm-error-theme
Sep 24, 2026
Merged

teamleaderleo merged 3 commits into
mainfrom
fix-cloudvm-error-theme

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

The Cloud VM loading/error panel (CloudVMLoadingPanelView) paints the terminal theme's background color from the user's Ghostty config, but rendered its text with SwiftUI semantic colors (.primary/.secondary/.tertiary/.orange) that resolve against the system light/dark appearance rather than the actual background. On a dark theme under a light system appearance (and the reverse), the "Base unavailable" message rendered dark-on-dark and was unreadable — the reported bug.

Fix: derive the panel's color scheme from the background's luminance using the existing WindowChromeColorResolver.readableColorScheme(for:) (the same helper cmux already uses for readable chrome text over terminal backgrounds) and pin it with .environment(\.colorScheme,). Text now contrasts with the panel on every theme, light or dark.

Scope: presentational only, no string or logic changes. No new user-facing strings, so localization is unaffected. Principled fix (reuses the established readable-scheme helper rather than hardcoding colors).

Verified: cloud Release-capable Debug build compiles (tag cvmerr). The live failed-panel visual is best confirmed in dogfood since forcing the .failed phase requires a real provisioning failure and this CLI build has no panel-screenshot verb.

🤖 Generated with Claude Code


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


Note

Low Risk
Presentational SwiftUI change only; reuses an existing contrast helper with no auth, provisioning, or logic changes.

Overview
Fixes unreadable text on the Cloud VM loading/error panel when the terminal theme background disagrees with the system light/dark appearance.

CloudVMLoadingPanelView still uses the Ghostty default background, but it now derives a readable ColorScheme via WindowChromeColorResolver.readableColorScheme(for:) (same approach as window chrome) and applies .environment(\.colorScheme, readableScheme) so .primary/.secondary/.tertiary resolve against the panel, not macOS appearance alone.

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


Summary by cubic

Fixes unreadable text in the Cloud VM loading/error panel when the terminal theme and system appearance don't match. The panel now derives a readable color scheme from the terminal background and pins it via .environment(\.colorScheme), so text keeps contrast across themes.

  • Reuses WindowChromeColorResolver.readableColorScheme(for:), the same helper used for window chrome text.
  • Presentational only; no changes to strings, localization, or VM provisioning logic.

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

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Improved terminal loading screen readability by matching text colors to the terminal’s background.
    • Loading screen appearance now remains visually consistent regardless of the system light or dark mode.

The CloudVMLoadingPanelView paints the terminal theme's background color
(from the user's Ghostty config) but rendered its text with SwiftUI
semantic colors (.primary/.secondary/.tertiary/.orange) that resolve
against the system light/dark appearance, not the actual background. On a
dark theme under a light system appearance (and vice versa) the failed-
state message rendered dark-on-dark and was unreadable. Derive the panel's
colorScheme from the background's luminance via the existing
WindowChromeColorResolver.readableColorScheme(for:) and pin it with
.environment(\.colorScheme,), so text always contrasts with the panel on
every theme.

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

vercel Bot commented Jul 7, 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 Jul 7, 2026 11:23pm
cmux-staging Building Building Preview, Comment Jul 7, 2026 11:23pm

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Warning

Review limit reached

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: c913c038-8bee-4faf-8154-dc4485fb3b1b

📥 Commits

Reviewing files that changed from the base of the PR and between 1b6d9a1 and a1da579.

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 4e0246a7-431e-4382-9eea-681a33cd77ca

📥 Commits

Reviewing files that changed from the base of the PR and between 29cb166 and 1b6d9a1.

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

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Panel Background Color Scheme

Layer / File(s) Summary
Compute and apply readable color scheme
Sources/Panels/CloudVMLoadingPanelView.swift
The view stores its terminal background color, computes a readable color scheme with WindowChromeColorResolver, uses the stored color for the background, and applies the scheme through the SwiftUI environment.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: austinywang

Merge Risk: ⚪ Minimal · up to 1b6d9

The change improves loading-panel readability, and theme updates refresh the panel while visible. No merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 25
✅ Passed checks (25 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: improving text readability in the Cloud VM panel across terminal themes.
Description check ✅ Passed The description is detailed and covers the change, reason, scope, and build verification. It does not include the requested demo video or completed checklist, but these omissions do not make the other…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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 PASS. The PR changes only CloudVMLoadingPanelView.swift. The added code creates local color values and applies a SwiftUI environment value inside a View, which the rule explicitly allows as an int…
Cmux Swift Blocking Runtime ✅ Passed PASS: The reviewed range changes only Sources/Panels/CloudVMLoadingPanelView.swift. The additions compute readableScheme with WindowChromeColorResolver and apply a SwiftUI environment value. The…
Cmux Browser Automation Off-Main ✅ Passed PASS. The authoritative PR diff changes only Sources/Panels/CloudVMLoadingPanelView.swift (+6/-1). The change derives a color scheme and applies a SwiftUI environment value. It adds no browser.* c…
Cmux Expensive Synchronous Load ✅ Passed PASS: The pull request changes only Sources/Panels/CloudVMLoadingPanelView.swift. The diff adds a cached local background color, calls WindowChromeColorResolver().readableColorScheme(for:), and ap…
Cmux Cache Substitution Correctness ✅ Passed PASS: The diff changes only CloudVMLoadingPanelView presentation. It reads GhosttyApp.shared.defaultBackgroundColor once into a local constant, derives a ColorScheme with `WindowChromeColorResol…
Cmux No Hacky Sleeps ✅ Passed PASS. The review range changes only Sources/Panels/CloudVMLoadingPanelView.swift. The diff adds color-scheme resolution and a SwiftUI environment modifier. It does not add or expand sleeps, timers, …
Cmux Algorithmic Complexity ✅ Passed PASS. The PR changes only Sources/Panels/CloudVMLoadingPanelView.swift. It adds a constant-time color-scheme calculation and applies the result to the existing SwiftUI view. `WindowChromeColorResolv…
Cmux Swift Concurrency ✅ Passed PASS: The reviewed range changes only Sources/Panels/CloudVMLoadingPanelView.swift. The added code reads defaultBackgroundColor, computes readableColorScheme(for:), and applies a SwiftUI environ…
Cmux Swift @Concurrent ✅ Passed PASS: The PR changes only CloudVMLoadingPanelView.swift and adds synchronous color-resolution work inside View.body. The diff introduces no async, nonisolated, Task, @MainActor, or `@concu…
Cmux Swift Package Boundaries ✅ Passed PASS: The PR changes only Sources/Panels/CloudVMLoadingPanelView.swift. The change is small SwiftUI presentation glue: it reads the app terminal background, applies a background color, and sets the …
Cmux Swiftpm Lockfiles ✅ Passed The authoritative pull-request diff changes only Sources/Panels/CloudVMLoadingPanelView.swift. It changes SwiftUI presentation code and does not change Package.swift, Package.resolved, `.gitigno…
Cmux Swift Logging ✅ Passed The pull request changes only Sources/Panels/CloudVMLoadingPanelView.swift. The added lines derive a color scheme and apply SwiftUI presentation modifiers. No print, debugPrint, dump, NSLog,…
Cmux User-Facing Error Privacy ✅ Passed PASS: The pull request changes only Sources/Panels/CloudVMLoadingPanelView.swift. The diff adds terminal-background and readable-color-scheme handling, applies the existing color scheme to the panel…
Cmux Full Internationalization ✅ Passed PASS: The PR changes only CloudVMLoadingPanelView.swift. The diff adds background-color and color-scheme handling plus a developer comment, and removes/replaces no user-facing copy. Existing Cloud V…
Cmux Swiftui State Layout ✅ Passed PASS: The authoritative diff changes only CloudVMLoadingPanelView. It adds two local, read-only values and applies .environment(\\.colorScheme, readableScheme) to the existing panel content. It doe…
Cmux Architecture Rethink ✅ Passed The pull request passes this architecture check. The authoritative diff changes only CloudVMLoadingPanelView.swift. It adds local color values, reuses the existing `WindowChromeColorResolver.readabl…
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed The PR changes only CloudVMLoadingPanelView.swift. It adds color-scheme environment handling and changes no NSWindow, NSPanel, NSWindowController, Window, WindowGroup, identifier, or close…
Cmux Source Artifacts ✅ Passed PASS. The review-scoped diff changes only Sources/Panels/CloudVMLoadingPanelView.swift, a tracked hand-written Swift source file. The patch adds no logs, screenshots, caches, build output, temporary…
Cmux No Test Or Debug Seam In Production Source ✅ Passed PASS. The only changed file is Sources/Panels/CloudVMLoadingPanelView.swift, a production Swift path. The diff adds local color values and a SwiftUI .environment(\\.colorScheme, readableScheme) mod…
Cmux No Ambient Global State ✅ Passed PASS. The PR changes only Sources/Panels/CloudVMLoadingPanelView.swift and adds two local let bindings inside body, plus view modifiers. It adds no file-scope function, mutable global, namespace…
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates the Cloud VM loading/error panel colors.

  • Derives a readable SwiftUI color scheme from the Ghostty background.
  • Applies that scheme to the Cloud VM panel subtree.
  • Reuses the existing window chrome color resolver.

Confidence Score: 5/5

The changed panel looks mergeable after a small UI freshness cleanup.

  • The contrast fix is contained to one SwiftUI panel.
  • The remaining issue affects panels that stay open across a runtime Ghostty background change.
  • No persistence, security, or process-control behavior changed.

Sources/Panels/PanelContentView.swift

Important Files Changed

Filename Overview
Sources/Panels/PanelContentView.swift Adds readable color-scheme selection for the Cloud VM panel, with one visible-panel freshness issue when the Ghostty background changes at runtime.

Reviews (1): Last reviewed commit: "Fix Cloud VM panel text readability acro..." | Re-trigger Greptile

Comment thread Sources/Panels/PanelContentView.swift Outdated
Comment on lines +247 to +250
}
.padding(32)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color(nsColor: GhosttyApp.shared.defaultBackgroundColor))
.background(Color(nsColor: backgroundColor))

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 Visible Panel Keeps Old Theme

When the Ghostty background changes while this Cloud VM panel is already open, backgroundColor and readableScheme stay tied to the last outer body evaluation instead of the next timeline refresh. The panel previously read the background inside the timeline-rendered subtree, so a theme reload could repaint on the next tick; now the visible loading/error panel can keep the old background and text scheme until unrelated panel state forces a rebuild.

Rule Used: Flag SwiftUI changes that can cause stale state, b... (source)

@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Mac fleet instructions for head 1b6d9a14ef5784a93f1d8c814593de02ae7358a4. Planned tag: pr-7538-1b6d9a14; this is not yet a published build.

JOB_JSON=$(~/.local/bin/cmux-ci submit --kind cmux --command 'CMUX_FLEET_BUILD_TAG=pr-7538-1b6d9a14 /Users/Shared/cmux-build-fleet/recipes/cmux.sh https://github.com/manaflow-ai/cmux.git 1b6d9a14ef5784a93f1d8c814593de02ae7358a4' --artifact artifacts/cmux.app.zip --workspace https://github.com/manaflow-ai/cmux/pull/7538 --source-digest 1b6d9a14ef5784a93f1d8c814593de02ae7358a4 --cache-key cmux:pr-7538 --min-free-bytes 268435456000 --label cmux --label ram48)
JOB_ID=$(python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])' <<<"$JOB_JSON")
~/.local/bin/cmux-ci wait "$JOB_ID" --receipt artifacts/fleet/$JOB_ID.json
~/.local/bin/cmux-ci publish-hq "$JOB_ID"

Use an existing campaign job ID if one is already posted; do not submit a duplicate. A wait timeout leaves the remote job running. Published results will include an exact-head artifact link and timing/disk receipt. This recipe validates the macOS app only, not iOS or tests. Never use maclease or put credentials in a PR comment.

# Conflicts:
#	Sources/Panels/CloudVMLoadingPanelView.swift
@teamleaderleo
teamleaderleo enabled auto-merge (squash) September 24, 2026 08:59
@teamleaderleo

Copy link
Copy Markdown
Collaborator

Reviewed: the loading panel still paints the Ghostty background with semantic text colors and no color-scheme override, so this is still needed. I merged main in. Main moved the modifiers from body into baseContent(elapsedSeconds:), so I re-applied the fix there: backgroundColor and readableScheme are computed at the top of baseContent, followed by the .background / .environment(\.colorScheme, …) pair. The diff against main is those 9 lines. Auto-merge is on. Thanks :)

@teamleaderleo
teamleaderleo merged commit 33edbc7 into main Sep 24, 2026
54 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in cmux backlog Sep 24, 2026
rustybret pushed a commit to rustybret/bmux that referenced this pull request Sep 24, 2026
4aa2736 Fix cmux events access-denied stream error (manaflow-ai#10712)
f4ff9af ci: never let a focused test run pass after executing zero tests (manaflow-ai#14053)
fbaf239 Fix persistent LaunchServices registration from duplicate plist keys (manaflow-ai#12990)
7b1cb4a Fix Hermes gateway with symlinked venv Python (manaflow-ai#12996)
b6b2720 ssh-tmux mirror: preserve deliberate pane titles (manaflow-ai#10714)
33edbc7 Fix Cloud VM panel text readability across all terminal themes (manaflow-ai#7538)
30dccd6 fix: prevent detached TUI preferred editor processes (manaflow-ai#10681)
22eec58 Reap disowned shell watchers on parent PID reuse (issue 10926) (manaflow-ai#11035)
0b9b318 ci: start Linux-only jobs beside Fast static checks (manaflow-ai#14181)
9e78d22 ci: one git archive for the trusted router; delete duplicate CI guard tests (manaflow-ai#14199)
20e79e6 feat: load local cmux config packs (manaflow-ai#13356)
224327b ci: download the admission DerivedData seed while packages resolve (manaflow-ai#14184)
886a6f0 ci: run changed suites inside compile admission (manaflow-ai#14182)

# Conflicts:
#	.github/workflows/ci-guards.yml
#	.github/workflows/ci-macos.yml
#	.github/workflows/ci.yml
#	.github/workflows/test-e2e.yml
#	.github/workflows/test-macos-suite.yml
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.

2 participants