Skip to content

fix(android): gateway accent color is fetched but never applied to the app theme - #128702

Merged
steipete merged 2 commits into
mainfrom
steipete/musing-bartik-784f7c
Aug 24, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/musing-bartik-784f7c

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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 (refreshBrandingFromGateway reads config.get), so the missing piece was precedence and consumption:

  • Accent resolution now follows the landed Control UI contract from feat(ui): user-selectable accent color for the Control UI #128432/fix(ui): propagate user accent to Talk Mode and widget frames #128577: ui.prefs.accent ?? ui.seamColor (a present user accent wins, matching src/gateway/server-methods/talk.ts), extracted into a pure, tested resolveGatewayAccentArgb helper.
  • ClawDesignTheme accepts the accent and overrides only the three Claw accent tokens: accent directly, accentSoft composited over the canvas (0.25 alpha dark / 0.08 light, matching the ratios of the existing hardcoded pairs), accentBorder as a 12% lerp toward black. The outer Material You dynamic color scheme is deliberately untouched — system chrome stays platform-native.
  • The flow is now StateFlow<Long?> with null meaning "no gateway accent", which dissolves a latent default mismatch (DEFAULT_SEAM_COLOR_ARGB = 0xFF4F7A9A in NodeUtils vs 0xFF0EA5E9 in 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

  • Production LOC: +39/−17 (net +22, all accent derivation + wiring) | Tests: +91/−0.
  • resolveGatewayAccentArgb precedence table test (accent wins; seamColor fallback; present-but-invalid accent does not fall through, per the ?? contract; non-string/null/absent cases; #RRGGBB and bare hex) and ClawColorsTest (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:testPlayDebugUnitTest lane: 2,136 tests, 0 failures.
  • Codex autoreview (gpt-5.6-sol, high) on the exact diff: clean, no actionable findings.
  • UI screenshot proof: not captured — this session has no Android device/emulator rig; the change is covered by the palette-derivation unit tests above.

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

clawsweeper Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 24, 2026 11:47
@openclaw-barnacle openclaw-barnacle Bot added app: android App: android size: S maintainer Maintainer-authored PR labels Aug 24, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 24, 2026
@clawsweeper

clawsweeper Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 24, 2026, 7:53 AM ET / 11:53 UTC.

ClawSweeper review

What this changes

The PR resolves gateway UI accent configuration and passes it into Android’s shell and onboarding Compose themes.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep 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
Reviewed head: dd23671e52aaf4195d1867ffe121d0fbcea91ad4

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The parser and palette tests are useful, but they miss the connection-to-state path that makes the feature observable.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; the source-backed correctness findings still block merge.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; the source-backed correctness findings still block merge.
Evidence reviewed 5 items Uninvoked owner refresh: The sole branding-refresh method is defined but has no call site; the successful operator connection only starts session, wake-word, and approval refreshes, leaving the new accent state null.
Established precedence contract: Gateway Talk selects ui.prefs.accent before ui.seamColor, then checks whether that selected value is a string; the PR filters the preference to strings before fallback.
Incorrect non-string case is codified by test: The added test expects a numeric user preference to fall through to seamColor, contrary to the established nullish-precedence behavior.
Findings 2 actionable findings [P1] Invoke branding refresh after the operator connection
[P2] Preserve non-string preference precedence before parsing
Security None None.

Live Verification

Command: pnpm android:test

Result: FAIL (partial) — step 2 expect_output BUILD SUCCESSFUL: expected terminal output was not visible within 30 seconds: "BUILD SUCCESSFUL"

pnpm android:test
runner@runnervm76f27:/tmp/clawsweeper-live-proof-128702-kkhGtf/target$ pnpm android:test
$ node --import tsx scripts/run-android-gradle.mts :app:testPlayDebugUnitTest :wear:testDebugUnitTest :wear-shared:testDebugUnitTest
pnpm android:test
Fetching distribution.
Downloading https://services.gradle.org/distributions/gradle-9.7.0-bin.zip
..............10%..............20%..............30%...............40%..............50%...............60%..............70%..............80%...............90%....
..........100%

Welcome to Gradle 9.7.0!

Here are the highlights of this release:
 - Isolated Projects graduates to incubating
 - Broader Configuration Cache compatibility
 - More source locations in problem reports

For more details see https://docs.gradle.org/9.7.0/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)
│···············│ 0% CONFIGURING [15s]
› root project › Resolve dependencies of detachedConfiguration4 › org.jlleitschuh.gradle.ktlint.gradle.plugin-14.2.0.pom






























Assertions:

  • FAIL expect_output: BUILD SUCCESSFUL

How this fits together

Android 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
Loading

Before merge

  • Invoke branding refresh after the operator connection (P1) - refreshBrandingFromGateway has no callers: the successful connection coroutine runs other refreshes but never this one. _gatewayAccentArgb therefore stays null and the new Compose consumers retain their hardcoded palettes, so the claimed fix never becomes visible.
  • Preserve non-string preference precedence before parsing (P2) - The gateway selects ui.prefs.accent ?? ui.seamColor before checking the selected value’s type. This code filters a numeric preference first and falls through to seamColor; a present non-string preference should instead result in no override.
  • Resolve merge risk (P1) - The net +22 production lines currently add inactive runtime/theme plumbing because no connection path invokes the existing configuration request.

Findings

  • [P1] Invoke branding refresh after the operator connection — apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt:5534-5536
  • [P2] Preserve non-string preference precedence before parsing — apps/android/app/src/main/java/ai/openclaw/app/node/NodeUtils.kt:83-84
Agent review details

Security

None.

PR surface

Other +93. Total +93 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 8 110 17 +93
Total 8 110 17 +93

Review metrics

Metric Value Why it matters
Production vs tests production +39/-17 (net +22); tests +71/-0 The production growth is not justified until the connection path actually triggers the added accent state.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    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.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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:

  • [P1] Invoke branding refresh after the operator connection — apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt:5534-5536
    refreshBrandingFromGateway has no callers: the successful connection coroutine runs other refreshes but never this one. _gatewayAccentArgb therefore stays null and the new Compose consumers retain their hardcoded palettes, so the claimed fix never becomes visible.
    Confidence: 0.99
  • [P2] Preserve non-string preference precedence before parsing — apps/android/app/src/main/java/ai/openclaw/app/node/NodeUtils.kt:83-84
    The gateway selects ui.prefs.accent ?? ui.seamColor before checking the selected value’s type. This code filters a numeric preference first and falls through to seamColor; a present non-string preference should instead result in no override.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 0d840c0fce11.

Labels

Label changes:

  • add P2: This is a bounded Android presentation regression, but the submitted patch does not yet repair it.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; the source-backed correctness findings still block merge.

Label justifications:

  • P2: This is a bounded Android presentation regression, but the submitted patch does not yet repair it.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; the source-backed correctness findings still block merge.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main blame and recent history attribute the Android connection, branding, and theme surfaces to Peter Steinberger. (role: recent area contributor; confidence: high; commits: 68ba1ef641e5, d095113698b6; files: apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt, apps/android/app/src/main/java/ai/openclaw/app/ui/design/ClawTheme.kt)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Invoke the branding refresh from the successful operator-connection path and prove the resulting accent state changes.
  • Update the precedence test so a non-string user preference does not fall through to the seam color.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

…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.
@steipete

Copy link
Copy Markdown
Contributor Author

Both ClawSweeper findings addressed in 7dd2345:

  • Invoke branding refresh after the operator connection (P1): refreshBrandingFromGateway() now runs in the post-connection coroutine alongside the wake-word and exec-approval refreshes (NodeRuntime.kt). This was pre-existing dead code — the accent fetch had no call site even before this PR — and it also resolves the "+22 inactive plumbing" merge-risk item: the runtime path is now live end to end.
  • Preserve non-string preference precedence before parsing (P2): resolveGatewayAccentArgb now applies exact ?? selection — any present non-JSON-null ui.prefs.accent wins (including non-strings, which then yield no override) and only absent/null falls through to ui.seamColor. The precedence test's numeric-accent case now expects no fallback.

Validation on the new head: full :app:testPlayDebugUnitTest (BUILD SUCCESSFUL), :app:ktlintCheck, fresh Codex autoreview clean. The earlier live-verification FAIL was the sandbox's 30s output timeout during the first-run Gradle distribution download, not a test failure.

@steipete
steipete merged commit f90a9c7 into main Aug 24, 2026
59 checks passed
@steipete
steipete deleted the steipete/musing-bartik-784f7c branch August 24, 2026 12:43
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

threely-lab pushed a commit to threely-lab/openclaw that referenced this pull request Aug 25, 2026
…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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 25, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant