Skip to content

fix(web): preserve unchanged Settings defaults - #1104

Merged
frahlg merged 3 commits into
masterfrom
fix/settings-unchanged-defaults
Sep 7, 2026
Merged

fix(web): preserve unchanged Settings defaults#1104
frahlg merged 3 commits into
masterfrom
fix/settings-unchanged-defaults

Conversation

@frahlg

@frahlg frahlg commented Sep 7, 2026

Copy link
Copy Markdown
Member

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 captureCurrentTab only writes paths the user actually changed (numbers, text, selects, checkboxes). Password and existing empty-secret behavior is unchanged. rememberFieldValue is exposed on the tab context; Devices calls it when the async driver-profile <select> is inserted (selects have no defaultValue).

Planner stops creating an empty planner object 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.

@frahlg
frahlg marked this pull request as ready for review September 7, 2026 17:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-07T17:49:20.252792Z edff871 Draft marked ready
ℹ️ 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.

@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

@frahlg
frahlg merged commit 50be274 into master Sep 7, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant