feat(settings): Appearance category + custom-control escape hatch (T-452)

Add the one bespoke control the schema engine defers to. New
SettingsControlContribution routes a WidgetBuilder into a kernel
SettingsControlRegistry under a customId; a SettingsFieldKind.custom field
names that id, and the renderer draws the registered widget full-width
(label on top, no scope tag — the control owns its own apply + scope).

The theme-picker extension uses it: an Appearance category whose theme field
is custom, backed by AppearanceThemeControl — base-theme chips + a
high-contrast toggle that apply live through ThemeController (persisted by
theme_persistence). Reuses the shared theme_families helpers.

Tests: control registry (register/dup/unregister), the renderer's custom-field
path, and the Appearance contribution + live theme apply.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-17 13:04:52 +02:00
co-authored by Claude Opus 4.8
parent 727fe8fdd4
commit 757d6f71fa
16 changed files with 324 additions and 14 deletions
+12
View File
@@ -149,3 +149,15 @@ class SettingsCategoryContribution extends ContributionPoint {
final SettingsCategory category;
}
/// A bespoke widget for a `SettingsFieldKind.custom` field (T-452). The kernel
/// routes it into the `SettingsControlRegistry` under [customId]; the settings
/// renderer draws it when a field names that [customId]. Lets a subsystem ship
/// a one-off control (e.g. the theme picker) without leaking widgets into the
/// pure-data schema.
class SettingsControlContribution extends ContributionPoint {
const SettingsControlContribution({required super.id, required this.customId, required this.builder});
final String customId;
final WidgetBuilder builder;
}