Repository navigation
#1044 iOS: light/dark override and text sizes - #1048
Conversation
Settings › Appearance gains a Mode control (System / Light / Dark) and three text sizes (Home list, Session Chat, Code), each a stepped slider card with a flat live sample drawn by the real components. A top-bar overflow menu resets the sizes, or everything including Mode. Mode is set on the window, so sheets, dialogs and window overlays follow it right away. Sizes multiply the phone's Dynamic Type through a region text scale in the design system (OpenCodeTypography.Style plus the openCodeTextScale environment), so only the surfaces in each region change size; outside a region every size stays exactly as before. The timeline host passes the scale into its UIKit-hosted cells. The terminal uses the shared terminalSetFontSize hook. All four settings persist locally and are cleared by Clear All Data. Adds OpenCodeSegmentedControl and OpenCodeStepSlider with gallery entries, and unit tests for the store, reset rules and text scale. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4afe222. Configure here.
There was a problem hiding this comment.
Automated review: no finding that 2+ of 3 passes agreed on.
1 finding(s) from a single pass, not posted
ios/OpenCode Mobile/OpenCode Mobile/Components/Input/OpenCodeMentionTextView.swift:661low: Caret auto-scroll still uses scale-1 layout thresholds after text scale was added (glm-5.3-flash)
opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.116 · 1 pass(es) stopped early
- Step slider fill and passed ticks use the strong ink, matching Android. - Knob uses the strong ink in dark mode so it stays visible. - Reset menu icons match Android (restart for text sizes, undo for all). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Device check: iPhone 17 simulator, scenario harness (opencode v2, scripted model)Checked against the "Needs device check" list. Fixes from this pass are in f11f9f4 (ink slider fill like Android, knob visible in dark, reset icons match Android). Dark and Extra large survived a relaunch. Not checked on device: terminal (shell prompt shows host details), largest Dynamic Type sizes, Changes screen and file viewer. |










Part of #1044. iOS half; Android is #1046.
What changed
SessionListRows, thenOpenCodeOutgoingMessage+OpenCodeAssistantMessage(markdown with inline code) +OpenCodeToolCallCard, thenOpenCodeUnifiedDiff. The page ends with the two notes.overrideUserInterfaceStyleon the window from the app root (openCodeAppearanceMode()), so sheets, dialogs and window overlays switch right away.OpenCodeTypography.Style(size/weight/design for each role, plus a UIKit font), theopenCodeTextScaleenvironment value,.openCodeTextScale(region)and.openCodeFont(style). Scale = step factor × Dynamic Type multiplier (capped at the first accessibility size). Outside a region the scale is 1, so every other screen keeps its current fixed sizes.OpenCodeListItem(title, path, caption, status, letter badge, row height),OpenCodeSectionHeader,OpenCodeTag, applied to Home'sSessionList, Archived sessions and session search.MessageListTimelineHostpasses the scale into itsUIHostingConfigurationcells, which don't inherit SwiftUI's environment, and reconfigures the rows when it changes.window.terminalSetFontSize, same bytes as #1044 Android: light/dark override and text sizes #1046), Changes diff, file viewer (OpenCodeCodeFile), tool result sheet and shell output sheet (code text only).AppearancePreferences(UserDefaults, device-local), cleared by Clear All Data and the store-screenshot wipe.OpenCodeSegmentedControlandOpenCodeStepSlider, with gallery entries.settings_appearance_mode(mode),settings_text_size(text_region,text_size),settings_reset_text_sizes,settings_reset_appearance, the same names as Android.Checks
xcodebuild build-for-testing(generic iOS Simulator): succeeded, with no new warnings in the changed files.AppearancePreferencesTests.swiftfor defaults, persistence across relaunch, per-region sizes, unknown stored values, both reset rules, clear, step factors, mode → window style, the text-scale math and slider snapping. They build but were not run: no simulator test run, as instructed.node scripts/check-string-keys.mjswith #1044 Android: light/dark override and text sizes #1046'sstrings.xmlchecked out: "String keys match". On this branch alone the check fails until #1044 Android: light/dark override and text sizes #1046 lands; the two PRs need to merge together.gitleaks git --pre-commit --staged: no leaks.Needs device check
Risks / Follow-ups
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Note
Medium Risk
Broad UI/layout surface (timeline height cache, composer UITextView, terminal refit); preferences affect global theme and three regions but are bounded by tests and clear/reset paths.
Overview
Adds Settings › Appearance controls for a System / Light / Dark mode and per-region text size sliders (Home list, Session Chat, Code), with live samples, reset actions, persistence via
AppearancePreferences, and product analytics.Introduces
openCodeAppearanceMode()at the app root (windowoverrideUserInterfaceStyle) and a text-scale design system:openCodeTextScaleenvironment,.openCodeFont, and region modifiers. Chat timeline hosting reconfigures cells when scale changes; terminal scales xterm viaterminalSetFontSize.New UI primitives
OpenCodeSegmentedControlandOpenCodeStepSlider(plus component gallery); many chat/list/code views migrate from fixedOpenCodeTypographyfonts to scale-aware styling.Reviewed by Cursor Bugbot for commit 4afe222. Bugbot is set up for automated code reviews on this repo. Configure here.