Skip to content

#1044 iOS: light/dark override and text sizes - #1048

Merged
ivanfenenko merged 4 commits into
mainfrom
feature/1044-appearance-text-size-ios
Nov 15, 2026
Merged

ivanfenenko merged 4 commits into
mainfrom
feature/1044-appearance-text-size-ios

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #1044. iOS half; Android is #1046.

What changed

  • Settings › Appearance: Mode segmented control (System / Light / Dark) with the note under it, the existing Theme and Code highlight rows under a Theme header, then Home list text, Session Chat text and Code text. Each is a card with "Size", the step name and a 5-step slider (0.85 / 0.92 / 1.0 / 1.12 / 1.26). Under each card is a flat live sample drawn with the real components: a section header and two SessionListRows, then OpenCodeOutgoingMessage + OpenCodeAssistantMessage (markdown with inline code) + OpenCodeToolCallCard, then OpenCodeUnifiedDiff. The page ends with the two notes.
  • Overflow (⋯) menu in the top bar: "Reset text sizes" (disabled when all are Default) and "Reset all appearance" (destructive, also resets Mode; disabled when nothing differs).
  • Mode sets overrideUserInterfaceStyle on the window from the app root (openCodeAppearanceMode()), so sheets, dialogs and window overlays switch right away.
  • Text scale in the design system: OpenCodeTypography.Style (size/weight/design for each role, plus a UIKit font), the openCodeTextScale environment 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.
    • Home: OpenCodeListItem (title, path, caption, status, letter badge, row height), OpenCodeSectionHeader, OpenCodeTag, applied to Home's SessionList, Archived sessions and session search.
    • Session Chat: messages, markdown (body, inline code, code and diff blocks, tables), tool lines (tool card, chip, shell row, step rail, activity card, task row, child row, reasoning, notices) and the composer's prompt field. MessageListTimelineHost passes the scale into its UIHostingConfiguration cells, which don't inherit SwiftUI's environment, and reconfigures the rows when it changes.
    • Code: terminal (xterm font = 12 px × scale, through the shared 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).
  • Persistence: AppearancePreferences (UserDefaults, device-local), cleared by Clear All Data and the store-screenshot wipe.
  • New design-system components OpenCodeSegmentedControl and OpenCodeStepSlider, with gallery entries.
  • Analytics: settings_appearance_mode (mode), settings_text_size (text_region, text_size), settings_reset_text_sizes, settings_reset_appearance, the same names as Android.
  • Strings use the dotted forms of #1044 Android: light/dark override and text sizes #1046's Android keys.

Checks

  • xcodebuild build-for-testing (generic iOS Simulator): succeeded, with no new warnings in the changed files.
  • Added unit tests in AppearancePreferencesTests.swift for 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.mjs with #1044 Android: light/dark override and text sizes #1046's strings.xml checked 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.
  • UI change; screenshots are still to come from the device check.

Needs device check

  1. Appearance: layout matches the prototype. Mode note text changes with the selection. The slider drags and taps to each step, the step name updates, and VoiceOver reads "Home list text size, Large" and adjusts by swipe.
  2. Mode Light/Dark with the phone in the opposite mode: applies at once to the app, a bottom sheet, a dialog and the overflow menu. Back to System follows the phone again. It survives a relaunch.
  3. ⋯ menu: both entries disabled at defaults. Mode alone enables only "Reset all appearance". Each reset does what it says.
  4. Each sample resizes live at Extra small and Extra large. The samples are flat, with no wrapping card.
  5. Home size: Home rows (compact and classic styles), section headers, archived sessions and session search all scale. Filter tabs, the dock and Settings rows do not.
  6. Session Chat size: user and assistant messages, inline code, code blocks, tool lines and the composer text and placeholder all scale. Rows already on screen re-lay out cleanly when the size changes with a chat open (iPad split). Check the composer's height cap and caret after a size change.
  7. Code size: terminal (font changes and the grid refits), Changes diff (hunk navigation still lands on the right row), file viewer (gutter width, wrap on/off), tool result sheet (source, grep, edit) and shell output.
  8. Dynamic Type at a larger phone size multiplies all three regions. Screens outside the regions stay unchanged.

Risks / Follow-ups

  • Before this change the app ignored Dynamic Type. The three regions now follow it (capped at the first accessibility size), so users with a large phone text size will see bigger Home, Session Chat and code text even at Default.
  • Only the composer's prompt field scales. Its chips and permission/question panels keep their size.
  • Markdown in the tool detail sheet and the file viewer's markdown preview is not code text and stays unscaled.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with 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 (window overrideUserInterfaceStyle) and a text-scale design system: openCodeTextScale environment, .openCodeFont, and region modifiers. Chat timeline hosting reconfigures cells when scale changes; terminal scales xterm via terminalSetFontSize.

New UI primitives OpenCodeSegmentedControl and OpenCodeStepSlider (plus component gallery); many chat/list/code views migrate from fixed OpenCodeTypography fonts to scale-aware styling.

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

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]>
@ivanfenenko
ivanfenenko marked this pull request as ready for review November 15, 2026 17:02
@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

@github-actions github-actions 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.

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:661 low: 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]>
@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

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).

Step Screenshot
Appearance, System mode (phone light)
Dark override, Home list Extra large
Session Chat Extra small, Code Extra large
⋯ reset menu
Real Home at Extra large (dark)
Real Session Chat at Extra small
Tool diff sheet at Code Extra large
After relaunch + Reset all: System, Default, both items disabled
After fix: ink fill, knob visible in dark

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.

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