Improve recorded visit heading hierarchy
This commit is contained in:
@@ -132,15 +132,35 @@ class _RunVisitPaneState extends State<RunVisitPane> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The visit's name; Back is the page bar's.
|
/// Keep stage identity visually distinct from the visit/run coordinates.
|
||||||
Widget _bar(_VisitStyle style) => Padding(
|
/// Back is the page bar's; this heading is the selected recorded stage.
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
Widget _bar(_VisitStyle style) {
|
||||||
child: Text(
|
final runId = '${widget.run['id'] ?? ''}'.trim();
|
||||||
widget.visit.title,
|
return Padding(
|
||||||
key: const Key('run-visit-title'),
|
padding: const EdgeInsetsDirectional.fromSTEB(0, 8, 0, 12),
|
||||||
style: style.heading,
|
child: Column(
|
||||||
),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
);
|
children: [
|
||||||
|
Text(
|
||||||
|
widget.visit.stage,
|
||||||
|
key: const Key('run-visit-title'),
|
||||||
|
style: style.stageTitle,
|
||||||
|
softWrap: true,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Wrap(
|
||||||
|
spacing: 12,
|
||||||
|
runSpacing: 4,
|
||||||
|
children: [
|
||||||
|
if (widget.visit.sequence != null)
|
||||||
|
Text('Visit ${widget.visit.sequence}', style: style.muted),
|
||||||
|
if (runId.isNotEmpty) Text('Run $runId', style: style.muted),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The visit's facts several to a line: status and outcome as coloured
|
/// The visit's facts several to a line: status and outcome as coloured
|
||||||
@@ -217,6 +237,7 @@ class _VisitStyle {
|
|||||||
required this.value,
|
required this.value,
|
||||||
required this.muted,
|
required this.muted,
|
||||||
required this.heading,
|
required this.heading,
|
||||||
|
required this.stageTitle,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory _VisitStyle.of(BuildContext context) {
|
factory _VisitStyle.of(BuildContext context) {
|
||||||
@@ -227,6 +248,7 @@ class _VisitStyle {
|
|||||||
value: theme.textTheme.textStyle,
|
value: theme.textTheme.textStyle,
|
||||||
muted: theme.textTheme.textStyle.copyWith(color: secondary),
|
muted: theme.textTheme.textStyle.copyWith(color: secondary),
|
||||||
heading: theme.textTheme.navTitleTextStyle,
|
heading: theme.textTheme.navTitleTextStyle,
|
||||||
|
stageTitle: theme.textTheme.navLargeTitleTextStyle,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
@@ -236,10 +258,12 @@ class _VisitStyle {
|
|||||||
color: theme.colorScheme.onSurfaceVariant,
|
color: theme.colorScheme.onSurfaceVariant,
|
||||||
),
|
),
|
||||||
heading: theme.textTheme.titleSmall ?? const TextStyle(),
|
heading: theme.textTheme.titleSmall ?? const TextStyle(),
|
||||||
|
stageTitle: theme.textTheme.headlineSmall ?? const TextStyle(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final TextStyle value;
|
final TextStyle value;
|
||||||
final TextStyle muted;
|
final TextStyle muted;
|
||||||
final TextStyle heading;
|
final TextStyle heading;
|
||||||
|
final TextStyle stageTitle;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,9 @@ void main() {
|
|||||||
await openVisit(tester, platform);
|
await openVisit(tester, platform);
|
||||||
|
|
||||||
expect(find.byKey(const Key('run-visit-pane')), findsOneWidget);
|
expect(find.byKey(const Key('run-visit-pane')), findsOneWidget);
|
||||||
expect(find.text('plan · visit 1'), findsOneWidget);
|
expect(find.text('plan'), findsOneWidget);
|
||||||
|
expect(find.text('Visit 1'), findsOneWidget);
|
||||||
|
expect(find.text('Run 77'), findsOneWidget);
|
||||||
// Each fact as its label over its value; several share a line.
|
// Each fact as its label over its value; several share a line.
|
||||||
for (final (label, value) in [
|
for (final (label, value) in [
|
||||||
('Status', 'completed'),
|
('Status', 'completed'),
|
||||||
@@ -34,8 +36,16 @@ void main() {
|
|||||||
expect(find.text('Verdict'), findsOneWidget);
|
expect(find.text('Verdict'), findsOneWidget);
|
||||||
expect(find.text('Diagnostic'), findsOneWidget);
|
expect(find.text('Diagnostic'), findsOneWidget);
|
||||||
|
|
||||||
// The title and its facts share one leading edge.
|
// Stage identity is a distinct, prominent heading; coordinates are
|
||||||
final title = tester.getTopLeft(find.text('plan · visit 1')).dx;
|
// subordinate and the facts remain aligned with the heading.
|
||||||
|
final titleFinder = find.byKey(const Key('run-visit-title'));
|
||||||
|
final title = tester.getTopLeft(titleFinder).dx;
|
||||||
|
final titleStyle = tester.widget<Text>(titleFinder).style!;
|
||||||
|
expect(titleStyle.fontSize!, greaterThan(18));
|
||||||
|
expect(
|
||||||
|
tester.getTopLeft(find.text('Visit 1')).dy,
|
||||||
|
greaterThan(tester.getTopLeft(titleFinder).dy),
|
||||||
|
);
|
||||||
expect(
|
expect(
|
||||||
tester.getTopLeft(find.byKey(const Key('run-visit-facts-grid'))).dx,
|
tester.getTopLeft(find.byKey(const Key('run-visit-facts-grid'))).dx,
|
||||||
title,
|
title,
|
||||||
@@ -98,6 +108,29 @@ void main() {
|
|||||||
expect(find.byKey(const Key('run-visit-pane')), findsOneWidget);
|
expect(find.byKey(const Key('run-visit-pane')), findsOneWidget);
|
||||||
expect(tester.takeException(), isNull);
|
expect(tester.takeException(), isNull);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
testWidgets('${platform.name} long stage identity wraps at 2x', (
|
||||||
|
tester,
|
||||||
|
) async {
|
||||||
|
final run = visitRunFixture();
|
||||||
|
firstVisitStep(run)['stage'] =
|
||||||
|
'review-generated-release-artifacts-and-verify-evidence';
|
||||||
|
await openVisit(
|
||||||
|
tester,
|
||||||
|
platform,
|
||||||
|
run: run,
|
||||||
|
size: const Size(320, 568),
|
||||||
|
scale: 2,
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(
|
||||||
|
find.text('review-generated-release-artifacts-and-verify-evidence'),
|
||||||
|
findsOneWidget,
|
||||||
|
);
|
||||||
|
expect(find.text('Visit 1'), findsOneWidget);
|
||||||
|
expect(find.text('Run 77'), findsOneWidget);
|
||||||
|
expect(tester.takeException(), isNull);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
testWidgets('session export with no configured endpoint states the hint', (
|
testWidgets('session export with no configured endpoint states the hint', (
|
||||||
|
|||||||
Reference in New Issue
Block a user