Repository navigation
feat(settings): let an administrator set the default for title art - #2365
Conversation
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 39
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: 🟡 Moderate · up to
|
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (gpt-6.1-sol, reviewed 3d2d038)
One P3 finding below. Source inspection and evaluation of the production UI expressions confirm the mismatch; full browser and server execution remain unverified.
AI disclosure: T3 Code through the Codex harness; model gpt-6.1-sol.
| label={TITLE_ART.label} | ||
| description="Default for people who have not chosen their own. Anyone can still change it for themselves." | ||
| type="toggle" | ||
| value={form.getValue(TITLE_ART_DEFAULT_KEY) || String(TITLE_ART.defaultValue)} |
There was a problem hiding this comment.
[P3] Show the effective default when a legacy stored value is invalid
After upgrading a server where the legacy admin API accepted {"value":"off"} for defaults.ui.title_art, this control shows off while inheriting viewers resolve on. EffectiveAdminSettings preserves the nonempty string, this expression forwards it unchanged, and SettingField checks only value === "true". Meanwhile Resolver.adminDefaults rejects off and falls back to the contract default true. Even a legacy value containing valid JSON with whitespace, true, produces the same mismatch because the resolver trims it and this control does not. I evaluated the production UI expressions for both inputs and verified the persistence and fallback paths in the source. Parse and validate the stored JSON, then pass the canonical boolean string to the toggle, falling back to TITLE_ART.defaultValue for an absent or invalid value.
| inherited := def.DefaultValue | ||
| if len(adminDefault) > 0 { | ||
| inherited = adminDefault |
There was a problem hiding this comment.
Incorrect inheritance in internal/settingsresolve/resolve.go occurs because resolveInheritedValue still uses definition.defaultValue despite administrator defaults: with defaults.ui.title_art=false and no stored choice, Admin Devices displays title art as enabled, and LevelSettings.add writes true for an override intended to preserve the inherited value. Thread validated server defaults into the shared inheritance helper and its admin consumers so displaying or adding an untouched setting matches the resolver and does not unexpectedly enable title art.
Prompt for LLM
File internal/settingsresolve/resolve.go:
Line 374 to 376:
Incorrect inheritance in `internal/settingsresolve/resolve.go` occurs because `resolveInheritedValue` still uses `definition.defaultValue` despite administrator defaults: with `defaults.ui.title_art=false` and no stored choice, Admin Devices displays title art as enabled, and `LevelSettings.add` writes `true` for an override intended to preserve the inherited value. Thread validated server defaults into the shared inheritance helper and its admin consumers so displaying or adding an untouched setting matches the resolver and does not unexpectedly enable title art.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
An administrator can now choose whether title pages show logo art or plain text for everyone who has not picked their own setting. Admin > Settings > Appearance gets a "Title pages" switch, stored as defaults.ui.title_art. The settings contract gains admin_default, which ui.title_art declares. The resolver uses the administrator's value in place of default_value and still reports source "default", so existing clients show the inherited value without changes, and explicit profile and device values keep winning. Admin writes are checked against the setting's value schema, and a change broadcasts user_settings.changed so open web pages re-read it. The web title art setting now says when it follows the server default and offers "Use server default", which clears the stored values instead of saving the default as a choice. Closes #2358 Co-Authored-By: Claude Opus 5.5 <[email protected]>
3d2d038 to
7ed06e7
Compare
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Minor validation change — silo-server #1228 C1 (Web admin; build 1144 · Suggested fix: No diff; re-check the case on the merged build. Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
…files (#2674) * feat(settings): let an administrator set the Next Up defaults for profiles ui.next_up_mode and ui.next_up_new_releases_first declare admin_default (manifest revision 22). Profiles without their own value follow the administrator's choice on Home, library pages and Jellyfin /Shows/NextUp; a profile's own value still wins. One per-node config.AdminDefaults snapshot serves every resolver: one query for all defaults, lock-free reads while fresh, one refresh at a time (in the background once a snapshot exists), last good value on failure with a retry delay. Admin writes reload it before the client event and fence off older reads; other nodes reload on the admin settings_changed event, with a 10 s TTL as the backstop. Admin > Home Sections gets a card for both defaults; Settings > Home Screen names the inherited value and offers Use server default for both settings. Web Home and library rows now refresh when either Next Up setting changes, and a server-default change is re-read once more after the server TTL. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(settings): refresh admin defaults without reads and refetch Home's layout The admin defaults snapshot now refreshes every half TTL in the background, so a node that missed another node's change event converges within the TTL even while idle; before, the web client's delayed re-read only started the refresh and got the old snapshot back. A Next up episodes change now refetches a mounted Home's layout before its rows reload, so switching to a separate row shows the Next Up row instead of only removing the episodes from Continue Watching. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(settings): poll admin defaults only on API nodes and settle flaky tests - Start AdminDefaults.Run after the proxy/transcode return, so stream nodes that never resolve viewer settings stop querying server_settings every 5 seconds. - Wait for a refresh to publish before asserting on the snapshot in the AdminDefaults tests; the fake reader reports a read done before the snapshot is stored, which failed 3 of 900 runs under -race. - Say the 10-second staleness bound holds while a node can read its settings. - Reuse refreshForSettingChange in invalidateSettingValueQueries instead of a second copy of the same invalidations. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
| reader.set(nextUpModeDefault, "", errors.New("db down")) | ||
| advance(clock, AdminDefaultsCacheTTL) | ||
| get(t, a, nextUpModeDefault) | ||
| reader.waitDone(t, 2) |
There was a problem hiding this comment.
Race condition identified in the backoff test in internal/config/admin_defaults_test.go: waitDone signals GetMany's return before AdminDefaults.read necessarily sets retryAt and clears inflight, so advancing the fake clock before read 2 finishes can prevent the next Get from starting a refresh and block waitDone(t, 3) indefinitely. Replace the first waitDone with waitPublished to ensure the refresh completes before advancing the clock.
waitPublished(t, a, reader, 2)Prompt for LLM
File internal/config/admin_defaults_test.go:
Line 188:
Race condition identified in the backoff test in internal/config/admin_defaults_test.go: waitDone signals GetMany's return before AdminDefaults.read necessarily sets retryAt and clears inflight, so advancing the fake clock before read 2 finishes can prevent the next Get from starting a refresh and block waitDone(t, 3) indefinitely. Replace the first waitDone with waitPublished to ensure the refresh completes before advancing the clock.
Suggested Code:
waitPublished(t, a, reader, 2)
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
…2754) #2718 limited user_settings delivery to the connection's own account, which also dropped the administrator-default event #2365 publishes with no account. Mark that event for every viewer explicitly and let only an envelope with the marker and no account or profile through, so personal settings events keep their isolation. Closes #2748 Co-authored-by: Claude Opus 5.5 <[email protected]>
Problem
Closes #2358
Related issue: N/A
Validation tasks: changes #1228 C1
An administrator can't choose whether title pages show logo art or plain text for the people on their server. Show title art only has a profile value and a per-device value, so an admin who wants plain-text titles has to ask every viewer to change their own setting, and new profiles always start with logos.
This adds a server-wide default under Admin › Settings › Appearance › Title pages. Viewers who haven't chosen inherit it, and anyone can still pick their own. Explicit choices, including
false, keep winning, and the existing Apply to all devices behavior is unchanged.Approach
admin_default, andui.title_artdoes (manifest revision 21). The administrator's value is stored as the server settingdefaults.ui.title_art, JSON text, written through the existing admin settings API. Admin writes are validated against the setting's value schema, sooffis rejected and an empty value clears it.default_valueand still reportssource: "default". Web, iOS, and Android already treatdefaultas inherited and apply the effective value, so the admin's choice reaches every app without client changes, and older builds keep working. A stored value at any allowed scope still wins. A missing, invalid, or unreadable admin value falls back to the contract default (true) instead of failing the settings read.user_settings.changedevent with no account, carrying only the key andscope: "default", so open web pages re-read it.docs/architecture/settings-contract.mdanddocs/settings-api.mddescribeadmin_default, the storage key, the source rule, and the event.Jellyfin clients aren't affected: Silo doesn't map title art into Jellyfin display preferences, and those clients choose logos themselves.
Validation
main: an admin write ofdefaults.ui.title_art=falsewas accepted (and so wasoff), but viewers still resolvedtrue.false/default), a device override (true/profile_device), another device still inheriting, deleting the override (back tofalse/default), and clearing the admin value (back totrue/default).offreturns 422.falsewhen the admin switches the default totrue, and returns to the inherited value after deleting it.make lint-changed, the settings-binding checks, and the Appearance and title-art web tests pass. The admin default, the viewer's inherited state, an own choice, and Use server default were walked again in the browser on the rebased head, at desktop and phone width. Server branding / theming — Web admin #1228 C1 was not walked again.make test-gopasses apart from two real-FFmpeg tests ininternal/mediasample, which fail the same way onmainwith this host's ffmpeg;go vet,make lint-changed(0 issues), and the settings, route, OpenAPI, fixture, and local-path checks pass. Web: lint, format, build, budget, andmake test-webpass.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/issue-2358/
Risks
/api/v1bridge. The v1 and v2 effective-values routes share one resolver, so a v1 client also sees the admin default once one is set. Nothing changes on a server that doesn't set one, and the response shape is the same.ui.title_art, or asks for every key, does one indexedserver_settingslookup. Requests for other keys don't.ui.title_arttoday, and the contract doc says any other server path must be wired before a key it resolves declaresadmin_default.defaults.card_*keys and overlay-config endpoint; this change doesn't move them.Checklist
Follow-ups: Silo-Server/silo-apple#745, Silo-Server/silo-android#557. User manual: Silo-Server/siloserver.org#193, draft docs PR Silo-Server/siloserver.org#194.
AI Disclosure
/siloworkflowscripts/capture-web) for browser capturesclaude-opus-5-5(implementation and review),claude-sonnet-5-5(review subagents)gpt-6.1-sol, reviewed3d2d038) posted one P3 finding, left open for the author: the admin Show title art switch can show off while viewers inherit on if the server already stored an invaliddefaults.ui.title_artbefore this change.🤖 Generated with Claude Code
Note
Add administrator-settable server default for
ui.title_artadmin_defaultflag to the settings contract and marksui.title_art, raising the contract revision from 20 to 21 in manifest.json and settingsContract.tsdefaults.<key>server setting; the resolver in resolve.go uses it in place of the contract default when no stored user choice wins, and falls back to the contract default for empty, invalid, or failed readsNormalizeAdminSettingin admin_settings.go now rejects schema-invaliddefaults.*values that previously passed through unchanged; contract validation also rejectsadmin_defaulton non-remote definitionsMacroscope summarized 7ed06e7.