You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web): stop emptied settings fields from staging values they don't show - #4816
Closes#4698
Related issue: N/A
Validation tasks: changes #1228 C1
Other clients: N/A (web admin pages and the web setup wizard only)
Some settings fields stage a value they don't show. On an admin settings page, erasing what you typed into a setting that has nothing saved (a token secret, the CDN address, a bucket region) leaves "1 unsaved change" for an empty field. On Admin › Server › Storage the row then stays on screen as "Will be cleared on save", even with no secret saved. Number fields with a default, such as Link lifetime, show the default once emptied while Save sends the empty value, and the server rejects the whole save. In the setup wizard's Storage step, typing over a saved storage secret and erasing it stages a clear that Continue saves, deleting the secret. Hide also folds a storage backend's edited fields out of view while Continue still saves them.
With this change, a field shows what Save will send, and erasing an edit goes back to what is saved.
Approach
Unsaved settings. The settings form treats a setting its snapshot leaves out as saved empty, so erasing what was typed into it leaves nothing staged. The exception is a secret the server reports as set: the snapshot leaves those out too, and an empty value there is a clear to save. Until the secret status loads, the form keeps the old behavior.
Secret fields.SecretField goes back to the saved state whenever it is emptied, not only when a secret is saved. The wizard's four storage secrets (access key, secret key, token secret, Redis URL) now use SecretField, the control the admin pages already use, with no clear action. A saved secret there shows the mask and "Type to replace the saved value; leave blank to keep it.", as on the admin pages.
Wizard backends. A storage backend holding an unsaved edit stays open: its title carries the unsaved-change dot, "Unsaved changes in this group" shows under its status, and its Hide button is disabled until the edit is undone.
Settings rows. A row's description now wraps with text-wrap: pretty, so the secret hint no longer leaves one word on its last line, and the unsaved-change dot stays beside the first line of a label that wraps.
Default fallbacks. Text and number fields on Storage, Search, Library metadata, Playback, Notifications and AI Services no longer show a default when emptied. The server's settings snapshot already carries every default, so the fallback only ever showed when the field was empty. AI Services now checks each tuning value the save sends, so an emptied tuning field stops at its existing "invalid" message.
Use Redis switch. The switch's own on/off choice now resets on Save and Discard. It used to reset whenever the General page ran out of unsaved changes, and erasing an edit can now do that while the admin is still typing.
SettingField's password type had no callers left and is removed.
This touches the same lines of useSettingsForm.setValue as #4684; whichever merges second needs a small rebase.
Validation
Reproduced on a Silo dev deployment built from main (262ac3d), then checked on a deployment of this branch at bd585ba cloned from the same data. The later commits (AI Services' failed-load message, and a merge of main) don't reach any of these screens:
Admin › Server › Storage, no token secret saved: Cloudflare signed token, type into Token Secret, erase it, back to Signed links. Before: "1 unsaved change" and an empty "Will be cleared on save" row. After: nothing staged, row hidden.
The same steps with Address clients download from give the same results.
Link lifetime emptied: before, the field showed 10800 and Save failed with s3.public_token_ttl must be an integer between 1 and 2147483647. After, it shows empty and Save fails with the same error.
Setup wizard Storage step with a token secret saved: type over it, erase it, back to Signed links, Continue. Before: the stored secret was emptied (stored length 0, no longer reported as set). After: still set.
Setup wizard: edit Region in a backend. Before: Hide folded the edit away. After: Hide is disabled and the backend shows "Unsaved changes in this group" until Region is set back.
AI Services with the settings failed to load: Save reaches "Reload settings before saving." again, for an edited and for an emptied tuning field (component checks of that path, not committed, fail on 30fba6d and bd585ba and pass on af62e14); with the settings loaded, an emptied field still stops at its own message.
Tests: eight new or updated web tests cover the form rule, SecretField, the Storage page, the Use Redis switch and the wizard step. All eight fail on main and pass here. A ninth covers the save baseline after an edit undone in place; it fails on 89793ad and passes on e384b0a.
Web lint, format check, build and bundle budget pass, as do make lint-changed and make verify-local-paths. No Go or API changes. In the full web suite (make test-web), 29 tests in four files fail on this machine and fail the same way on main: auth, request-deadline and player tests whose test environment has no localStorage. One collections test hit its 5-second timeout during the full run and passes on its own.
The form rule applies to every settings page: an edit erased back to empty on a setting with nothing saved no longer counts as a change. A saved secret's staged clear still counts. While the secret status is unavailable, a setting the snapshot leaves out keeps the old behavior.
web.admin.settings.fields.passwordConfigured and passwordNotConfigured lose their last web caller with SettingField's password type; removing them is a catalog change in silo-translations.
Checklist
I read and can explain the complete diff.
This pull request addresses one concern.
Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
The Evidence section shows every change a user can see, or how I checked a change nobody sees.
Fixed after round 1: AI Services checks only the tuning values a save sends, so a failed settings load reports "Reload settings before saving." again (Sol, 89793ad); the save baseline is released when an edit is undone in place, which a Default accent click could otherwise pin until a later save hit a 412 (Gemini, e384b0a); Discard on General resets the Use Redis switch only once the settings have loaded (Gemini, e384b0a). Fixed after round 2: with the settings failed to load, a tuning field typed into and erased no longer hides the reload message (Sol, af62e14). Answered: erasing a wizard credential while Continue's save is in flight (Kody) is the wizard's existing editable-during-save window, fixed in #4870; a Redis database number left staged after a refresh (Sol) is the same on main and filed as #4834.
Plan round before implementing (Sol gpt-6.2-sol xhigh 6/10, Opus claude-opus-5-5 high 7/10, Gemini gemini-4-neon xhigh 6.5/10). Gemini found that a setting with nothing saved and no default stayed changed after it was typed into and erased, which moved the main fix into the settings form. Sol found that erasing a typed Redis URL would close the Use Redis switch, and Sol and Gemini both found the same default-fallback pattern on Notifications and AI Services, which is now included. Answered: Opus proposed leaving the wizard's Hide behavior out; the issue asks for it.
Visual review: round 1 on captures from an earlier build of this branch, round 2 on the final captures.
Member
Round 1
Round 2
Sol
better, 8/10
better, 8/10
Opus
better, 7/10
better, 8/10
Gemini
better, 7/10
better, 8/10
Fixed after visual round 1: the secret hint no longer leaves its last word on a line of its own, and a wizard backend holding an edit keeps Hide in place (disabled) with the unsaved-change dot on its header instead of dropping the button. Answered: the hint's length on tablet comes from the admin pages' shared copy; the wizard deliberately offers no "Clear saved value"; the raw setting name in the Link lifetime error, the input border contrast, and the other layout notes are the same on main. Round 2 confirmed both fixes and found that the disabled Hide doesn't say why it's disabled; the backend now shows "Unsaved changes in this group" under its status while it holds an edit (bd585ba). Answered: a typed replacement and the saved-value mask look alike, as they do on the admin pages, and the unsaved-change dot shifts a title the way it does on every settings row.
Code review (multi-agent, xhigh) found that erasing any edit on the General page with nothing saved could switch Use Redis off while the admin was still typing, and a few cleanups. All are fixed.
AI Disclosure
Harness: Claude Code in T3 Code
Tool(s): Claude Code (implementation, live checks, code review subagents); T3 Code delegated reviews through Codex CLI and Antigravity
Adversarial review: a three-model plan round, a multi-agent code review at xhigh, a visual review round, and a simplify pass ran before opening; a second visual round and a background adversarial review ran after opening. See Council review.
… show
Erasing an edit now goes back to what is saved. The settings form treats a
setting its snapshot leaves out as saved empty, unless it is a secret the
server reports as set, where an empty value stays a staged clear. SecretField
returns to the saved state whenever it is emptied. The setup wizard's storage
secrets use SecretField, so erasing a replacement typed over a saved secret no
longer clears it, and a storage backend holding an edit stays open and marked
changed.
Text and number fields no longer show a default once emptied; the settings
snapshot already carries every default. The Use Redis switch resets on Save
and Discard instead of whenever the page runs out of unsaved changes.
Closes#4698
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The changes update settings draft handling for empty values, secret inputs, Redis save and discard state, and setup-wizard backend visibility. They also remove display fallbacks from settings fields and validate only modified AI tuning fields before saving.
Changes: Settings Editing
Layer / File(s)
Summary
Form and secret staging web/src/components/settings/SecretField.tsx, web/src/components/settings/SecretField.test.tsx, web/src/hooks/useSettingsForm.ts, web/src/hooks/useSettingsForm.test.ts
Empty secret inputs use the keep/reset path. The form compares edits with saved values when keys are omitted from settings snapshots and sensitive status confirms they are not configured. Tests cover clearing initially absent values and using the latest settings snapshot as the save baseline.
Redis save and discard state web/src/pages/admin-settings/GeneralSettings.tsx, web/src/pages/admin-settings/RedisGroup.tsx, web/src/pages/admin-settings/RedisGroup.test.tsx
GeneralSettings counts completed saves and eligible discards and passes the count to RedisGroup. RedisGroup resets its enabled override when that count changes. Tests cover clearing Redis edits without leaving staged changes.
StorageStep uses SecretField for storage secrets and marks edited backends as visible, dirty, and not hideable. Storage fields no longer display token parameter or lifetime fallbacks. Tests cover secret reset and backend visibility.
AI tuning validation and values web/src/pages/admin-settings/AISettings.tsx
AI tuning saves validate only dirty fields against field-specific bounds. The page removes legacy value resolution and display fallbacks.
These settings fields use form values directly instead of display fallbacks. SettingField adjusts label and description layout and removes password-field handling. A StorageSettings test covers clearing a token secret before switching authorization modes.
Silo-Server/silo-server#4696: Both PRs change secret staging and storage link-mode behavior in shared web components.
Silo-Server/silo-server#682: Both PRs change configured-secret draft and reset behavior in storage settings.
Suggested reviewers:blurbery, rhainland
Merge Risk: Low · up to 6af11
After turning Redis off on the General settings page and then switching profiles, the Redis switch may still show off even though the new profile has a saved Redis connection. This is a narrow display inconsistency and is low risk to merge.
Security architecture risk: Minimal · up to 6af11
The changes make erased credential edits return to the saved state and keep pending storage edits visible. The inspected changes do not introduce a material security, configuration-ownership, or rollback risk; existing server validation and save-conflict checks remain in place.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — The inspected mutation scope is installation-wide configuration, including Redis connection credentials, S3 credentials and AI tuning. Its sensitivity comes from existing administrative settings authority, not a newly introduced tenant or service boundary. The write operation is declared acting-admin, demo-restricted and guarded.
Trust Boundaries and Controls
observed — Browser-entered settings remain subject to server normalization and guarded writes. The client captures the initiating profile and validator, disables automatic mutation retries, and rejects an asynchronous result after its profile authority becomes inactive. Unknown configured-secret status does not cause the new saved-value rule to assume an omitted secret is empty.
Resilience and Maintainability Implications
observed — The successful-save path awaits settings and sensitive-status invalidations before releasing savePending. Submitted edit versions determine which drafts are settled, preserving newer edits, and acknowledged secret drafts are erased from component state. Failed writes bypass this successful-save cleanup.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(web): stop emptied settings fields from staging values they don't show" matches the main change: the settings form and secret fields no longer stage invisible values when emptied. The c…
Linked Issues check
[#4698] Directly linked issue. Its coding requirements are three. (1) Emptying an edit must return to the saved state. useSettingsForm.setValue now uses a savedValue helper, so an omitted key with…
Out of Scope Changes check
Changes outside the literal issue text relate to the same defect class or are needed by it. The Use Redis switch reset (RedisGroup, GeneralSettings) changes because the new form rule can reset edi…
Description check
The description is specific and related to the changeset. It explains the problem (settings fields staging values they do not show, default fallbacks showing values Save does not send, the setup wizar…
Full details: Title check
Explanation
The title "fix(web): stop emptied settings fields from staging values they don't show" matches the main change: the settings form and secret fields no longer stage invisible values when emptied. The changeset covers the settings form, SecretField, setup wizard storage step, and related admin pages, all of which this title describes.
Full details: Linked Issues check
Explanation
[#4698] Directly linked issue. Its coding requirements are three. (1) Emptying an edit must return to the saved state. useSettingsForm.setValue now uses a savedValue helper, so an omitted key with no configured secret reverts to clean. SecretField.handleChange calls keepSaved() on any emptying. (2) Displayed values must match what Save sends. The fallbacks verify, 10800, and the Notifications, Search, Library metadata, Playback, and AI defaults are removed from the affected fields. The server snapshot already carries those defaults. (3) Hiding a wizard storage backend must not hide edits that Continue saves. StorageStep passes an edited flag to Backend. Edited backends stay open, show "Unsaved changes in this group", and disable Hide. The wizard's four storage secrets now use SecretField. Automated tests cover the form rule, SecretField, the Storage page, and the wizard step. The issue scope is the web UI only, and the PR changes only web files. No unmet coding requirement is found from the PR summary and the stated code changes. Source was not re-read for this assessment, so the conclusion relies on the summary and PR evidence.
Full details: Out of Scope Changes check
Explanation
Changes outside the literal issue text relate to the same defect class or are needed by it. The Use Redis switch reset (RedisGroup, GeneralSettings) changes because the new form rule can reset edits during typing. The AI Services validation change follows from removing the tuning-field defaults; it checks only values the save sends. Removing the numberValue and similar fallbacks on Notifications, Search, Library metadata, Playback, and Trickplay matches the issue's display-matches-save requirement. The SettingFieldpassword type removal removes a caller-less path. The row layout change (text-wrap: pretty, dirty dot beside the label) supports the unsaved-change indicator. No change was found that is unrelated to the issue. The changes are web-only and make no Go or API changes.
Full details: Description check
Explanation
The description is specific and related to the changeset. It explains the problem (settings fields staging values they do not show, default fallbacks showing values Save does not send, the setup wizard's storage secrets and Hide behavior, and the Use Redis switch reset). It maps those problems to the changed files: the settings form's savedValue rule, SecretField, the Storage and Search pages, AI Services validation, the RedisGroup counter, and the wizard StorageStep. It also lists validation steps, risks, and follow-ups.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
With the settings snapshot missing, AI Services validated every tuning
field's empty value and stopped at "Max concurrent jobs must be a positive
whole number" instead of the form's "Reload settings before saving." An
untouched field holds what the server has and isn't sent, so only a field
the save sends is checked now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two verified findings from checking useSettingsForm, SecretField, SettingFieldRow, RedisGroup, StorageStep, and the backend effective-settings snapshot:
Medium (web/src/hooks/useSettingsForm.ts:130): setValue captures editBaseline.current before checking reverted. With omitted keys now reverting on "" (including Appearance's Default accent button and AI Services' None text provider), a no-op setValue on a clean form pins editBaseline.current to the old snapshot while dirtyCount stays 0, causing 412 Precondition Failed on a later save after any settings refresh (such as uploading or removing a branding asset on the same Appearance page).
Low (web/src/pages/admin-settings/GeneralSettings.tsx:95): handleDiscard increments savesAndDiscards even when !form.loaded causes form.discard() to return early without clearing dirty, flipping Use Redis back on while redis.url = "" stays staged.
Everything else checked out against the source: every key whose || "<default>" display fallback was removed is populated by adminSettingDefaults and EffectiveAdminSettings (including ai.max_concurrent_jobs legacy fallback), SecretField's onKeep routing works across all callers, and SettingFieldRow's text-sm overrides Label's leading-none via tailwind-merge so the h-5 dirty-dot container matches one label line.
AI disclosure: Reviewed with gemini-4-neon (Gemini 4 Neon) in T3 Code via the Antigravity harness.
An emptied setting with nothing saved now leaves nothing staged, so a click
like Appearance's Default accent set the save baseline without changing the
unsaved count, and the baseline was only released when that count changed.
After another write moved the settings on, the next save was guarded against
the old snapshot and refused with a 412. The baseline is now released
whenever the staged set ends up empty.
General's Discard also counted as a discard for the Use Redis switch when the
settings hadn't loaded and nothing was cleared; it now counts only once they
have.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A wizard storage backend holding an edit keeps Hide disabled until the edit
is undone, but only the dot on its title hinted at why. It now also shows
"Unsaved changes in this group" under its status.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…checking fields
With the settings snapshot missing, a tuning field typed into and erased
stayed staged as empty, and Save stopped at "Jobs running at once must be a
positive whole number" instead of "Reload settings before saving." Save now
hands a missing snapshot straight to the form's save, which reports it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bugSomething isn't workingimpact: usabilityCore flow broken or severely blockedpriority: P1Core-path bug; painful workaround — next after P0size/L200–499 added + deleted lines (all files); change volume, not priority.
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Closes #4698
Related issue: N/A
Validation tasks: changes #1228 C1
Other clients: N/A (web admin pages and the web setup wizard only)
Some settings fields stage a value they don't show. On an admin settings page, erasing what you typed into a setting that has nothing saved (a token secret, the CDN address, a bucket region) leaves "1 unsaved change" for an empty field. On Admin › Server › Storage the row then stays on screen as "Will be cleared on save", even with no secret saved. Number fields with a default, such as Link lifetime, show the default once emptied while Save sends the empty value, and the server rejects the whole save. In the setup wizard's Storage step, typing over a saved storage secret and erasing it stages a clear that Continue saves, deleting the secret. Hide also folds a storage backend's edited fields out of view while Continue still saves them.
With this change, a field shows what Save will send, and erasing an edit goes back to what is saved.
Approach
SecretFieldgoes back to the saved state whenever it is emptied, not only when a secret is saved. The wizard's four storage secrets (access key, secret key, token secret, Redis URL) now useSecretField, the control the admin pages already use, with no clear action. A saved secret there shows the mask and "Type to replace the saved value; leave blank to keep it.", as on the admin pages.text-wrap: pretty, so the secret hint no longer leaves one word on its last line, and the unsaved-change dot stays beside the first line of a label that wraps.SettingField'spasswordtype had no callers left and is removed.This touches the same lines of
useSettingsForm.setValueas #4684; whichever merges second needs a small rebase.Validation
main(262ac3d), then checked on a deployment of this branch at bd585ba cloned from the same data. The later commits (AI Services' failed-load message, and a merge ofmain) don't reach any of these screens:10800and Save failed withs3.public_token_ttl must be an integer between 1 and 2147483647. After, it shows empty and Save fails with the same error.SecretField, the Storage page, the Use Redis switch and the wizard step. All eight fail onmainand pass here. A ninth covers the save baseline after an edit undone in place; it fails on 89793ad and passes on e384b0a.make lint-changedandmake verify-local-paths. No Go or API changes. In the full web suite (make test-web), 29 tests in four files fail on this machine and fail the same way onmain: auth, request-deadline and player tests whose test environment has nolocalStorage. One collections test hit its 5-second timeout during the full run and passes on its own.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/issue-4698/
Risks
The form rule applies to every settings page: an edit erased back to empty on a setting with nothing saved no longer counts as a change. A saved secret's staged clear still counts. While the secret status is unavailable, a setting the snapshot leaves out keeps the old behavior.
Follow-ups
web.admin.settings.fields.passwordConfiguredandpasswordNotConfiguredlose their last web caller withSettingField'spasswordtype; removing them is a catalog change in silo-translations.Checklist
Council review
Background adversarial review: round 1 reviewed 30fba6d, round 2 bd585ba, round 3 af62e14.
Fixed after round 1: AI Services checks only the tuning values a save sends, so a failed settings load reports "Reload settings before saving." again (Sol, 89793ad); the save baseline is released when an edit is undone in place, which a Default accent click could otherwise pin until a later save hit a 412 (Gemini, e384b0a); Discard on General resets the Use Redis switch only once the settings have loaded (Gemini, e384b0a). Fixed after round 2: with the settings failed to load, a tuning field typed into and erased no longer hides the reload message (Sol, af62e14). Answered: erasing a wizard credential while Continue's save is in flight (Kody) is the wizard's existing editable-during-save window, fixed in #4870; a Redis database number left staged after a refresh (Sol) is the same on
mainand filed as #4834.Plan round before implementing (Sol
gpt-6.2-solxhigh 6/10, Opusclaude-opus-5-5high 7/10, Geminigemini-4-neonxhigh 6.5/10). Gemini found that a setting with nothing saved and no default stayed changed after it was typed into and erased, which moved the main fix into the settings form. Sol found that erasing a typed Redis URL would close the Use Redis switch, and Sol and Gemini both found the same default-fallback pattern on Notifications and AI Services, which is now included. Answered: Opus proposed leaving the wizard's Hide behavior out; the issue asks for it.Visual review: round 1 on captures from an earlier build of this branch, round 2 on the final captures.
Fixed after visual round 1: the secret hint no longer leaves its last word on a line of its own, and a wizard backend holding an edit keeps Hide in place (disabled) with the unsaved-change dot on its header instead of dropping the button. Answered: the hint's length on tablet comes from the admin pages' shared copy; the wizard deliberately offers no "Clear saved value"; the raw setting name in the Link lifetime error, the input border contrast, and the other layout notes are the same on
main. Round 2 confirmed both fixes and found that the disabled Hide doesn't say why it's disabled; the backend now shows "Unsaved changes in this group" under its status while it holds an edit (bd585ba). Answered: a typed replacement and the saved-value mask look alike, as they do on the admin pages, and the unsaved-change dot shifts a title the way it does on every settings row.Code review (multi-agent, xhigh) found that erasing any edit on the General page with nothing saved could switch Use Redis off while the admin was still typing, and a few cleanups. All are fixed.
AI Disclosure
🤖 Generated with Claude Code