feat(settings): schema-driven settings engine (T-448)
The core of the settings panel (epic T-444). Subsystems describe a category as data — a SettingsCategory of carded SettingsSections of SettingsFields (toggle / select / text / number / opens-external-file), each bound to a SettingsStore key with help text, a default, and reset-to-default. Registration is declarative: a new SettingsCategoryContribution carries the category; the extension manager routes it into a new kernel SettingsRegistry (exposed on KernelServices), which the panel reads via ClideKernel. Adding a category is now pure data + a contribution — no widget code. SettingsCategoryView renders a category into carded sections per ui-design surface.md: panelHeader card fill, dividerColor border, inputs receding to panelBackground; select reuses the anchored-overlay menu, text/number commit on Enter or blur (numeric clamps to bounds). The modal panel now shows the selected/first registered category, falling back to the empty state. Tests: registry (sort / dedup / notify), contribution routing on activation, renderer (render + toggle/select write-through + reset), modal-with-category. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:clide/clide.dart';
|
||||
import 'package:clide/kernel/src/panels/slot_id.dart';
|
||||
import 'package:clide/kernel/src/settings_schema.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
/// One atom contributed by a [ClideExtension]. Extensions declare N of
|
||||
@@ -138,3 +139,13 @@ class LayoutSlot {
|
||||
final double? maxSize;
|
||||
final bool visible;
|
||||
}
|
||||
|
||||
/// A category in the Settings panel (epic T-444). The kernel routes it into the
|
||||
/// `SettingsRegistry`; `builtin.settings-ui` renders its [SettingsCategory]
|
||||
/// schema into carded field rows (T-448). Categories are data — register one to
|
||||
/// surface a new settings tab.
|
||||
class SettingsCategoryContribution extends ContributionPoint {
|
||||
const SettingsCategoryContribution({required super.id, required this.category});
|
||||
|
||||
final SettingsCategory category;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user