Skip to content

refactor(mobile): share theme mapping across Android controls - #19217

Merged
juliusmarminge merged 3 commits into
t3/mobile-native-theme-hostfrom
t3/mobile-native-control-themes
Oct 15, 2026
Merged

juliusmarminge merged 3 commits into
t3/mobile-native-theme-hostfrom
t3/mobile-native-control-themes

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Design-system progress

API adoption and Pen rendering are tracked separately. This is cumulative through this PR, not a claim that all native renderers are finished.

Pen component After this PR
Host / native theme Colors only; native typography and shapes left
List / Section / Row Shared RN rows; native Form / ListItems left
Toggle Native switches; Android checkmark treatment left
Segmented Later in stack
Menu Later in stack
Sheet Later in stack
Dialog Later in stack
SearchField Later in stack
Button / IconButton Later in stack
Chip Shared RN chip; native Android variants left
Toast Later in stack
FAB Later in stack
Toolbar Later in stack
AppBar Later in stack
Picker / Slider / Stepper Partial; iOS native slider and picker family left
Progress / EmptyState Later in stack
Typography / shapes / motion Later in stack
Split / list-detail / rail Deferred broader layout work

Custom Appearance cards stay. Segmented controls stay native. Composer, thread-row and task-tray redesigns remain deferred.

Problem

Android controls create separate Compose Hosts, which can use a generated Material palette instead of the selected app theme. Radio indicators work around this by drawing a custom control for every non-system theme.

Change

Use the shared themed Host in buttons, icon buttons, switches, radio indicators, loading indicators, confirmation dialogs, menus, and floating actions. Radio indicators can now use Compose for all themes. Existing cards, layouts, sizing, interactions, and explicit control colors stay in place. This applies through the existing shared components in settings, thread controls, and other screens.

Validation: Android native client rebuilt successfully; 65 focused theme/dependency tests, mobile typecheck, and targeted lint passed. React Doctor found no issues in the changed files (91/100). Verified radio selection in Keyboard, dialogs and menus, all six themes in light/dark, and switching to Material You. Radio indicators retain the existing text-accent contrast. iOS is unchanged.

Android controls across all six themes, light and dark

Keyboard: before (left), after (right); custom cards preserved

Confirmation dialog: before (left), after (right)

Menu: before (left), after (right)

Appearance retains its custom cards

Scope and approval

The external-contributor triaged-issue requirement does not apply to this maintainer-authored work. It was requested by Julius as the next mobile design-system layer, retaining custom cards and screen layouts. Scope is the existing Android controls listed above; iOS is unchanged. The theme matrix and before/after captures support human visual review. Macroscope flags this cross-cutting UI change for human review; this PR is not approved to merge.

Model: GPT-6.1. Harness: Codex.


Devin Review

@juliusmarminge
juliusmarminge added this pull request to stack #19218 October 14, 2026 02:14
@juliusmarminge juliusmarminge changed the title refactor(mobile): share the theme across native Android controls refactor(mobile): share theme mapping across Android controls Oct 14, 2026
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Oct 14, 2026
@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 14, 2026
@juliusmarminge
juliusmarminge force-pushed the t3/mobile-native-control-themes branch from 982df58 to bb75e89 Compare October 14, 2026 02:17
@juliusmarminge
juliusmarminge marked this pull request as ready for review October 14, 2026 02:17
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 5.0 KiB — 6.8 KiB ✅
Codex Thread snapshot wire — 3.8 KiB — 4.9 KiB ✅
Codex Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Codex Live turn WebSocket decoded — 20.9 KiB — 29.3 KiB ✅
Codex Live turn messages — 2 — 8 ✅
Claude Total thread wire — 5.0 KiB — 6.8 KiB ✅
Claude Thread snapshot wire — 3.8 KiB — 4.9 KiB ✅
Claude Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Claude Live turn WebSocket decoded — 21.2 KiB — 29.3 KiB ✅
Claude Live turn messages — 2 — 8 ✅

Baseline: unavailable · PR result: 583aaf7 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@macroscopeapp

macroscopeapp Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This change applies a new resolved Material palette to many existing Android controls and switches custom-theme radio indicators to Compose rendering. Because it changes user-visible behavior across dialogs, menus, actions, switches, and buttons, the cross-cutting runtime impact warrants human review.

No code changes detected at 583aaf7. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 21d6c886-fa84-45a0-9482-1d06e94e76b5
📥 Commits

Reviewing files that changed from the base of the PR and between b62b3b9 and 583aaf7.

📒 Files selected for processing: 1
  • apps/mobile/src/components/Button.android.tsx

Limit details: You’ve used all 10 included reviews currently available. Your 26 included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.

📝 Walkthrough

Android components now use NativeThemeHost instead of Compose Host. Most components no longer pass an explicit host colorScheme. MaterialRadioIndicator always renders an Expo RadioButton, and SliderRow imports the Android-specific theme host module.

Changes: Android theme host and controls

Layer / File(s) Summary
Replace Compose Host wrappers
apps/mobile/src/components/AppActivityIndicator.android.tsx, apps/mobile/src/components/MaterialConfirmDialog.android.tsx, apps/mobile/src/components/MaterialFloatingActionButton.android.tsx, apps/mobile/src/components/MaterialIconButton.android.tsx, apps/mobile/src/components/MaterialMenuPopup.android.tsx, apps/mobile/src/components/MaterialScrollComposeButton.android.tsx, apps/mobile/src/components/MaterialSwitch.android.tsx, apps/mobile/src/components/SliderRow.android.tsx, apps/mobile/src/components/Button.android.tsx
These components use NativeThemeHost in place of Compose Host. Explicit host colorScheme props are removed where they were present. Existing layout and inset settings remain. SliderRow uses the Android-specific import.
Radio indicator rendering
apps/mobile/src/components/MaterialRadioIndicator.android.tsx
The component always renders an Expo RadioButton inside NativeThemeHost. It uses control-theme colors when system colors are inactive and empty color overrides when they are active.

Priority: ➖ Normal

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 583aa

The Android button now uses the shared theme host without a reported change to its colors or behavior. No actionable merge-blocking risk is established.

Pre-merge checks: Passed 4
Check name Status Explanation
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.
Title check Passed The title clearly and concisely describes the main change: sharing theme mapping across Android controls.
Description check Passed The description covers the problem, implementation, scope, approval context, validation results, affected platforms, and visual evidence. Verification details are included under the Change section rat…
✨ Finishing Touches: 💡 1
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@juliusmarminge
juliusmarminge force-pushed the t3/mobile-native-control-themes branch from b62b3b9 to 583aaf7 Compare October 15, 2026 22:24
@juliusmarminge
juliusmarminge merged commit e028a08 into main Oct 15, 2026
35 of 53 checks passed
@juliusmarminge
juliusmarminge deleted the t3/mobile-native-control-themes branch October 15, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant