Skip to content

fix(ui): preserve Daybreak toggle activation during streamed updates - #186357

Merged
steipete merged 3 commits into
mainfrom
fix/ci-settings-switch-405690
Oct 27, 2026
Merged

steipete merged 3 commits into
mainfrom
fix/ci-settings-switch-405690

Conversation

@steipete

@steipete steipete commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

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.

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Oct 27, 2026
@steipete
steipete marked this pull request as ready for review October 27, 2026 22:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T23:06:59.912136Z 4ae98da New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This 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.

  • Before: The refresh can restore checked=true before change fires, so the selection remains enabled.
  • After: Equal bindings no longer rerun the input update, allowing change to report false.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful and narrowly scoped, but current-head CI corroborates a concrete reconciliation regression; after-fix verification remains component-level.
Proof confidence 🦐 gold shrimp (3/6) The maintainer-authored PR is outside the ordinary contributor proof gate; its supplied verification exercises the real input component in process, while the body explicitly disclaims an after-fix built-Gateway result.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A settings switch can ignore a click when an unrelated live refresh arrives during native activation.
Reason: Reliable switch activation has clear user value, and the maintainer-authored direction preserves the existing preference ownership.

Regression provenance

Possible 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
Reviewed head: 78512d02a645285fa735fc8cbd36f1d7d0753a42

Before merge

  • Preserve reconciliation with unchanged authoritative snapshots (P2) - Memoizing all input bindings prevents the input from being rewritten when its owner publishes the same primitive values after a completed edit. DevicePage's ordinary Toggle delegates to the native capability without optimistic checked state, and that capability republishes the saved snapshot after completion or failure. For example, enable Keep computer awake while its saved value is false, then receive another snapshot with false: every memo remains equal, so the checkbox stays true despite the native owner reporting false. Current-head CI confirms this at device-pages.test.ts:289 and also fails the Gateway-hosting reconciliation assertion at :234. Preserve the in-click refresh protection without suppressing authoritative completion reconciliation.

Findings

  • [P2] Preserve reconciliation with unchanged authoritative snapshots — ui/src/components/solid/settings-ui.tsx:284-287

Tests

  • Missing end-to-end proof: The PR explicitly leaves the original built-Gateway Daybreak scenario unverified after the fix.
Agent review details

How this fits together

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

Technical review

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

  • [P2] Preserve reconciliation with unchanged authoritative snapshots — ui/src/components/solid/settings-ui.tsx:284-287
    Memoizing all input bindings prevents the input from being rewritten when its owner publishes the same primitive values after a completed edit. DevicePage's ordinary Toggle delegates to the native capability without optimistic checked state, and that capability republishes the saved snapshot after completion or failure. For example, enable Keep computer awake while its saved value is false, then receive another snapshot with false: every memo remains equal, so the checkbox stays true despite the native owner reporting false. Current-head CI confirms this at device-pages.test.ts:289 and also fails the Gateway-hosting reconciliation assertion at :234. Preserve the in-click refresh protection without suppressing authoritative completion reconciliation.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 3b7c7d68382f.

Provenance checked

  • Native switch input bindings changes intended behavior with a stated reason (eca633a: The Solid migration retained native input behavior, controlled rejection, and authoritative owner updates.)
  • Saving versus disabled behavior keeps the original intent (4a5eef3: Saving retains focus while blocking repeated activation; unrelated restrictions remain natively disabled.)
  • Consolidated settings tests keeps the original intent (ae97623: Equivalent tests were consolidated while retaining distinct interaction contracts; this PR extends that existing suite.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/components/solid/settings-ui.test.tsx src/components/settings-ui.browser.test.tsx
  • pnpm --dir ui test src/pages/device/device-pages.test.ts src/pages/config/memory-mutation-owner.test.ts
  • pnpm test:ui:e2e ui/src/e2e/chat-daybreak.real-gateway.e2e.test.ts
  • git diff --check

What I checked:

Likely related people:

  • Mitchell Etzel: Raw commit b44f145 adds ui/src/components/solid/settings-ui.tsx:314 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: b44f145462c7; files: ui/src/components/solid/settings-ui.tsx)

PR surface

Source +5, Tests +24. Total +29 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 10 5 +5
Tests 1 27 3 +24
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 37 8 +29

Labels

Label changes:

  • add P2: Intermittent switch activation and incorrect displayed device preferences are normal-priority UI correctness problems.
  • add merge-risk: 🚨 compatibility: The changed shared binding breaks existing native-device saved-state reconciliation, as shown by current-head CI.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: Intermittent switch activation and incorrect displayed device preferences are normal-priority UI correctness problems.
  • merge-risk: 🚨 compatibility: The changed shared binding breaks existing native-device saved-state reconciliation, as shown by current-head CI.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 27, 2026, 6:36 PM ET / 22:36 UTC.

@steipete steipete changed the title fix: preserve switch clicks during unchanged live updates fix(ui): preserve Daybreak toggle activation during streamed updates Oct 27, 2026
@steipete
steipete merged commit 1f26ff4 into main Oct 27, 2026
85 of 87 checks passed
@steipete
steipete deleted the fix/ci-settings-switch-405690 branch October 27, 2026 23:23
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

app: web-ui App: web-ui merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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