feat(studio): typed flow outputs + on-disk docs + UX polish
Documentation system (the original "whole docs system is broken" complaint): - Studio reads inline docs from disk via the new getInstalledModuleDocs RPC. No network, no auth, no provider lock-in. - store.dart probes for MODULE.md eagerly when a module-detail sheet opens (a single file stat). The Documentation section only renders when the bundle actually shipped docs. - Shared FaiTheme.markdownStyle helper used by Welcome's DocReaderSheet and Store's DocsPanel so every inline doc reads in the same typography. The shared style forces code.backgroundColor = transparent to suppress the per-span bands flutter_markdown's default code style draws on dark themes. Flow run dialog: - Run-button gating now strips the @version suffix from installed capabilities before the contains() check. Without this fix the button stayed disabled for every flow with dependencies, even after a successful install. - Studio derives a MIME type from the picked file's extension (small per-suffix map; .pdf, .docx, .txt, .json, ...) and forwards it to the hub. Fixes "unsupported MIME type: application/octet-stream" from text.extract. - Dialog title tracks the future's state: running -> "extract laeuft", success -> "extract -- Ergebnis", failure -> "extract -- fehlgeschlagen". - Output rendering moved from String stringification to a sealed FlowOutput type (Text / Json / Bytes / File / Unknown). A new FaiFlowOutput widget dispatches per variant: markdown for text/markdown (heuristic), pretty JSON for proto Struct, inline image preview + Save-As for bytes, Open for file URIs. Byte sizes: - New humanBytes() helper renders 23.3 kB / 1.04 MB style values with three significant digits, matching Finder / GNOME Files. Wired into flow-card pills, picked-file readouts, and the bytes-payload preview line. Signed-off-by: flemming-it <sf@flemming.it> Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
parent
081ffd7233
commit
34f2b7b313
14 changed files with 849 additions and 296 deletions
|
|
@ -506,8 +506,23 @@
|
|||
"flowsRunButton": "Starten",
|
||||
"flowsRunningTitle": "{name} läuft",
|
||||
"@flowsRunningTitle": { "placeholders": { "name": { "type": "String" } } },
|
||||
"flowsResultTitle": "{name} — Ergebnis",
|
||||
"@flowsResultTitle": { "placeholders": { "name": { "type": "String" } } },
|
||||
"flowsErrorTitle": "{name} — fehlgeschlagen",
|
||||
"@flowsErrorTitle": { "placeholders": { "name": { "type": "String" } } },
|
||||
"flowsRunning": "Flow läuft…",
|
||||
"flowsNoOutputs": "Flow abgeschlossen ohne deklarierte Outputs.",
|
||||
"flowsOutputUnknown": "Unbekannter Output-Payload-Typ.",
|
||||
"flowsOutputBytesUnknownMime": "Binärdaten",
|
||||
"flowsOutputSaveAs": "Speichern unter…",
|
||||
"flowsOutputSaveAsTitle": "Flow-Output speichern",
|
||||
"flowsOutputSavedAt": "Gespeichert: {path}",
|
||||
"@flowsOutputSavedAt": { "placeholders": { "path": { "type": "String" } } },
|
||||
"flowsOutputSaveFailed": "Speichern fehlgeschlagen: {error}",
|
||||
"@flowsOutputSaveFailed": { "placeholders": { "error": { "type": "String" } } },
|
||||
"flowsOutputOpen": "Öffnen",
|
||||
"flowsOutputOpenFailed": "Öffnen fehlgeschlagen: {error}",
|
||||
"@flowsOutputOpenFailed": { "placeholders": { "error": { "type": "String" } } },
|
||||
|
||||
"approvalsTitle": "Freigaben",
|
||||
"approvalsTabPending": "Offen",
|
||||
|
|
|
|||
|
|
@ -507,8 +507,23 @@
|
|||
"flowsRunButton": "Run",
|
||||
"flowsRunningTitle": "Running {name}",
|
||||
"@flowsRunningTitle": { "placeholders": { "name": { "type": "String" } } },
|
||||
"flowsResultTitle": "{name} — result",
|
||||
"@flowsResultTitle": { "placeholders": { "name": { "type": "String" } } },
|
||||
"flowsErrorTitle": "{name} — failed",
|
||||
"@flowsErrorTitle": { "placeholders": { "name": { "type": "String" } } },
|
||||
"flowsRunning": "Flow running…",
|
||||
"flowsNoOutputs": "Flow completed with no declared outputs.",
|
||||
"flowsOutputUnknown": "Output payload variant not recognised.",
|
||||
"flowsOutputBytesUnknownMime": "binary",
|
||||
"flowsOutputSaveAs": "Save as…",
|
||||
"flowsOutputSaveAsTitle": "Save flow output",
|
||||
"flowsOutputSavedAt": "Saved to {path}",
|
||||
"@flowsOutputSavedAt": { "placeholders": { "path": { "type": "String" } } },
|
||||
"flowsOutputSaveFailed": "Save failed: {error}",
|
||||
"@flowsOutputSaveFailed": { "placeholders": { "error": { "type": "String" } } },
|
||||
"flowsOutputOpen": "Open",
|
||||
"flowsOutputOpenFailed": "Open failed: {error}",
|
||||
"@flowsOutputOpenFailed": { "placeholders": { "error": { "type": "String" } } },
|
||||
|
||||
"approvalsTitle": "Approvals",
|
||||
"approvalsTabPending": "Pending",
|
||||
|
|
|
|||
|
|
@ -2282,6 +2282,18 @@ abstract class AppLocalizations {
|
|||
/// **'Running {name}'**
|
||||
String flowsRunningTitle(String name);
|
||||
|
||||
/// No description provided for @flowsResultTitle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'{name} — result'**
|
||||
String flowsResultTitle(String name);
|
||||
|
||||
/// No description provided for @flowsErrorTitle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'{name} — failed'**
|
||||
String flowsErrorTitle(String name);
|
||||
|
||||
/// No description provided for @flowsRunning.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
|
|
@ -2294,6 +2306,54 @@ abstract class AppLocalizations {
|
|||
/// **'Flow completed with no declared outputs.'**
|
||||
String get flowsNoOutputs;
|
||||
|
||||
/// No description provided for @flowsOutputUnknown.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Output payload variant not recognised.'**
|
||||
String get flowsOutputUnknown;
|
||||
|
||||
/// No description provided for @flowsOutputBytesUnknownMime.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'binary'**
|
||||
String get flowsOutputBytesUnknownMime;
|
||||
|
||||
/// No description provided for @flowsOutputSaveAs.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Save as…'**
|
||||
String get flowsOutputSaveAs;
|
||||
|
||||
/// No description provided for @flowsOutputSaveAsTitle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Save flow output'**
|
||||
String get flowsOutputSaveAsTitle;
|
||||
|
||||
/// No description provided for @flowsOutputSavedAt.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Saved to {path}'**
|
||||
String flowsOutputSavedAt(String path);
|
||||
|
||||
/// No description provided for @flowsOutputSaveFailed.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Save failed: {error}'**
|
||||
String flowsOutputSaveFailed(String error);
|
||||
|
||||
/// No description provided for @flowsOutputOpen.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Open'**
|
||||
String get flowsOutputOpen;
|
||||
|
||||
/// No description provided for @flowsOutputOpenFailed.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Open failed: {error}'**
|
||||
String flowsOutputOpenFailed(String error);
|
||||
|
||||
/// No description provided for @approvalsTitle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
|
|
|
|||
|
|
@ -1308,12 +1308,52 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||
return '$name läuft';
|
||||
}
|
||||
|
||||
@override
|
||||
String flowsResultTitle(String name) {
|
||||
return '$name — Ergebnis';
|
||||
}
|
||||
|
||||
@override
|
||||
String flowsErrorTitle(String name) {
|
||||
return '$name — fehlgeschlagen';
|
||||
}
|
||||
|
||||
@override
|
||||
String get flowsRunning => 'Flow läuft…';
|
||||
|
||||
@override
|
||||
String get flowsNoOutputs => 'Flow abgeschlossen ohne deklarierte Outputs.';
|
||||
|
||||
@override
|
||||
String get flowsOutputUnknown => 'Unbekannter Output-Payload-Typ.';
|
||||
|
||||
@override
|
||||
String get flowsOutputBytesUnknownMime => 'Binärdaten';
|
||||
|
||||
@override
|
||||
String get flowsOutputSaveAs => 'Speichern unter…';
|
||||
|
||||
@override
|
||||
String get flowsOutputSaveAsTitle => 'Flow-Output speichern';
|
||||
|
||||
@override
|
||||
String flowsOutputSavedAt(String path) {
|
||||
return 'Gespeichert: $path';
|
||||
}
|
||||
|
||||
@override
|
||||
String flowsOutputSaveFailed(String error) {
|
||||
return 'Speichern fehlgeschlagen: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String get flowsOutputOpen => 'Öffnen';
|
||||
|
||||
@override
|
||||
String flowsOutputOpenFailed(String error) {
|
||||
return 'Öffnen fehlgeschlagen: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String get approvalsTitle => 'Freigaben';
|
||||
|
||||
|
|
|
|||
|
|
@ -1321,12 +1321,52 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||
return 'Running $name';
|
||||
}
|
||||
|
||||
@override
|
||||
String flowsResultTitle(String name) {
|
||||
return '$name — result';
|
||||
}
|
||||
|
||||
@override
|
||||
String flowsErrorTitle(String name) {
|
||||
return '$name — failed';
|
||||
}
|
||||
|
||||
@override
|
||||
String get flowsRunning => 'Flow running…';
|
||||
|
||||
@override
|
||||
String get flowsNoOutputs => 'Flow completed with no declared outputs.';
|
||||
|
||||
@override
|
||||
String get flowsOutputUnknown => 'Output payload variant not recognised.';
|
||||
|
||||
@override
|
||||
String get flowsOutputBytesUnknownMime => 'binary';
|
||||
|
||||
@override
|
||||
String get flowsOutputSaveAs => 'Save as…';
|
||||
|
||||
@override
|
||||
String get flowsOutputSaveAsTitle => 'Save flow output';
|
||||
|
||||
@override
|
||||
String flowsOutputSavedAt(String path) {
|
||||
return 'Saved to $path';
|
||||
}
|
||||
|
||||
@override
|
||||
String flowsOutputSaveFailed(String error) {
|
||||
return 'Save failed: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String get flowsOutputOpen => 'Open';
|
||||
|
||||
@override
|
||||
String flowsOutputOpenFailed(String error) {
|
||||
return 'Open failed: $error';
|
||||
}
|
||||
|
||||
@override
|
||||
String get approvalsTitle => 'Approvals';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue