Repository navigation
#1044 Android: light/dark override and text sizes - #1046
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 applies at the theme root, including sheets, dialogs and system bar icons. Sizes multiply the phone's font scale through text regions in the design system, so only the surfaces in each region change size. All four settings persist locally and are cleared by Clear All Data. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The |
|
@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 90ce733. Configure here.
There was a problem hiding this comment.
Automated review: no finding that 2+ of 3 passes agreed on.
2 finding(s) from a single pass, not posted
android/app/src/main/java/dev/opencode/mobile/theme/Theme.kt:22medium: Forced Light/Dark mode is not applied to components that read the system setting directly (deepseek-v4.1-flash)android/app/src/main/java/dev/opencode/mobile/ui/settings/AppearanceSettingsScreen.kt:375low: Code sample diff declares hunk counts that do not match its body, so the parser returns an empty hunk list (deepseek-v4.1-flash)
opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.114 · 2 pass(es) stopped early
- Slider thumb uses the strong ink in dark mode so it stays visible. - Diff line-number and marker columns grow with the Code text size. - Home sample rows show the project letter, like real Home rows. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Device check: Pixel 9a emulator, scenario harness (opencode v2, scripted model)Checked against the "Needs device check" list. Fixes from this pass are in 9a357c5 (thumb visible in dark, diff gutter grows with Code size, sample rows use the project letter). Not checked on device: maximum system font scale; Changes screen and file viewer (no dirty tree in the harness project; the shared diff component was checked through the tool sheet). |













Part of #1044 (Android half; iOS is a separate PR).
What changed
SessionListRows.OpenCodeOutgoingMessage,OpenCodeAssistantMessagewith inline code, andOpenCodeToolCallCard.OpenCodeUnifiedDiffhunk.OpenCodeThemenow defaults toopenCodeAppDarkTheme(), so the root, the privacy cover, sheets and dialogs all follow it.MainActivityre-appliesenableEdgeToEdgeso the system bar icons follow the mode. The component gallery's "System" also follows the app mode.theme/TextScale.ktaddsOpenCodeTextRegion(region). It provides aDensitywhosespvalues are the phone's own (possibly non-linear) font scaling times the region's multiplier, so everyTypographyandCodeTextStylesize inside scales and nothing outside does. Regions do not compound: a Code sheet opened from the timeline uses the Code size alone.openCodeTextScaled(dp)grows the session-row letter avatar with its text.SessionListRow, which Home, Archived sessions and session search share, plus the Home section headers.OpenCodeSessionComposer.window.terminalSetFontSize.AppearancePreferences(SharedPreferences, device-local, not per Connection Profile), initialised in the Application and cleared by Clear All Data.AppearanceSettingsViewModelwith one immutableAppearanceSettingsUiStateand explicit actions. It refreshes on resume.OpenCodeTextSizeSlider(card + stepped slider, Default tick marked), with a component gallery entry.settings_appearance_mode(mode),settings_text_size(text_region,text_size),settings_reset_text_sizes,settings_reset_appearance. iOS should use the same ids.Checks
./gradlew :app:assembleDebugpasses.:app:testDebugUnitTest: 3369 tests ran with 1 failure,DefaultForegroundEventStreamProtocolRecheckTest.reconnectAfterDrop_rechecksAndFollowsServerBackToV1. It is a timing test this PR does not touch, and it passed twice when run alone.AppearancePreferencesTest: defaults, persistence across relaunch, unknown stored values, reset text sizes keeps Mode, reset all, Clear All Data, mode resolution, step multipliers.AppearanceSettingsViewModelTest: reset enablement rules, actions, analytics, no-op actions.TextScaleTest: the scaled-density math.Needs device check
Risks / Follow-ups
shared/terminal-web/index.htmlis shared with iOS. This PR addswindow.terminalSetFontSizethere, and the iOS PR may touch the same file.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Note
Medium Risk
Wide UI/theming changes affect every main screen and the shared terminal web bundle; low security risk but high regression surface for layout and readability.
Overview
Adds Settings › Appearance controls for app-wide light/dark mode (System / Light / Dark) and per-region text size (Home list, Session Chat, Code), persisted in
AppearancePreferencesand cleared with Clear All Data.Mode drives
openCodeAppDarkTheme()throughOpenCodeTheme, including status/navigation bar styling inMainActivityand the component gallery’s “System” preview.Text sizes use
OpenCodeTextRegion/ScaledTextDensityso only wrapped surfaces scale—home session rows, chat timeline/composer, and code surfaces (diffs, file viewer code, tool/shell output, terminal viaterminalSetFontSize). The Appearance screen adds stepped sliders with live samples, reset actions,AppearanceSettingsViewModel, analytics, and unit tests.Reviewed by Cursor Bugbot for commit 90ce733. Bugbot is set up for automated code reviews on this repo. Configure here.