Uh oh!
There was an error while loading. Please reload this page.
refactor(mobile): compile semantic themes for Uniwind - #7327
Conversation
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Uh oh!
There was an error while loading. Please reload this page.
commented
Aug 20, 2026
closing because this is explicitly marked |
24177f7 to
9904182CompareUh oh!
There was an error while loading. Please reload this page.
commented
Aug 28, 2026 •
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This is a broad 110-file mobile theming migration that changes shared runtime theme selection, native appearance synchronization, compiled theme registration, and rendering across most screens. The generated assets and tests help constrain the change, but its production blast radius and new theming infrastructure are too substantial for an automated approval recommendation. You can add or adjust custom eligibility rules. Learn more. |
9904182 to
7655a9dCompare7655a9d to
9a2f759CompareUh oh!
There was an error while loading. Please reload this page.
9a2f759 to
5c2519aCompareUh oh!
There was an error while loading. Please reload this page.
5c2519a to
113da07CompareUh oh!
There was an error while loading. Please reload this page.
8620732 to
7f68a2aComparef8b0097 to
fe12832CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
f4f7bb6 to
222deb2CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
5e55533 to
47ff252CompareUh oh!
There was an error while loading. Please reload this page.
8aa218f to
a77ec4cCompare
left a comment
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Bugbot Autofix is ON, but a cloud agent failed to start.
Reviewed by Cursor Bugbot for commit a77ec4c59bf2939d6c255e8f28d4d60ba34670e2. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
a77ec4c to
3aca002CompareUh oh!
There was an error while loading. Please reload this page.
3aca002 to
2d94231CompareCo-authored-by: codex <codex@users.noreply.github.com>
2d94231 to
c39f3e4Compare
Problem
Mobile theme colors were resolved through per-component CSS variable subscriptions and scattered JavaScript color props. Palette changes therefore reconciled across many React consumers, and custom registered themes could miss
dark:orlight:utility branches.Solution
light/darkCSS variants, and compile the other five palettes in both appearances as registered Uniwind themes.global.cssis now the sole source for T3 Code’s default color values.className,colorClassName, andtintColorClassNamestyling.dark:/light:utilities, CSS-variable subscriptions, or undocumented palette bridges.uniwinddependency and native fingerprint frommain; this PR contains no Pro package, license, Nitro bump, or evaluation binary.Verification
vp run --filter @t3tools/mobile generatevp test run apps/mobile/scripts/generate-uniwind-themes.test.ts apps/mobile/src/lib/mobileTheme.test.ts apps/mobile/src/lib/mobileThemeRuntime.test.ts apps/mobile/src/features/review/nativeReviewDiffAdapter.test.ts apps/mobile/src/features/terminal/terminalTheme.test.ts— 35 tests passedvp test run oxlint-plugin-t3code— 71 tests passedvp run --filter @t3tools/mobile typecheckvp run --filter oxlint-plugin-t3code typecheckvp lint apps/mobile oxlint-plugin-t3code --report-unused-disable-directivesvp run lint:mobile— SwiftLint, ktlint, and Detekt passedUI evidence
main)Split light/dark selection:
Interaction demo: https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/75369d3b7dfc982f/t3code-free-uniwind-theme-demo.mp4
Built with GPT-5 Codex.
Note
Medium Risk
Wide UI refactor touching theming across most mobile screens; incorrect generated tokens or theme registration could cause subtle contrast or palette bugs, though behavior is covered by generator and theme runtime tests.
Overview
This PR replaces per-component
useThemeColorsubscriptions with Uniwind-driven styling so palette switches reconcile through CSS variants instead of many React color props.A new
generate-uniwind-themesscript (wired viapnpm generate) emitsgenerated-uniwind-themes.css, theme name list, and default-variable JSON. It registers five built-in palettes (T3 Chat, Grove, Ocean, Ember, Iris) as{palette}-light/{palette}-darkUniwind variants, adds adaptive semantic tokens for values that used to rely ondark:/light:utilities, and keeps T3 Code’s default colors authored only inglobal.css. Metro loadsextraThemesfrom the generated manifest and imports the generated CSS.Across the app, surfaces move to
className,tintColorClassName, andcolorClassName(includingwithUniwindonSymbolView, glass, wordmark, and similar).useUniwindThemeremains for native/third-party APIs that need raw CSS variables (markdown, diff themes, swipe backgrounds).useMobileNavigationThemeno longer takes a theme argument; status bar background color props are dropped in favor of translucent styling.Reviewed by Cursor Bugbot for commit c39f3e4. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Migrate mobile theming from
useThemeColorto Uniwind semantic classesuseThemeColorhook calls withuseUniwindThemeand class-based tint props (tintColorClassName,colorClassName) across nearly all mobile components, so icon, text, and surface colors resolve via CSS class tokens instead of computed runtime valuesapps/mobile/src/lib/useThemeColor.tsand adds generated Uniwind theme assets: a build script (generate-uniwind-themes.mts), CSS variable definitions (generated-uniwind-themes.css), and JSON theme maps loaded via Metro configAppearancePreferencesProviderto wrap the app inScopedTheme, apply theme runtime operations granularly (including nativeAppearance.setColorScheme), and apply theme switches urgently while deferring non-theme preference savesuseMobileNavigationThemeparameterless — it now reads appearance from the provider and derives colors from a single Uniwind paletteno-mobile-uniwind-theme-escape-hatchesto flag unapproved escape hatches likeuseCSSVariableand appearance variants in mobile sourcegetMobileThemeVariablesno longer accepts the default theme id and always derives variables from the theme palette; callers ofcreateNativeReviewDiffThememust now pass an explicitappTheme: MobileThemeVariables.useMobileNavigationThemesignature changed to take no arguments, so existing call sites passingthemeAppearanceare updated in-treeMacroscope summarized c39f3e4.