feat: editor project chip wiring (multi-project stage 2 host side)
Some checks failed
Security / Security check (push) Failing after 2s

FlowsPage passes the active workspace to the editor and switches the
workspace when the operator accepts a file-wins mismatch. Rebuilds the
chip live on workspace change. Editor package bumped to 0.22.0.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-07-12 14:21:20 +02:00
parent 2592a23cc0
commit 984c91f91d
3 changed files with 42 additions and 15 deletions

View file

@ -5,6 +5,22 @@ version + `kStudioVersion` in `lib/main.dart` stay in lockstep.
## Unreleased
### Added (multi-project, stages ① + ②)
- **Workspace switcher.** The Audit and Approvals AppBars carry a
workspace control listing the hub's project registry (colour dot per
project, a shield for `protected`, an honesty tooltip). "All projects"
stays reachable — a filter, not a jail. The selection is persisted and
shared across pages; it re-scopes the audit list AND live stream
hub-side, scopes approvals (pending + history), and drives the sidebar
approval badge. Runs launched from the editor are stamped with the
active workspace — unless the flow file declares its own `project:`,
in which case the file wins (CLI semantics).
- **Editor project chip + file-wins guard.** A flow file's own
`project:` shows as a chip; on mismatch with the active workspace an
amber pill offers a one-click switch (the file still wins for the run).
Backed by editor package 0.22.0.
### Fixed (usertest 2026-07-10 findings)
- **Approval prompts localize.** An approval whose flow step gave no

View file

@ -16,6 +16,7 @@ import 'package:flutter/material.dart';
import '../data/error_presentation.dart';
import '../data/flow_run_driver.dart';
import '../data/hub.dart';
import '../data/workspace.dart';
import '../l10n/app_localizations.dart';
class FlowsPage extends StatefulWidget {
@ -149,20 +150,30 @@ class _FlowsPageState extends State<FlowsPage> {
final editorLocale = locale.languageCode == 'de'
? FlowEditorLocale.de
: FlowEditorLocale.en;
return FutureBuilder<List<String>>(
future: _capabilities,
builder: (context, snap) {
final caps = snap.data ?? const <String>[];
return FlowEditorPage(
initialFlowName: widget.initialFlowName,
locale: editorLocale,
runDriver: _driver,
availableCapabilities: caps,
storeCapabilities: _storeCaps,
onInstallCapability: _onInstallCapability,
onAddModuleSource: _onAddModuleSource,
);
},
// Rebuild the editor's project chip when the workspace changes,
// so a mismatch banner appears/clears live.
return ListenableBuilder(
listenable: Workspace.instance,
builder: (context, _) => FutureBuilder<List<String>>(
future: _capabilities,
builder: (context, snap) {
final caps = snap.data ?? const <String>[];
return FlowEditorPage(
initialFlowName: widget.initialFlowName,
locale: editorLocale,
runDriver: _driver,
availableCapabilities: caps,
storeCapabilities: _storeCaps,
onInstallCapability: _onInstallCapability,
onAddModuleSource: _onAddModuleSource,
activeProject: Workspace.instance.activeSlug,
// The file wins for the run; accepting the switch only
// aligns the workspace view to the file's project.
onSwitchToFileProject: (slug) =>
Workspace.instance.setActive(slug),
);
},
),
);
}
}

View file

@ -46,7 +46,7 @@ packages:
path: "../fai_chain_studio_flow_editor"
relative: true
source: path
version: "0.21.2"
version: "0.22.0"
characters:
dependency: transitive
description: