Repository navigation
fix(ui): preserve Daybreak toggle activation during streamed updates - #186357
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs changes before merge. What this changesThis PR memoizes shared switch input bindings to preserve native clicks during unchanged live updates. Example: A Daybreak switch receives unchanged props while the user clicks to turn it off.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — suspected (failure trace). No predecessor PR is attributed. Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR open: it addresses a demonstrated switch-click failure, but suppressing equal-value updates also breaks reconciliation with native device settings. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherSettingsToggle and SettingsToggleRow share ToggleControl, which renders native inputs from owner-provided state and reports user changes back to preference or native-device owners. flowchart LR
A[Preference or native device owner] --> B[Live component props]
B --> C[ToggleControl bindings]
C --> D[Native checkbox]
D --> E[Activation handlers]
E --> A
Technical reviewBest possible solution: Preserve native activation in the shared switch while allowing authoritative completion snapshots to restore the saved value, even when that value is unchanged. Do we have a high-confidence way to reproduce the issue? The scheduled-main failure establishes the original Daybreak symptom, and source inspection explains the equal-refresh path; this read-only review ran no reproduction. Is this the best way to solve the issue? Equality filtering is focused, but applying it to every update loses authoritative equal-value reconciliation, so the implementation needs revision. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3b7c7d68382f. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +5, Tests +24. Total +29 across 2 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 27, 2026, 6:36 PM ET / 22:36 UTC. |
|
Merged via squash.
|
…penclaw#186357) * fix(ui): preserve native switch activation during equal props refreshes * fix(ui): isolate access toggle from unchanged streamed snapshots * test(ui): fold activation regression into model control coverage
What Problem This Solves
Fixes the Daybreak switch occasionally ignoring a click while streamed session snapshots refresh otherwise unchanged access preferences.
User Impact
Turning Daybreak off sends the Standard preference, and turning it on selects the available remembered/default program. Native device settings continue to reconcile with their owner's returned snapshots.
Why This Change Was Made
An unchanged access snapshot could dirty the shared switch's grouped input bindings between native checkbox activation and its change event. That restored the old checked value before the callback read it. Memoize the Daybreak enabled/disabled projections at the access-control boundary so equal streamed values do not rerun those bindings. The shared switch and native settings contracts remain unchanged.
Evidence
Scheduled main run: https://github.com/openclaw/openclaw/actions/runs/40569017511. Failing case:
ui/src/e2e/chat-daybreak.real-gateway.e2e.test.ts—Daybreak through a real built Gateway > persists visible selections and refreshes queued requests on desktop.The new native-click regression fails on the base by requesting Daybreak again instead of Standard during an unchanged snapshot refresh, and passes with the fix. All 43 focused model-controls, shared-settings, and native-device tests pass. The native-device cases caught regressions in the initial shared-control approach; the final change is confined to Daybreak's projection and restores those contracts without editing their tests. The final diff adds two primitive memos and folds the regression into existing model-controls coverage. Consolidating fixture duplication preserves every original assertion and reduces total test lines by three. No sleeps, timeout changes, baseline changes, or assertion weakening are included.
The original built-Gateway scenario remains unverified locally: it was absent from the first PR CI selection, and a Testbox allocation queued without running a payload and was cancelled. No live-proof success is claimed.
Default chat-test tsrs, typed UI lint, formatting, size ratchets, and the Control UI controller guard pass. Independent P0–P2 review is clean. A separate local browser attempt failed during production-build setup before tests ran; it provides no behavioral verdict. No dependency, lint-baseline, or timeout changes were made.
The prior PR CI revision passed all UI and typecheck jobs but exceeded the repository-wide test-line ceiling: main was already 251 lines over, and the separate regression added 43. The final version adds no net test lines and preserves the regression at the full model-controls boundary.