feat(workspace): sealed-area names are confidential by default
Some checks failed
Security / Security check (push) Failing after 2s
Some checks failed
Security / Security check (push) Failing after 2s
The switcher listed sealed areas by name ('lbs', 'stromnetz') on
any glance or screenshot — but the names themselves often carry
client/mandate identity (usertest security finding). The sealed
section now renders one aggregated row ('2 sealed areas') with a
deliberate 'Show names' reveal per menu opening; selection still
pops the regular s:<slug> value. Settings -> Security gains 'list
sealed areas with their names right away' (WorkspacePrefs,
SidebarPrefs pattern, default off).
The aggregate row wraps to two lines — popup menus cap their
width and action texts must never be truncated (the first cut
showed '1 abgeschotte…' in the proof shot). Guard: switcher tests
cover aggregated-until-reveal and the Settings toggle; the old
direct-listing test now asserts the reveal contract. DE+EN.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
parent
ed680c507a
commit
588f437395
11 changed files with 370 additions and 41 deletions
|
|
@ -9,6 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
|
|||
import 'package:chain_studio/data/hub.dart';
|
||||
import 'package:chain_studio/data/sealed_areas.dart';
|
||||
import 'package:chain_studio/data/workspace.dart';
|
||||
import 'package:chain_studio/data/workspace_prefs.dart';
|
||||
import 'package:chain_studio/l10n/app_localizations.dart';
|
||||
import 'package:chain_studio/widgets/chain_workspace_switcher.dart';
|
||||
|
||||
|
|
@ -41,6 +42,48 @@ void main() {
|
|||
Workspace.instance.debugSeed(projects: [_general, _clientA], active: '');
|
||||
});
|
||||
|
||||
tearDown(() {
|
||||
WorkspacePrefs.sealedNamesVisible.value = false;
|
||||
});
|
||||
|
||||
testWidgets('sealed areas stay aggregated until deliberately revealed', (
|
||||
tester,
|
||||
) async {
|
||||
Workspace.instance.debugSeed(
|
||||
projects: [_general],
|
||||
active: '',
|
||||
sealed: [_sealedGrid, _sealedLab],
|
||||
);
|
||||
await tester.pumpWidget(_host());
|
||||
await tester.tap(find.byType(ChainWorkspaceSwitcher));
|
||||
await tester.pumpAndSettle();
|
||||
// No names on a casual glance — only the aggregate row.
|
||||
expect(find.text('grid'), findsNothing);
|
||||
expect(find.text('lab'), findsNothing);
|
||||
expect(find.text('2 sealed areas'), findsOneWidget);
|
||||
await tester.tap(find.text('Show names'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('grid'), findsOneWidget);
|
||||
expect(find.text('lab'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('the Settings toggle restores the direct listing', (
|
||||
tester,
|
||||
) async {
|
||||
WorkspacePrefs.sealedNamesVisible.value = true;
|
||||
Workspace.instance.debugSeed(
|
||||
projects: [_general],
|
||||
active: '',
|
||||
sealed: [_sealedGrid, _sealedLab],
|
||||
);
|
||||
await tester.pumpWidget(_host());
|
||||
await tester.tap(find.byType(ChainWorkspaceSwitcher));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('grid'), findsOneWidget);
|
||||
expect(find.text('lab'), findsOneWidget);
|
||||
expect(find.text('2 sealed areas'), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('shows "All projects" when no project is active', (
|
||||
tester,
|
||||
) async {
|
||||
|
|
@ -113,12 +156,15 @@ void main() {
|
|||
await tester.tap(find.byType(ChainWorkspaceSwitcher));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
// Sealed areas appear under the sealed header with a lock icon
|
||||
// and a running/stopped status word.
|
||||
// Sealed areas appear under the sealed header, aggregated by
|
||||
// default (confidentiality); after the reveal every area shows
|
||||
// its lock icon and running/stopped status word.
|
||||
expect(find.text('SEALED AREAS'), findsOneWidget);
|
||||
expect(find.byIcon(Icons.lock_outline), findsWidgets);
|
||||
await tester.tap(find.text('Show names'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Grid'), findsOneWidget);
|
||||
expect(find.text('Bank'), findsOneWidget);
|
||||
expect(find.byIcon(Icons.lock_outline), findsWidgets);
|
||||
expect(find.text('running'), findsOneWidget);
|
||||
expect(find.text('stopped'), findsOneWidget);
|
||||
});
|
||||
|
|
@ -145,3 +191,22 @@ void main() {
|
|||
expect(find.byIcon(Icons.lock_outline), findsWidgets);
|
||||
});
|
||||
}
|
||||
|
||||
// Sealed-area confidentiality (usertest security finding): the
|
||||
// switcher must not disclose sealed-area names — often client
|
||||
// identity — on a casual glance. Aggregated row by default,
|
||||
// deliberate reveal, Settings toggle for the direct listing.
|
||||
const _sealedGrid = SealedArea(
|
||||
slug: 'grid',
|
||||
name: 'grid',
|
||||
color: '#e0a458',
|
||||
port: 51100,
|
||||
running: false,
|
||||
);
|
||||
const _sealedLab = SealedArea(
|
||||
slug: 'lab',
|
||||
name: 'lab',
|
||||
color: '#c25e5e',
|
||||
port: 51101,
|
||||
running: true,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue