feat: editor project chip wiring (multi-project stage 2 host side)
Some checks failed
Security / Security check (push) Failing after 2s
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:
parent
2592a23cc0
commit
984c91f91d
3 changed files with 42 additions and 15 deletions
16
CHANGELOG.md
16
CHANGELOG.md
|
|
@ -5,6 +5,22 @@ version + `kStudioVersion` in `lib/main.dart` stay in lockstep.
|
||||||
|
|
||||||
## Unreleased
|
## 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)
|
### Fixed (usertest 2026-07-10 findings)
|
||||||
|
|
||||||
- **Approval prompts localize.** An approval whose flow step gave no
|
- **Approval prompts localize.** An approval whose flow step gave no
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import 'package:flutter/material.dart';
|
||||||
import '../data/error_presentation.dart';
|
import '../data/error_presentation.dart';
|
||||||
import '../data/flow_run_driver.dart';
|
import '../data/flow_run_driver.dart';
|
||||||
import '../data/hub.dart';
|
import '../data/hub.dart';
|
||||||
|
import '../data/workspace.dart';
|
||||||
import '../l10n/app_localizations.dart';
|
import '../l10n/app_localizations.dart';
|
||||||
|
|
||||||
class FlowsPage extends StatefulWidget {
|
class FlowsPage extends StatefulWidget {
|
||||||
|
|
@ -149,7 +150,11 @@ class _FlowsPageState extends State<FlowsPage> {
|
||||||
final editorLocale = locale.languageCode == 'de'
|
final editorLocale = locale.languageCode == 'de'
|
||||||
? FlowEditorLocale.de
|
? FlowEditorLocale.de
|
||||||
: FlowEditorLocale.en;
|
: FlowEditorLocale.en;
|
||||||
return FutureBuilder<List<String>>(
|
// 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,
|
future: _capabilities,
|
||||||
builder: (context, snap) {
|
builder: (context, snap) {
|
||||||
final caps = snap.data ?? const <String>[];
|
final caps = snap.data ?? const <String>[];
|
||||||
|
|
@ -161,8 +166,14 @@ class _FlowsPageState extends State<FlowsPage> {
|
||||||
storeCapabilities: _storeCaps,
|
storeCapabilities: _storeCaps,
|
||||||
onInstallCapability: _onInstallCapability,
|
onInstallCapability: _onInstallCapability,
|
||||||
onAddModuleSource: _onAddModuleSource,
|
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),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ packages:
|
||||||
path: "../fai_chain_studio_flow_editor"
|
path: "../fai_chain_studio_flow_editor"
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "0.21.2"
|
version: "0.22.0"
|
||||||
characters:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue