merge(app): land diagnostic collapsible

This commit is contained in:
2026-10-23 18:29:22 +01:00
2 changed files with 42 additions and 50 deletions
@@ -212,37 +212,30 @@ Widget _summaryFacts(
);
}
/// A long recorded block (the Diagnostic) starts collapsed under its label.
Widget _materialBlock(BuildContext context, DetailSummaryRow row) {
final theme = Theme.of(context);
return Padding(
return ExpansionTile(
key: ValueKey('run-detail-summary-${_slug(row.label)}'),
padding: const EdgeInsets.fromLTRB(16, 8, 16, 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
row.label,
title: Text(row.label),
expandedCrossAxisAlignment: CrossAxisAlignment.start,
childrenPadding: const EdgeInsetsDirectional.fromSTEB(16, 0, 16, 16),
children: [
Container(
width: double.infinity,
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: theme.colorScheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(8),
),
child: SelectableText(
row.value,
style: theme.textTheme.bodySmall?.copyWith(
color: theme.colorScheme.onSurfaceVariant,
fontFamily: appMonospaceFamily,
),
),
const SizedBox(height: 4),
Container(
width: double.infinity,
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: theme.colorScheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(8),
),
child: SelectableText(
row.value,
style: theme.textTheme.bodySmall?.copyWith(
fontFamily: appMonospaceFamily,
),
),
),
],
),
),
],
);
}
@@ -279,36 +272,28 @@ Widget _cupertinoIdentity(BuildContext context, String identity) {
);
}
/// A long recorded block (the Diagnostic) starts collapsed under its label.
Widget _cupertinoBlock(BuildContext context, DetailSummaryRow row) {
final theme = CupertinoTheme.of(context);
return Padding(
return CupertinoExpansionTile(
key: ValueKey('run-detail-summary-${_slug(row.label)}'),
padding: const EdgeInsetsDirectional.fromSTEB(16, 12, 16, 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
row.label,
style: theme.textTheme.tabLabelTextStyle.copyWith(
color: CupertinoColors.secondaryLabel.resolveFrom(context),
title: Text(row.label),
child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16, 0, 16, 16),
child: Container(
width: double.infinity,
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: CupertinoColors.tertiarySystemFill.resolveFrom(context),
borderRadius: BorderRadius.circular(8),
),
child: Text(
row.value,
style: theme.textTheme.textStyle.copyWith(
fontFamily: appMonospaceFamily,
),
),
const SizedBox(height: 4),
Container(
width: double.infinity,
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: CupertinoColors.tertiarySystemFill.resolveFrom(context),
borderRadius: BorderRadius.circular(8),
),
child: Text(
row.value,
style: theme.textTheme.textStyle.copyWith(
fontFamily: appMonospaceFamily,
),
),
),
],
),
),
);
}
@@ -145,6 +145,13 @@ void main() {
expect(find.text(finished!), findsOneWidget);
expect(find.text('2m 5s'), findsOneWidget);
expect(find.text('run 12'), findsOneWidget);
// The Diagnostic starts collapsed under its label.
expect(find.text('Traceback: boom'), findsNothing);
final diagnostic = find.text('Diagnostic');
await tester.ensureVisible(diagnostic);
await tester.pumpAndSettle();
await tester.tap(diagnostic);
await tester.pumpAndSettle();
expect(find.text('Traceback: boom'), findsOneWidget);
// The web run detail has no usage block, so no metrics tile is drawn.