Three connected improvements to the analyzer-driven diagnostics:
- **Pulsing halo on broken graph nodes**. Every step / pseudo-
node (inputs / outputs) carrying an analyzer issue now
breathes a red (error) or amber (warning) halo on the graph
tab — operator sees the problem on the canvas without
flipping to text. Honours prefers-reduced-motion: reduce-
motion users get a static halo at the same intensity. The
canvas reads severity via a new `stepIssueSeverity` map on
FlowEditorController; pseudo-nodes use `__inputs__` /
`__outputs__` sentinel ids.
- **Store-aware install button**. The analyzer now takes a
second closure, `storeCapabilities`, listing what the public
store can install. Unknown-capability issues only carry the
"Install …" quick-fix when the bare cap is in that list;
otherwise the issue carries an "Add source for …" fix
instead. Resolves the asymmetry the operator reported: the
Store didn't show `htw.digiscout/onet.lookup` but the editor
happily offered to install it (and would have failed). The
install path no longer lies about itself.
- **Did-you-mean suggestion**. When the unknown cap is within
edit-distance two of an installed or store cap (different
spelling — distance-0 stays hidden because that's an install
case, not a typo), the analyzer emits a `ReplaceLineValueFix`
suggesting the closest match. Preserves the version
constraint by reusing the installed spec when present
(e.g. `text.echi@^0.1` → `text.echo@^0.1`).
New public surface:
- `AddModuleSourceFix` + `AddModuleSourceCallback`
- `FlowEditorPage.storeCapabilities` + `onAddModuleSource`
- `FlowAnalyzer.stepSeverity` + the `kInputsNodeId` /
`kOutputsNodeId` sentinels
- `FlowIssueSeverity` enum + `FlowNode.issueSeverity`
Tests:
- Install fix only when in store
- AddModuleSourceFix as fallback when not in store
- Did-you-mean replaces install when a near miss exists
- stepSeverity populated for both step ids and pseudo-nodes
All 36 editor tests green. Bumped to 0.18.0.
Signed-off-by: flemming-it <sf@flemming.it>
52 lines
1.8 KiB
Dart
52 lines
1.8 KiB
Dart
/// Inline flow editor for F∆I Studio — swappable.
|
|
///
|
|
/// Studio depends on this package via pubspec.yaml. To use
|
|
/// a different editor, fork this repo, change the
|
|
/// implementation, point Studio's pubspec at the fork,
|
|
/// rebuild Studio.
|
|
///
|
|
/// Public surface:
|
|
///
|
|
/// * [FlowEditorPage] — the page widget Studio embeds as
|
|
/// its Flows destination. Three tabs over one in-memory
|
|
/// flow: graph (drag-and-drop WYSIWYG), text (raw YAML),
|
|
/// run (inputs form + live step progress + outputs).
|
|
/// * [FlowEditorLocale] — render language for inline
|
|
/// strings. Studio passes its active Locale through.
|
|
/// * [FlowRunDriver] — host-supplied bridge to the hub.
|
|
/// Studio implements it with the gRPC SDK; a CLI host
|
|
/// could shell out; a test harness can stub it in-memory.
|
|
/// * [FlowRunEvent] family — events the driver streams
|
|
/// during a run (StepStarted, StepCompleted, …).
|
|
/// * [FlowOutputValue] family — typed outputs the driver
|
|
/// returns when the run finishes.
|
|
library;
|
|
|
|
export 'src/editor_style.dart'
|
|
show FaiEditorStyle, EditorCanvasBackdrop, EditorPanelStyle;
|
|
export 'src/flow_editor_page.dart' show FlowEditorPage;
|
|
export 'src/l10n.dart' show FlowEditorLocale;
|
|
export 'src/quick_fix.dart'
|
|
show
|
|
InstallCapabilityCallback,
|
|
AddModuleSourceCallback,
|
|
QuickFix,
|
|
InstallCapabilityFix,
|
|
AddModuleSourceFix,
|
|
ReplaceLineValueFix,
|
|
IssueHoverRequest,
|
|
IssueHoverSeverity;
|
|
export 'src/run_driver.dart'
|
|
show
|
|
FlowRunDriver,
|
|
FlowRunEvent,
|
|
StepStarted,
|
|
StepCompleted,
|
|
StepFailed,
|
|
StepAwaitingApproval,
|
|
FlowOutputValue,
|
|
FlowOutputText,
|
|
FlowOutputJson,
|
|
FlowOutputBytes,
|
|
ModuleSpec,
|
|
ModuleField;
|