feat(studio): rich theme picker (presets + custom colour) + editor 0.11.0
Some checks failed
Security / Security check (push) Failing after 1s

Settings dialog's Theme Plugin section is now a grid of
swatched tiles:

- Built-in (none) — falls back to FaiTheme.light/.dark
- One tile per installed studio.theme.* plugin, each
  showing the plugin's primary/secondary/tertiary as
  live colour dots. Tile loads its preview lazily so a
  dozen installed themes don't block the picker.
- Custom — opens a colour-picker dialog with 12 curated
  Material presets + a hex input + live preview. Selecting
  applies ColorScheme.fromSeed for both brightnesses.

main.dart's _pluginThemes parses a 'custom:#RRGGBB' sigil
in the same notifier slot as plugin capability ids, so the
existing persistence + restoration paths cover the custom
case with no new state.

Bumps editor to 0.11.0 (type-checked port connections +
dynamic card width fix + card-height border allowance) and
Studio to 0.58.0.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-06-02 01:29:34 +02:00
parent 69864da934
commit c1c60d5434
30 changed files with 1280 additions and 846 deletions

View file

@ -24,8 +24,8 @@ class _DoctorPageState extends State<DoctorPage> {
}
void _refresh() => setState(() {
_future = HubService.instance.doctor();
});
_future = HubService.instance.doctor();
});
@override
Widget build(BuildContext context) {
@ -62,9 +62,9 @@ class _DoctorPageState extends State<DoctorPage> {
);
}
final s = snapshot.data!;
final showUpdate = s.update.updateAvailable ||
(!s.update.manifestReachable &&
s.update.localVersion.isNotEmpty);
final showUpdate =
s.update.updateAvailable ||
(!s.update.manifestReachable && s.update.localVersion.isNotEmpty);
return ListView(
padding: const EdgeInsets.all(FaiSpace.xl),
children: [
@ -74,14 +74,13 @@ class _DoctorPageState extends State<DoctorPage> {
const SizedBox(height: FaiSpace.xl),
_Section(
title: AppLocalizations.of(context)!.doctorEventLogSection,
child: _EventLogPanel(
snapshot: s,
onRefresh: _refresh,
),
child: _EventLogPanel(snapshot: s, onRefresh: _refresh),
),
const SizedBox(height: FaiSpace.lg),
_Section(
title: AppLocalizations.of(context)!.doctorModulesApprovalsSection,
title: AppLocalizations.of(
context,
)!.doctorModulesApprovalsSection,
child: _ModulesPanel(snapshot: s),
),
const SizedBox(height: FaiSpace.lg),
@ -120,7 +119,10 @@ class _Section extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: FaiSpace.xs, bottom: FaiSpace.sm),
padding: const EdgeInsets.only(
left: FaiSpace.xs,
bottom: FaiSpace.sm,
),
child: Text(
title.toUpperCase(),
style: theme.textTheme.labelSmall?.copyWith(
@ -259,6 +261,7 @@ class _StatTile extends StatelessWidget {
class _EventLogPanel extends StatelessWidget {
final DoctorSnapshot snapshot;
/// Re-runs the doctor() call which re-verifies the chain.
/// Wired to a "Verify now" button so operators can re-check
/// after import / restore without restarting the daemon.
@ -361,12 +364,7 @@ class _DaemonPathsPanel extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
for (final e in entries)
_PathRow(
label: e.$1,
path: e.$2,
icon: e.$3,
isDirectory: e.$4,
),
_PathRow(label: e.$1, path: e.$2, icon: e.$3, isDirectory: e.$4),
],
),
);
@ -485,10 +483,11 @@ class _DaemonActionsCardState extends State<_DaemonActionsCard> {
if (!mounted) return;
setState(() {
_busy = false;
_output = (r.ok
? 'OK · $label\n${r.stdout}'
: 'Failed · $label\n${r.stderr.isEmpty ? r.stdout : r.stderr}')
.trim();
_output =
(r.ok
? 'OK · $label\n${r.stdout}'
: 'Failed · $label\n${r.stderr.isEmpty ? r.stdout : r.stderr}')
.trim();
});
// Refresh the status pill restart / stop / start all
// change the running flag.
@ -535,8 +534,8 @@ class _DaemonActionsCardState extends State<_DaemonActionsCard> {
active == null
? l.doctorStatusUnknown
: active.running
? l.doctorRunningOn(active.name, active.endpoint)
: l.doctorStoppedOn(active.name),
? l.doctorRunningOn(active.name, active.endpoint)
: l.doctorStoppedOn(active.name),
style: theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w500,
),
@ -572,9 +571,9 @@ class _DaemonActionsCardState extends State<_DaemonActionsCard> {
onPressed: _busy
? null
: () => _run(
'daemon restart',
() => SystemActions.faiDaemon(['restart']),
),
'daemon restart',
() => SystemActions.faiDaemon(['restart']),
),
icon: const Icon(Icons.restart_alt, size: 16),
label: Text(l.doctorRestart),
),
@ -583,9 +582,9 @@ class _DaemonActionsCardState extends State<_DaemonActionsCard> {
onPressed: _busy
? null
: () => _run(
'daemon start',
() => SystemActions.faiDaemon(['start']),
),
'daemon start',
() => SystemActions.faiDaemon(['start']),
),
icon: const Icon(Icons.play_arrow, size: 16),
label: Text(l.doctorStart),
),
@ -593,9 +592,9 @@ class _DaemonActionsCardState extends State<_DaemonActionsCard> {
onPressed: _busy
? null
: () => _run(
'daemon stop',
() => SystemActions.faiDaemon(['stop']),
),
'daemon stop',
() => SystemActions.faiDaemon(['stop']),
),
icon: const Icon(Icons.stop_circle_outlined, size: 16),
label: Text(l.doctorStop),
),
@ -603,9 +602,9 @@ class _DaemonActionsCardState extends State<_DaemonActionsCard> {
onPressed: _busy
? null
: () => _run(
'daemon status',
() => SystemActions.faiDaemon(['status']),
),
'daemon status',
() => SystemActions.faiDaemon(['status']),
),
icon: const Icon(Icons.health_and_safety_outlined, size: 16),
label: Text(l.doctorStatusAction),
),
@ -801,10 +800,7 @@ class _ServicesPanel extends StatelessWidget {
children: [
for (var i = 0; i < snapshot.services.length; i++) ...[
if (i > 0)
Divider(
height: 1,
color: theme.colorScheme.outlineVariant,
),
Divider(height: 1, color: theme.colorScheme.outlineVariant),
Padding(
padding: const EdgeInsets.all(FaiSpace.lg),
child: Row(
@ -940,7 +936,9 @@ class _UpdateBannerState extends State<_UpdateBanner> {
child: CircularProgressIndicator(strokeWidth: 2),
)
: const Icon(Icons.system_update_alt, size: 16),
label: Text(_applying ? l.doctorApplying : l.doctorApplyUpdate),
label: Text(
_applying ? l.doctorApplying : l.doctorApplyUpdate,
),
),
const SizedBox(width: FaiSpace.sm),
FaiPill(