feat(studio): central error helpers + inline log viewer + Today CTAs
Some checks failed
Security / Security check (push) Failing after 1s

Bundles the error-UX overhaul and the inline log viewer:

  - New `FaiLog` (`~/.fai/logs/studio-errors.log`, 256 KiB rotation,
    JSON-per-line). Every operator-visible failure is appended so
    `fai admin doctor` and the new viewer can show the trail
    without the operator having to reproduce the failure.
  - New `showFaiErrorSnack` / `showFaiErrorDialog` helpers wrap
    `FaiErrorBox` in copyable surfaces; 27 ad-hoc
    `SnackBar(content: Text(e.toString()))` sites swept to use
    them (settings, doctor, audit, store, module sheet, system-AI
    editor, flow output).
  - New `FaiLogViewer` modal (`showFaiLogViewer`) renders log
    files inline with line numbers, JSON-key + `[level]` token
    colouring, Copy-all, Refresh, Open-externally. Doctor's
    daemon-paths panel grows a "View" button next to "Open" for
    every `.log` row and now also lists the Studio errors log.
  - Today carousel: CTAs now actually re-run search after a
    `filterCategory` / `runQuery` story is tapped (was only
    flipping the chip state). Fallback story list bumped to 8.
  - Editor bumped to git ref carrying 0.15.0 (type-token
    colouring + analyzer diagnostics).

Studio bumped to 0.62.0.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-06-04 02:08:15 +02:00
parent 2731062a13
commit 8f5cd2528b
22 changed files with 1087 additions and 134 deletions

View file

@ -20,7 +20,19 @@ import 'package:yaml/yaml.dart';
/// closed and ABI-stable adding a new variant without bumping
/// the schema would let an old Studio render an unknown action
/// as a no-op button.
enum TodayCta { none, openSettings }
///
/// `filterCategory` and `runQuery` both consume the optional
/// [TodayStoryData.ctaPayload] a wire-string the Store page
/// dispatches into its filter / search box. Keeping the action
/// surface inside the Store means a hero story can teach about a
/// section without forcing a page-route change.
enum TodayCta {
none,
openSettings,
filterCategory,
runQuery,
showSuggestedSources,
}
/// Bilingual story rendered by the Today-Hero card. Either
/// loaded from disk or supplied as a const fallback.
@ -37,6 +49,11 @@ class TodayStoryData {
final IconData icon;
final TodayCta cta;
/// Wire payload used by [TodayCta.filterCategory] (category id
/// to apply to the Store grid) and [TodayCta.runQuery] (free-text
/// to drop into the search box). Empty for other variants.
final String ctaPayload;
const TodayStoryData({
required this.badgeEn,
required this.badgeDe,
@ -48,6 +65,7 @@ class TodayStoryData {
required this.ctaLabelDe,
required this.icon,
required this.cta,
this.ctaPayload = '',
});
}
@ -130,6 +148,7 @@ class TodayStoryLoader {
ctaLabelDe: s('cta_label_de'),
icon: icon,
cta: cta,
ctaPayload: s('cta_payload'),
);
}
@ -150,6 +169,12 @@ class TodayStoryLoader {
return TodayCta.none;
case 'openSettings':
return TodayCta.openSettings;
case 'filterCategory':
return TodayCta.filterCategory;
case 'runQuery':
return TodayCta.runQuery;
case 'showSuggestedSources':
return TodayCta.showSuggestedSources;
default:
return null;
}