Repository navigation
fix(android): gateway accent color is fetched but never applied to the app theme - #128702
Conversation
The Android app fetched config.ui.seamColor into a StateFlow that no Compose surface consumed, so gateway accents were silently dropped. The accent now resolves with Control UI precedence (ui.prefs.accent over ui.seamColor) and overrides the Claw accent/accentSoft/accentBorder tokens in ShellScreen and OnboardingFlow; Material You system chrome is untouched. With no gateway accent set the hardcoded ClawDark/ClawLight palettes apply unchanged, replacing two mismatched hardcoded defaults.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 24, 2026, 7:53 AM ET / 11:53 UTC. ClawSweeper reviewWhat this changesThe PR resolves gateway UI accent configuration and passes it into Android’s shell and onboarding Compose themes. Merge readinessKeep open: the gateway accent refresh is never invoked after connection, so the new Compose consumers still receive null and the claimed Android behavior remains inactive. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherAndroid connects to the gateway, reads configuration into runtime state, and Compose observes that state to render application colors. Gateway UI preferences and seam colors are inputs; shell and onboarding themes are the outputs. flowchart LR
A[Gateway UI configuration] --> B[Operator connection]
B --> C[Branding refresh]
C --> D[Accent state]
D --> E[Shell theme]
D --> F[Onboarding theme]
E --> G[Compose accent tokens]
F --> G
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceOther +93. Total +93 across 8 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Invoke the existing branding refresh from the successful operator-connection coroutine, preserve nullish preference precedence before string parsing, and add a connection-boundary regression that observes the resulting accent state. Do we have a high-confidence way to reproduce the issue? Yes—source reproducibly shows no caller for the sole branding refresh, so a successful connection leaves the accent state null. Is this the best way to solve the issue? No—the theme wiring needs a connection trigger, and the resolver must select the user preference before type parsing to match the gateway contract. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0d840c0fce11. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…cent precedence ClawSweeper findings: refreshBrandingFromGateway had no call site (the accent state stayed null), and a present non-string user accent must not fall through to seamColor per the gateway's nullish selection. The refresh now runs in the post-connection coroutine alongside wake-word and exec-approval refreshes.
|
Both ClawSweeper findings addressed in 7dd2345:
Validation on the new head: full |
|
Merged via squash.
|
…e app theme (openclaw#128702) * fix(android): apply the gateway accent color to the Claw design theme The Android app fetched config.ui.seamColor into a StateFlow that no Compose surface consumed, so gateway accents were silently dropped. The accent now resolves with Control UI precedence (ui.prefs.accent over ui.seamColor) and overrides the Claw accent/accentSoft/accentBorder tokens in ShellScreen and OnboardingFlow; Material You system chrome is untouched. With no gateway accent set the hardcoded ClawDark/ClawLight palettes apply unchanged, replacing two mismatched hardcoded defaults. * fix(android): invoke branding refresh on connect and match gateway accent precedence ClawSweeper findings: refreshBrandingFromGateway had no call site (the accent state stayed null), and a present non-string user accent must not fall through to seamColor per the gateway's nullish selection. The refresh now runs in the post-connection coroutine alongside wake-word and exec-approval refreshes.
…e app theme (openclaw#128702) * fix(android): apply the gateway accent color to the Claw design theme The Android app fetched config.ui.seamColor into a StateFlow that no Compose surface consumed, so gateway accents were silently dropped. The accent now resolves with Control UI precedence (ui.prefs.accent over ui.seamColor) and overrides the Claw accent/accentSoft/accentBorder tokens in ShellScreen and OnboardingFlow; Material You system chrome is untouched. With no gateway accent set the hardcoded ClawDark/ClawLight palettes apply unchanged, replacing two mismatched hardcoded defaults. * fix(android): invoke branding refresh on connect and match gateway accent precedence ClawSweeper findings: refreshBrandingFromGateway had no call site (the accent state stayed null), and a present non-string user accent must not fall through to seamColor per the gateway's nullish selection. The refresh now runs in the post-connection coroutine alongside wake-word and exec-approval refreshes.
What Problem This Solves
Fixes an issue where setting a gateway accent color (the Control UI user accent or the operator
ui.seamColor) had no effect in the Android app. The app fetched the color from the gateway on every connect and then silently dropped it: the value landed in a StateFlow with zero Compose consumers, so the app always rendered its hardcoded blue accent.Why This Change Was Made
The fetch side already existed (
refreshBrandingFromGatewayreadsconfig.get), so the missing piece was precedence and consumption:ui.prefs.accent ?? ui.seamColor(a present user accent wins, matchingsrc/gateway/server-methods/talk.ts), extracted into a pure, testedresolveGatewayAccentArgbhelper.ClawDesignThemeaccepts the accent and overrides only the three Claw accent tokens:accentdirectly,accentSoftcomposited over the canvas (0.25 alpha dark / 0.08 light, matching the ratios of the existing hardcoded pairs),accentBorderas a 12% lerp toward black. The outer Material You dynamic color scheme is deliberately untouched — system chrome stays platform-native.StateFlow<Long?>withnullmeaning "no gateway accent", which dissolves a latent default mismatch (DEFAULT_SEAM_COLOR_ARGB = 0xFF4F7A9Ain NodeUtils vs0xFF0EA5E9in MainViewModel): both magic defaults are deleted and the hardcoded ClawDark/ClawLight palettes remain the canonical no-accent state.User Impact
Android operators who set a user accent in the Control UI (or an operator seam color) now see it applied across the app shell and onboarding. With no accent configured, nothing changes.
Evidence
resolveGatewayAccentArgbprecedence table test (accent wins; seamColor fallback; present-but-invalid accent does not fall through, per the??contract; non-string/null/absent cases;#RRGGBBand bare hex) andClawColorsTest(null accent returns the exact hardcoded dark/light palettes; override touches only the three accent tokens). Both new tests fail on pre-fix code.pnpm android:format,pnpm android:lint, and the full:app:testPlayDebugUnitTestlane: 2,136 tests, 0 failures.