diff --git a/app/lib/features/runs/ui/run_detail_tab_bodies.dart b/app/lib/features/runs/ui/run_detail_tab_bodies.dart index f2a70789..ca94f650 100644 --- a/app/lib/features/runs/ui/run_detail_tab_bodies.dart +++ b/app/lib/features/runs/ui/run_detail_tab_bodies.dart @@ -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, - ), - ), - ), - ], + ), ), ); } diff --git a/app/test/features/runs/ui/run_detail_summary_fields_test.dart b/app/test/features/runs/ui/run_detail_summary_fields_test.dart index cb413338..e4888493 100644 --- a/app/test/features/runs/ui/run_detail_summary_fields_test.dart +++ b/app/test/features/runs/ui/run_detail_summary_fields_test.dart @@ -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.