Part of #836. First feature PR after the endpoint lands. Wires the modal's Color tab end-to-end so users can persist palette / gradient / duotone / default-toggle changes to theme.json. Other tabs continue rendering but their Update is a no-op until subsequent PRs.
Depends on #837.
Scope
Files
src/resolvers.js — add postUpdateThemeSettings(payload) mirroring postUpdateThemeMetadata.
src/editor-sidebar/edit-theme-settings-modal.js — lift Color-tab state to modal level, wire handleUpdateClick to call the resolver, add loading / success-notice / error-notice / refresh.
src/plugin-styles.scss — any save-state styling adjustments (loading indicator on the footer button).
Behavior
- Update button enabled when there are pending changes; disabled + spinner during save.
- Success: surface
createSuccessNotice, refresh the theme entity record (panels' useEffect resets local state from new server data automatically). Modal stays open by default.
- Error: surface
createErrorNotice with the WP_Error message.
State lifting
Modal owns:
colorSettings (defaults flags + custom flags + link)
palette / gradients / duotone arrays
Passed to ColorSettingsPanel / PalettePanel / GradientPanel / DuotonePanel as value + onChange. Tabs other than Color keep their existing local state for now.
Acceptance criteria
Out of scope
References
Part of #836. First feature PR after the endpoint lands. Wires the modal's Color tab end-to-end so users can persist palette / gradient / duotone / default-toggle changes to
theme.json. Other tabs continue rendering but their Update is a no-op until subsequent PRs.Depends on #837.
Scope
Files
src/resolvers.js— addpostUpdateThemeSettings(payload)mirroringpostUpdateThemeMetadata.src/editor-sidebar/edit-theme-settings-modal.js— lift Color-tab state to modal level, wirehandleUpdateClickto call the resolver, add loading / success-notice / error-notice / refresh.src/plugin-styles.scss— any save-state styling adjustments (loading indicator on the footer button).Behavior
createSuccessNotice, refresh the theme entity record (panels'useEffectresets local state from new server data automatically). Modal stays open by default.createErrorNoticewith theWP_Errormessage.State lifting
Modal owns:
colorSettings(defaults flags + custom flags + link)palette/gradients/duotonearraysPassed to
ColorSettingsPanel/PalettePanel/GradientPanel/DuotonePanelasvalue+onChange. Tabs other than Color keep their existing local state for now.Acceptance criteria
Out of scope
readme.txt— fold into this PR if user-visible documentation is desired before further tabs land; otherwise the final per-tab PR.References
metadata-editor-modal.js.