Skip to content

fix(web): keep a saved multi-select value in plugin settings forms - #4176

Merged
Quick104 merged 1 commit into
mainfrom
fix/plugin-form-multi-select-values
Nov 14, 2026
Merged

Quick104 merged 1 commit into
mainfrom
fix/plugin-form-multi-select-values

Conversation

@Quick104

@Quick104 Quick104 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: none
Other clients: N/A (plugin settings are edited only in web admin)

Saving a plugin's settings in web admin erases any saved value in a multi-select field. The form loads the saved list as an empty string and sends back [], so changing any other field and saving clears the selection. Plugins that declare a MULTI_SELECT field in a global or connection config schema are affected. No Silo-Server plugin declares one today, so this hits third-party plugins built on the SDK's multi-select control. The admin sign-in setup page loads saved values the same way.

formValueForField in web/src/components/admin/plugins/configSchemaAdminForm.ts kept strings, numbers, and booleans and replaced anything else with the field default (""). buildSchemaValues then turns "" into [] for a multi-select field.

Once #3923 merges, the same untouched form would also make a connection test treat the entry as changed ([] against the stored list) and run without the saved secret.

Approach

formValueForField now returns a saved list unchanged when the field is a MULTI_SELECT. Other controls behave as before. Web only.

Follow-up: #4179 keeps numeric-looking string selections as strings on save, a separate bug that is already on main.

Validation

  • New unit test (load a saved tags: ["a", "b"], rebuild the save payload): fails on main with expected { tags: [] } to deeply equal { tags: [ 'a', 'b' ] }, passes on this branch.
  • pnpm run lint, format:check, build, budget:check, and make test-web: pass.
  • make verify-local-paths, make verify-size-ratchet: pass.
  • No live check: no published plugin declares a multi-select config field, so a test server can't reach this state without a custom plugin.

Evidence

Nothing changes on screen for the shipped plugins. The test runs on main and on this branch are on the evidence page.

Evidence: https://evidence.siloserver.org/r/silo-server/plugin-form-multi-select/

Risks

None identified. Only a saved list on a multi-select field loads differently.

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.

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: gpt-6.1-sol (xhigh) reviewed 04a5128 with test runs and probes; no new findings. The numeric-string coercion it reproduced is already on main and goes in a separate fix.

🤖 Generated with Claude Code

Note

Fix saved multi-select values being dropped in plugin settings forms

Previously, opening a plugin settings form reset a saved MULTI_SELECT field to its default because formValueForField did not handle arrays. It now returns the saved array for MULTI_SELECT fields, keeping the selection intact when converting config values to form values. Adds a regression test in configSchemaAdminForm.test.ts covering the round-trip through formValuesFromConfig and buildSchemaValues.

Macroscope summarized 04a5128.

formValueForField returned the field default for any saved value that was
not a string, number, or boolean, so a saved MULTI_SELECT list loaded as ""
and buildSchemaValues sent it back as []. Saving any other change on a
plugin's settings form erased the saved selection. Return the saved list
as is for a MULTI_SELECT field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-triage silo-triage Bot added the size/S 0–49 added + deleted lines (all files); change volume, not priority. label Nov 14, 2026
@coderabbitai

coderabbitai Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d9eb43ac-d39b-4e1f-9df9-b1f7e3963d16
Commits

Reviewing files that changed from the base of the PR and between 43c8300 and 04a5128.

Files selected for processing: 2

  • web/src/components/admin/plugins/configSchemaAdminForm.test.ts
  • web/src/components/admin/plugins/configSchemaAdminForm.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-kody

silo-kody Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T20:40:26.803594Z 04a5128 PR opened
🔒 Security Review ✅ Completed 2026-11-14T20:42:49.913914Z 04a5128 PR opened
ℹ️ 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.

@silo-triage silo-triage Bot added bug Something isn't working priority: P2 Limited scope, workaround exists, or polish labels Nov 14, 2026
@Quick104
Quick104 merged commit 79de85d into main Nov 14, 2026
33 checks passed
@Quick104
Quick104 deleted the fix/plugin-form-multi-select-values branch November 14, 2026 20:57
Quick104 added a commit that referenced this pull request Nov 14, 2026
Since #4176 a saved multi-select list loads into the form as is, so an
untouched nullable boolean list such as [null] reached coerceBoolean
and saved as [false]. Leave null items unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Quick104 added a commit that referenced this pull request Nov 14, 2026
…4179)

* fix(web): keep string selections as strings in plugin settings saves

The plugin settings form and the Sign-in page built the saved entry
without the schema's declared field types, so buildSchemaValues fell
back to the control heuristic and turned numeric-looking multi-select
values such as "001" into numbers. Pass parseFieldTypes(json_schema),
as the request-server and watch-provider forms already do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): keep the control heuristic for arrays with no item type

parseFieldTypes typed every array property as "array", which passes
values through untouched. An array whose items carry no plain type
(enum, $ref, a nullable type list) then saved numeric selections as
strings, where the control heuristic used to make them numbers. Record
"array" only for string items and leave the rest untyped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): read array item types from nullable lists and enums

The previous commit left arrays with no plain item type untyped, which
sent string enum and $ref items through the numeric control heuristic
and changed the request-server and watch-provider forms. Read the item
type from a nullable type list or a uniform enum instead, and keep any
other array as a plain pass-through array, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): follow local $ref item schemas when typing array fields

An array whose items are a local reference such as "#/$defs/id" typed
as a plain array, so the plugin settings form saved integer selections
as strings where main coerced them. Resolve one local $defs or
definitions reference before reading the item type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): decode JSON Pointer escapes in local $ref names

A local reference such as "#/$defs/a~1b" names the definition "a/b".
Decode "~1" and "~0" before looking the name up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): keep null items when saving a boolean array

Since #4176 a saved multi-select list loads into the form as is, so an
untouched nullable boolean list such as [null] reached coerceBoolean
and saved as [false]. Leave null items unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: P2 Limited scope, workaround exists, or polish size/S 0–49 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant