Skip to content

Use appearance-specific onboarding screenshots - #8803

Merged
azooz2003-bit merged 3 commits into
mainfrom
feat-ios-onboarding-color-scheme-shots
Jul 24, 2026
Merged

azooz2003-bit merged 3 commits into
mainfrom
feat-ios-onboarding-color-scheme-shots

Conversation

@azooz2003-bit

@azooz2003-bit azooz2003-bit commented Jul 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add dark-mode onboarding screenshots for workspaces and notifications in English and Japanese.
  • Switch onboarding screenshot resource lookup from SwiftUI colorScheme, keeping existing light asset names and using -dark assets in dark mode.
  • Expand onboarding screenshot tests across content, language, and appearance.
  • Fix one stale disabled workspace-selection test reference that blocked compiling the targeted onboarding test target.

Verification

  • git diff --check origin/main...HEAD
  • jq empty Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/Resources/Localizable.xcstrings
  • sips -g pixelWidth -g pixelHeight Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/Resources/OnboardingScreenshots/Onboarding-*-dark.png
  • file Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/Resources/OnboardingScreenshots/Onboarding-*.png
  • xcodebuild test -workspace ios/cmux.xcworkspace -scheme cmux-ios -destination 'platform=iOS Simulator,name=cmux-ondark-root-0724' -derivedDataPath /Users/abdulazizalbahar/Library/Developer/Xcode/DerivedData/cmux-ios-ondark PRODUCT_BUNDLE_IDENTIFIER=dev.cmux.ios.ondark 'PRODUCT_DISPLAY_NAME=cmux DEV ondark' CMUX_GIT_SHA=11ec9fab9b CMUX_DEV_TAG=ondark CMUX_PRESENCE_BASE_URL= CMUX_IOS_AUTH_ENV= 'CMUX_API_BASE_URL=http://localhost:9170' 'CMUX_IROH_BROKER_BASE_URL=https://cmux-staging.vercel.app' EXCLUDED_SOURCE_FILE_NAMES=Info.plist CODE_SIGNING_ALLOWED=NO SWIFT_OPTIMIZATION_LEVEL=-O SWIFT_COMPILATION_MODE=wholemodule GCC_OPTIMIZATION_LEVEL=s -only-testing:CmuxMobileShellUITests/OnboardingSceneChromeTests
  • xcodebuild test -workspace ios/cmux.xcworkspace -scheme cmux-ios -destination 'platform=iOS Simulator,name=cmux-ondark-root-0724' -derivedDataPath /Users/abdulazizalbahar/Library/Developer/Xcode/DerivedData/cmux-ios-ondark PRODUCT_BUNDLE_IDENTIFIER=dev.cmux.ios.ondark 'PRODUCT_DISPLAY_NAME=cmux DEV ondark' CMUX_GIT_SHA=11ec9fab9b CMUX_DEV_TAG=ondark CMUX_PRESENCE_BASE_URL= CMUX_IOS_AUTH_ENV= 'CMUX_API_BASE_URL=http://localhost:9170' 'CMUX_IROH_BROKER_BASE_URL=https://cmux-staging.vercel.app' EXCLUDED_SOURCE_FILE_NAMES=Info.plist CODE_SIGNING_ALLOWED=NO SWIFT_OPTIMIZATION_LEVEL=-O SWIFT_COMPILATION_MODE=wholemodule GCC_OPTIMIZATION_LEVEL=s -only-testing:cmuxUITests/cmuxUITests/testOnboardingScenesNotificationFeedResumeAndScannerFallback
  • ./scripts/reload-cloud.sh --tag ondark, GitHub Actions run https://github.com/manaflow-ai/cmux/actions/runs/30063089274
  • ./ios/scripts/reload.sh --tag ondark --simulator cmux-ondark-root-0724 --no-setup --no-launch
  • Web dev server on port 9170 warmed /, /handler/sign-in, and /handler/after-sign-in with redirect following.
  • Manual simulator screenshot verified first-run dark onboarding, and live simulator appearance switch verified the light screenshot variant.

Dogfood

Tag: http://127.0.0.1:17320/ondark
Simulator: cmux-ondark-root-0724, bundle dev.cmux.ios.ondark, launched at first-run onboarding in dark mode.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Show onboarding screenshots that match the system light/dark appearance. Adds dark-mode assets, regenerates light images, and requires an explicit appearance when loading to ensure the right image and cache entry.

  • New Features

    • Added Onboarding-*-dark.png assets (EN/JA) and regenerated light variants.
    • Loader now requires appearance (auto-resolved from SwiftUI colorScheme) and caches by content/language/appearance.
  • Bug Fixes

    • Updated workspace selection test to the current API, unblocking the onboarding test target.

Written for commit 9af9da5. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Enhanced onboarding screenshots to automatically select the correct variant for both UI language (English/Japanese) and the active system theme (light/dark).
    • Updated screenshot caching and loading so each language/appearance combination uses the correct cached image.
  • Tests

    • Extended onboarding screenshot tests to cover all theme appearances and validate loaded image dimensions.
    • Added a test to ensure appearance mapping matches the system color scheme.
    • Adjusted workspace mac selection test to use the view’s selection handling flow for “select all.”

@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Onboarding screenshots now account for locale and system appearance, including resource names, cache sizing, and loading tests. A workspace selection test now uses the view’s current state and event-handling APIs.

Changes

Theme-aware onboarding screenshots

Layer / File(s) Summary
Appearance-aware loading and caching
Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/OnboardingScreenshot.swift
OnboardingScreenshot resolves light or dark appearance from ColorScheme, loads matching resources, appends -dark to dark resource names, and sizes cache storage for language/appearance combinations.
Screenshot variant validation
Packages/iOS/CmuxMobileShellUI/Tests/CmuxMobileShellUITests/OnboardingSceneChromeTests.swift
Tests load every localized appearance variant, validate dimensions, and verify system color-scheme mapping.

Workspace selection test alignment

Layer / File(s) Summary
Selection test API usage
Packages/iOS/CmuxMobileShellUI/Tests/CmuxMobileShellUITests/WorkspaceMacSelectionTests.swift
The disabled selection test reads current picker state and invokes the picker handler to select all machines.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SwiftUI
  participant OnboardingScreenshot
  participant ImageResources
  SwiftUI->>OnboardingScreenshot: resolve current ColorScheme
  OnboardingScreenshot->>OnboardingScreenshot: build language and appearance resource name
  OnboardingScreenshot->>ImageResources: load localized light or dark image
  ImageResources-->>OnboardingScreenshot: return screenshot image
Loading

Possibly related PRs

  • manaflow-ai/cmux#8756: Updates the same onboarding screenshot loading and localized resource-name logic extended here for appearance variants.
🚥 Pre-merge checks | ✅ 25
✅ Passed checks (25 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 No new actor-isolation debt: the new appearance enum is a plain Sendable value helper, UI screenshot loading/cache stay @MainActor, and the test change is UI-only.
Cmux Swift Blocking Runtime ✅ Passed No new blocking waits, sleeps, syncs, or locks were introduced; the changes are appearance-aware screenshot lookup and test-only assertions/continuations.
Cmux Browser Automation Off-Main ✅ Passed PR only changes iOS onboarding screenshot assets/tests; no browser.* socket automation or ControlCommandExecutionPolicy files were modified.
Cmux Expensive Synchronous Load ✅ Passed The diff only adds onboarding PNG asset reads in a @concurrent helper; no agent-history loaders or main-actor history parses were introduced.
Cmux Cache Substitution Correctness ✅ Passed OnboardingScreenshot’s NSCache only memoizes static bundle images; it still falls back to a fresh load on cold misses and doesn’t replace any persisted or authoritative state.
Cmux No Hacky Sleeps ✅ Passed PR only changes Swift sources/tests and PNG assets; no TypeScript/JS/shell/build/runtime script diff to which the no-hacky-sleeps rule applies.
Cmux Algorithmic Complexity ✅ Passed PASS: OnboardingScreenshot only adds an 8-entry cache keyed by 2 contents × 2 languages × 2 appearances; test loops are fixed-size and no scalable rescans were introduced.
Cmux Swift Concurrency ✅ Passed Only SwiftUI/XCTest boundary changes were added; no new DispatchQueue, Combine, completion-handler, or lifecycle-less Task patterns appear in the diff.
Cmux Swift @Concurrent ✅ Passed The heavy screenshot load was moved behind a valid @concurrent helper, while the UI-facing image/cache API remains @MainActor.
Cmux Swift Package Boundaries ✅ Passed Only production change is a SwiftUI screenshot view inside the CmuxMobileShellUI package target; it’s UI/resource glue, not app-target domain logic.
Cmux Swiftpm Lockfiles ✅ Passed PR only changes onboarding code/assets/tests; no Package.resolved, .gitignore, or Xcode package-reference files are touched.
Cmux Swift Logging ✅ Passed The changed Swift files add no print/debugPrint/dump/NSLog/Logger usage or sensitive logging; only view logic and tests changed.
Cmux User-Facing Error Privacy ✅ Passed No changed user-facing error, alert, or recovery copy exposes vendor/internal details; diff is onboarding screenshots, tests, and an internal assertionFailure only.
Cmux Full Internationalization ✅ Passed PR only changes screenshot assets, localization-aware image loading, and tests; no user-facing Swift text, xcstrings, Info.plist, or web locale files were edited.
Cmux Swiftui State Layout ✅ Passed No banned SwiftUI state/layout patterns were introduced; the new screenshot state is view-local and updated via .task, with no GeometryReader or store-in-lazy-row changes.
Cmux Architecture Rethink ✅ Passed Patch is a small correctness fix: appearance-aware screenshot lookup/cache plus test updates; no sleeps, observers, side channels, or split UI ownership introduced.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed Only onboarding screenshot view/test changes; no NSWindow/NSPanel/WindowGroup or cmuxAuxiliaryWindowIdentifiers changes, so the close-shortcut rule isn’t implicated.
Cmux Source Artifacts ✅ Passed All changed paths are intentional source/tests or onboarding PNG fixtures in Resources; no logs, caches, scratch dirs, or build artifacts appear.
Cmux No Test Or Debug Seam In Production Source ✅ Passed The only production-source change adds appearance-aware screenshot loading; it introduces no DEBUG/test-only seam, no test-hook names, and no visibility widening for tests.
Cmux No Ambient Global State ✅ Passed Diff only adds scoped enums/methods inside OnboardingScreenshot; no new free funcs, mutable globals, or singleton-style ambient state.
Title check ✅ Passed The title clearly summarizes the main change: appearance-specific onboarding screenshots.
Description check ✅ Passed The description covers the summary and verification well, with only some non-critical template sections omitted.
✨ 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-ios-onboarding-color-scheme-shots

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 24, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds dark-mode onboarding screenshot assets and updates OnboardingScreenshot.swift to select the right image based on the system colorScheme environment value. It also expands unit test coverage and fixes a stale API reference that prevented the onboarding test target from compiling.

  • Dark mode asset selection: @Environment(\.colorScheme) is read into a new appearance computed property; task(id: resourceName) re-fires automatically whenever content, language, or appearance changes because resourceName now encodes all three dimensions.
  • Cache sizing: screenshotCache.countLimit is updated to Content × Language × Appearance (2×2×2 = 8), ensuring the cache is sized for every combination.
  • Test fixes: OnboardingSceneChromeTests now loops over all OnboardingScreenshotAppearance cases, and WorkspaceMacSelectionTests is updated to the current handleMacTitlePickerSelection API.

Confidence Score: 5/5

Safe to merge — the change is self-contained, well-tested, and touches only onboarding asset selection logic.

The appearance dimension is correctly threaded through the task ID, cache key, and cache size limit. The @Concurrent loadImage path keeps disk I/O off the main actor, and the @mainactor screenshotCache access is properly isolated. Dark-mode PNG assets are deliberate product resources with verified dimensions. No production rule violations found.

No files require special attention.

Important Files Changed

Filename Overview
Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/OnboardingScreenshot.swift Adds appearance-aware screenshot selection via @Environment(.colorScheme); task ID, cache key, and cache count limit all correctly incorporate the new dimension.
Packages/iOS/CmuxMobileShellUI/Tests/CmuxMobileShellUITests/OnboardingSceneChromeTests.swift Extends screenshot load test to cover all OnboardingScreenshotAppearance cases and adds a direct unit test for resolve(colorScheme:) mapping.
Packages/iOS/CmuxMobileShellUI/Tests/CmuxMobileShellUITests/WorkspaceMacSelectionTests.swift Updates a disabled test to the current handleMacTitlePickerSelection / currentMacTitlePickerSelection API so the onboarding test target compiles.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["OnboardingScreenshot.body"] -->|"task(id: resourceName)"| B["resourceName computed"]
    B --> C["content + language + appearance"]
    C --> D{"appearance"}
    D -->|"light"| E["Onboarding-{content}-{lang}"]
    D -->|"dark"| F["Onboarding-{content}-{lang}-dark"]
    E --> G["image(content:language:appearance:)"]
    F --> G
    G --> H{"NSCache hit?"}
    H -->|"yes"| I["return cached UIImage"]
    H -->|"no"| J["loadImage @concurrent"]
    J --> K["Bundle.module URL lookup"]
    K --> L["Data(contentsOf:) + byPreparingForDisplay()"]
    L --> M["store in screenshotCache"]
    M --> I
    I --> N["screenshot @State renders Image"]
Loading

Reviews (3): Last reviewed commit: "Require explicit onboarding screenshot a..." | 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: 1

🤖 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/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/OnboardingScreenshot.swift`:
- Line 79: Make the appearance parameter of image(...) in OnboardingScreenshot
required by removing its .light default, then update every direct image(...)
call site to pass the intended OnboardingScreenshotAppearance explicitly.
🪄 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 Plus

Run ID: 446af1ee-a2f4-463e-9836-894351292b42

📥 Commits

Reviewing files that changed from the base of the PR and between ea51d55 and 11ec9fa.

⛔ Files ignored due to path filters (4)
  • Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/Resources/OnboardingScreenshots/Onboarding-notifications-en-dark.png is excluded by !**/*.png
  • Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/Resources/OnboardingScreenshots/Onboarding-notifications-ja-dark.png is excluded by !**/*.png
  • Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/Resources/OnboardingScreenshots/Onboarding-workspaces-en-dark.png is excluded by !**/*.png
  • Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/Resources/OnboardingScreenshots/Onboarding-workspaces-ja-dark.png is excluded by !**/*.png
📒 Files selected for processing (3)
  • Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/OnboardingScreenshot.swift
  • Packages/iOS/CmuxMobileShellUI/Tests/CmuxMobileShellUITests/OnboardingSceneChromeTests.swift
  • Packages/iOS/CmuxMobileShellUI/Tests/CmuxMobileShellUITests/WorkspaceMacSelectionTests.swift

content: Content,
language: OnboardingScreenshotLanguage
language: OnboardingScreenshotLanguage,
appearance: OnboardingScreenshotAppearance = .light

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

rg -n 'OnboardingScreenshot\.image\s*\(' Packages/iOS/CmuxMobileShellUI

Repository: manaflow-ai/cmux

Length of output: 316


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate file =="
fd -a 'OnboardingScreenshot.swift|OnboardingSceneChromeTests.swift' . | sed 's#^\./##'

echo "== file outline =="
ast-grep outline Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/OnboardingScreenshot.swift --view expanded || true

echo "== relevant source =="
sed -n '1,140p' Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/OnboardingScreenshot.swift

echo "== tests around call =="
sed -n '60,125p' Packages/iOS/CmuxMobileShellUI/Tests/CmuxMobileShellUITests/OnboardingSceneChromeTests.swift

echo "== search all appearance param usages without full repo explosion =="
rg -n 'OnboardingScreenshot\.image|OnboardingScreenshotAppearance|image\s*\(' Packages/iOS/CmuxMobileShellUI -g '*.swift'

Repository: manaflow-ai/cmux

Length of output: 10502


Make the screenshot appearance parameter required.

image(...) selects an appearance-specific resource, but the public default of .light allows future omitted calls to render light screenshots when a dark screenshot should be used. Remove the default and update any direct call sites.

Proposed fix
-        appearance: OnboardingScreenshotAppearance = .light
+        appearance: OnboardingScreenshotAppearance
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
appearance: OnboardingScreenshotAppearance = .light
appearance: OnboardingScreenshotAppearance
🤖 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/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/OnboardingScreenshot.swift`
at line 79, Make the appearance parameter of image(...) in OnboardingScreenshot
required by removing its .light default, then update every direct image(...)
call site to pass the intended OnboardingScreenshotAppearance explicitly.

Source: Path instructions

@cursor

cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@azooz2003-bit

Copy link
Copy Markdown
Collaborator Author

Updated the screenshots so each light/dark pair is captured from the same preview entrypoint with the same fixture, language, status bar, and crop. The only switched input is the simulator appearance.

Verification:

  • Regenerated all onboarding screenshot assets for workspaces and notifications in English and Japanese.
  • Confirmed all eight assets are 1206x2622 PNGs with no extended attributes.
  • Ran xcodebuild test ... -only-testing:CmuxMobileShellUITests/OnboardingSceneChromeTests, passed 6 tests.
  • Ran xcodebuild test ... -only-testing:cmuxUITests/cmuxUITests/testOnboardingScenesNotificationFeedResumeAndScannerFallback, passed 1 UI test.
  • Rebuilt macOS tag ondark through reload-cloud run https://github.com/manaflow-ai/cmux/actions/runs/30064305946.
  • Rebuilt and launched simulator tag ondark on isolated simulator cmux-ondark-root-0724.

Dogfood tag: http://127.0.0.1:17320/ondark

@azooz2003-bit
azooz2003-bit merged commit 73d4119 into main Jul 24, 2026
6 checks passed
@azooz2003-bit
azooz2003-bit deleted the feat-ios-onboarding-color-scheme-shots branch July 24, 2026 05:11
@coderabbitai coderabbitai Bot mentioned this pull request Aug 7, 2026
5 of 6 tasks
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