Repository navigation
fix(macos): user accent from Control UI is clobbered by config snapshots and never live-updates the chat window - #128703
Conversation
…update chat window The Control UI user accent (ui.prefs.accent) landed in #128432/#128577 with precedence user accent -> operator ui.seamColor -> theme default, and the gateway's talk.config payload already applies it. The macOS app had two gaps: - ChannelsStore.applyUIConfig read raw ui.seamColor from the config.get snapshot and clobbered the user accent set from talk.config depending on arrival order. It now resolves ui.prefs.accent ?? ui.seamColor via a testable helper mirroring the gateway precedence. - The native chat window read AppStateStore.seamColorHex once at window construction, so accent changes never live-updated. MacChatSurface now reads the @observable store in body, deleting the one-shot userAccent plumbing. Docs: configuration-reference.md documents the precedence for native-app chrome. Regression test fails pre-fix (snapshot returned the operator seam color instead of the user accent).
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 24, 2026, 8:25 AM ET / 12:25 UTC. ClawSweeper reviewWhat this changesThe PR preserves the Control UI user accent in macOS configuration snapshots, refreshes configuration after Gateway change notifications, and makes native chat windows read the shared accent reactively. Merge readinessKeep open: the new Gateway push listener is active only while Cron Settings is selected, so a normal open chat window still does not receive Control UI accent changes. Priority: P2 Review scores
Verification
How this fits togetherGateway emits a hash-only configuration-change event after persisted edits; the macOS app must refetch configuration and update shared UI state. Native chat windows render their accent from that shared state. flowchart LR
A[Control UI accent edit] --> B[Gateway configuration]
B --> C[Configuration change event]
C --> D[macOS app lifecycle consumer]
D --> E[Shared accent state]
E --> F[Open native chat window]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceDocs +3, Other +104. Total +107 across 7 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Move the config-change subscription and snapshot-to-AppStateStore update to a lifecycle owner active whenever native chat is visible, and remove the Cron Settings coupling. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: open a native chat without Cron Settings selected, then change the Control UI accent; no ChannelsStore push subscription exists because its only start call is in CronSettings. Is this the best way to solve the issue? No: the refresh logic is correct in isolation, but its owner is inactive for ordinary chat use; it belongs with app or chat visibility lifecycle rather than Cron Settings. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 03658a99a950. LabelsLabel 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
HistoryReview history (1 earlier review cycle)
|
Addresses the review finding that no macOS consumer turned the gateway's hash-only config.changed broadcast into refreshed shared state, so a Control UI accent change never reached an open native chat window while the app ran. ChannelsStore now subscribes to gateway pushes and re-fetches config.get on config.changed, reconnect snapshots, and sequence gaps. The refresh applies non-force so an in-progress local settings draft wins (the gateway rejects stale-hash writes anyway). The in-flight reload queue gains a closed pending level (none/refresh/force) so a refresh arriving during a load is coalesced instead of dropped, and a requeued refresh cannot clobber a dirty draft the way the old boolean force-pending did.
|
Merged via squash.
|
…ots and never live-updates the chat window (openclaw#128703) * fix(macos): honor user accent precedence in config snapshot and live-update chat window The Control UI user accent (ui.prefs.accent) landed in openclaw#128432/openclaw#128577 with precedence user accent -> operator ui.seamColor -> theme default, and the gateway's talk.config payload already applies it. The macOS app had two gaps: - ChannelsStore.applyUIConfig read raw ui.seamColor from the config.get snapshot and clobbered the user accent set from talk.config depending on arrival order. It now resolves ui.prefs.accent ?? ui.seamColor via a testable helper mirroring the gateway precedence. - The native chat window read AppStateStore.seamColorHex once at window construction, so accent changes never live-updated. MacChatSurface now reads the @observable store in body, deleting the one-shot userAccent plumbing. Docs: configuration-reference.md documents the precedence for native-app chrome. Regression test fails pre-fix (snapshot returned the operator seam color instead of the user accent). * fix(macos): refresh config from gateway config.changed events Addresses the review finding that no macOS consumer turned the gateway's hash-only config.changed broadcast into refreshed shared state, so a Control UI accent change never reached an open native chat window while the app ran. ChannelsStore now subscribes to gateway pushes and re-fetches config.get on config.changed, reconnect snapshots, and sequence gaps. The refresh applies non-force so an in-progress local settings draft wins (the gateway rejects stale-hash writes anyway). The in-flight reload queue gains a closed pending level (none/refresh/force) so a refresh arriving during a load is coalesced instead of dropped, and a requeued refresh cannot clobber a dirty draft the way the old boolean force-pending did.
What Problem This Solves
Fixes an issue where macOS app users who set a Control UI user accent (
ui.prefs.accent, landed in #128432/#128577) would see the native app chrome fall back to the operatorui.seamColor— or a stale color — depending on which gateway payload arrived last, and where accent changes never reached a running app at all. Three defects:ChannelsStore.applyUIConfigread rawui.seamColorfrom theconfig.getsnapshot and overwroteAppStateStore.seamColorHex, clobbering the user accent thatTalkModeRuntime.applyTalkConfighad set from thetalk.configpayload (which already applies the precedence server-side).AppStateStore.seamColorHexonce at window construction, so accent changes never live-updated the window'suserAccent.config.changedbroadcast, soChannelsStore's config snapshot was loaded once at startup and a Control UI accent change (or any config change) never refreshed shared state while the app ran (flagged by ClawSweeper's review; addressed in the second commit).Why This Change Was Made
The accent precedence contract (user accent → operator
ui.seamColor→ theme default) must hold on every path that feeds native-app chrome, and a Control UI edit must end in a visible outcome in the running app. The snapshot path now resolvesui.prefs.accent ?? ui.seamColorthrough a testable helper (ChannelsStore.uiAccent) mirroringsrc/gateway/server-methods/talk.ts. The chat window derives its accent insideMacChatSurface.bodyfrom the@ObservableAppStateStore(deleting the one-shotuserAccentinit plumbing), so any accent change recolors open windows.ChannelsStorenow subscribes to gateway pushes (same idiom asInstancesStore) and re-fetchesconfig.getonconfig.changed, reconnect snapshots, and sequence gaps; the refresh applies non-force so an in-progress local settings draft wins, and the in-flight reload queue's pending flag became a closed level (none/refresh/force) so refreshes arriving mid-load are coalesced instead of dropped and a requeued refresh cannot clobber a dirty draft.User Impact
User accent set in the Control UI now sticks in the macOS app regardless of payload arrival order, propagates to a running app without restart, and recolors open native chat windows live. Docs (
docs/gateway/configuration-reference.md) document the precedence for native-app chrome.Evidence
ChannelsStoreUIConfigTests(5 tests): precedence, whitespace fallback, both-absent → nil, a real-ConfigSnapshotregression throughapplyConfigSnapshot(fails pre-fix: returned operator seam#445566instead of user accent#112233), and gateway-push refresh classification (config.changed/snapshot/seqGap refresh; unrelated events don't).ChannelsSettingsSmokeTests(8 tests) extended: reload queue coalesces a refresh during an in-flight load, force stays sticky over refresh, and non-force snapshots leave dirty drafts intact.swift buildgreen; both suites pass; repo SwiftFormat macOS lane clean (0/26).body).