fix(web): preserve unchanged Settings defaults - #1104
Conversation
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. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_3ccd52b4-0b06-4a3a-8610-ad85be3d8c83) |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_a7e443f3-c896-4a7d-aea3-26093e4cb379) |
Opening Settings → Planner and saving without edits wrote the form's 90% SoC maximum into a config that had no limit set. Core had been using its 95% default, so the next restart silently lowered the planning limit. Visiting Planner and then saving another tab had the same effect.
The Settings shell now captures changed field values and preserves untouched numeric, text, select and checkbox fields. It still captures programmatic changes without input events. Late inputs use their DOM defaults; Devices registers the initial profile value when the catalog inserts its select, which has no DOM defaultValue. An explicit profile change still saves its programmatic Unit ID. Planner shows Core's 95% default and leaves an absent planner block absent. ETag and stale-form handling stay in place.
Validation: 561 web tests, Go vet and Go build pass. Regressions fail before the fix and cover unchanged saves, visiting Planner before saving another tab, explicit max changes, returning to a prior displayed value, programmatic checkbox changes and a late secret input. The new profile test runs the real asynchronous Devices catalog callback with a select shim that has no defaultValue. It covers an unchanged Save, tab switching, explicit profile and Unit ID changes, and a later return to the first profile.
The current make verify run fails in the unchanged TestForecastLearningNativeMigrationBackupRestore/pv at forecast_learning_backup_test.go:164: the post-reset observation leaves native PV in cold_start. The same focused test fails on the frozen 2549645 base with the same bundled worker and error. That test uses the current time and a fixed Stockholm location. The release owner is reviewing it separately.
Browser checks against a separate local v3.0.2 Core, before the late-select addition, verified the saved config: an unchanged Control or Planner save preserves the whole document; a later Control edit changes only that field; setting max to 0.8 persists only that bound and reports a planner restart. A second local client's save still makes the stale browser form fail with the reload message. Browser verification of the late select remains pending. The physical box received no writes.
Based on the release cutoff 2549645. Open #1052 owns overlapping settings.js and tabs/planner.js work, stacked over #826/#735. This small fix changes field capture, late driver-profile registration and the SoC default. The runtime planner, driver limits and device registers are unchanged. The release owner coordinates review, merge and the next beta; human visual review remains before merge.
Note
Medium Risk
Changes how saved config is built on POST; incorrect capture logic could drop intended edits or still persist defaults, though behavior is narrowly scoped to the web settings shell and is heavily regression-tested.
Overview
Fixes a config corruption bug where opening Settings (especially Planner) and saving without edits wrote UI defaults into YAML—e.g. persisting a 90% max SoC when the box had no limit and Core used 95%.
The settings shell now remembers each field’s value when rendered and
captureCurrentTabonly writes paths the user actually changed (numbers, text, selects, checkboxes). Password and existing empty-secret behavior is unchanged.rememberFieldValueis exposed on the tab context; Devices calls it when the async driver-profile<select>is inserted (selects have nodefaultValue).Planner stops creating an empty
plannerobject on render, shows 0.95 as the displayed max SoC default, and leaves an absent planner block absent when untouched.New shell and planner tests cover unchanged saves, tab switching, explicit edits, late secrets, and late profile selects.
Reviewed by Cursor Bugbot for commit ea30b61. Bugbot is set up for automated code reviews on this repo. Configure here.