Skip to content

fix(settings): accept palette in the preferences PATCH allowlist - #1621

Merged
Xore merged 1 commit into
mainfrom
fix-preferences-palette-main
Aug 18, 2026
Merged

fix(settings): accept palette in the preferences PATCH allowlist#1621
Xore merged 1 commit into
mainfrom
fix-preferences-palette-main

Conversation

@Xore

@Xore Xore commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Fixes the Appearance-tab save error "Preferences could not be saved — invalid or unknown preference fields".

preferencesPatch (dashboard/settings_api.go) — the strictly-decoded PATCH body — was missing the palette field, while userPreferences/validatePreferences (settings_domain.go) already define it. The Appearance pane's save always includes palette in the diff (the picker's "claude" never string-matches the stored "" default), so the strict decoder rejected every appearance save — even a plain theme change.

Change: add Palette *string to preferencesPatch + copy in apply(); regression test for the round-trip and for invalid values hitting per-field validation instead of the unknown-field guard.

go test on the dashboard package: green.

🤖 Generated with Claude Code

The Appearance pane saves theme and palette together (the palette
picker's 'claude' never string-matches the stored "" default, so the
pane's diff always includes palette). preferencesPatch was missing the
field, so the strict decoder 400'd every appearance save with 'invalid
or unknown preference fields' — even a plain theme change.

userPreferences/validatePreferences (settings_domain.go) already carry
the palette field and its allowlist; only the typed PATCH body and its
apply() were out of sync. Regression test covers both the happy path
and that an invalid palette now hits per-field validation instead of
the unknown-field guard.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@Xore
Xore merged commit 89a667a into main Aug 18, 2026
88 checks passed
@Xore
Xore deleted the fix-preferences-palette-main branch August 18, 2026 23:42
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