From 870bda178923543b852d7662617020c3f2376634 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Fri, 23 Oct 2026 13:28:57 +0100 Subject: [PATCH] fix(app): visit pane title, tabs and field card share the content inset --- .../pipelines/widgets/pipeline_tabs.dart | 3 +++ .../runs/ui/run_detail_tab_bodies.dart | 2 +- .../features/runs/ui/run_detail_visit.dart | 21 ++++++++----------- .../runs/ui/run_detail_visit_sections.dart | 3 +++ .../runs/ui/run_detail_visit_test.dart | 11 ++++++++++ 5 files changed, 27 insertions(+), 13 deletions(-) diff --git a/app/lib/features/pipelines/widgets/pipeline_tabs.dart b/app/lib/features/pipelines/widgets/pipeline_tabs.dart index d37dcffa..4bf0e08d 100644 --- a/app/lib/features/pipelines/widgets/pipeline_tabs.dart +++ b/app/lib/features/pipelines/widgets/pipeline_tabs.dart @@ -49,6 +49,9 @@ class PipelineDetailTabs extends StatelessWidget { Widget _cupertinoControl() { return CupertinoSegmentedControl( + // The strip already insets 16; the control's default inset would push + // the tabs out of line with the content. + padding: EdgeInsets.zero, groupValue: selected, onValueChanged: onSelected, children: { 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 0b0ebfb3..9ba30ac6 100644 --- a/app/lib/features/runs/ui/run_detail_tab_bodies.dart +++ b/app/lib/features/runs/ui/run_detail_tab_bodies.dart @@ -129,7 +129,7 @@ Widget runDetailFieldTab({ CupertinoListSection.insetGrouped( children: [ Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16, 0, 16, 16), + padding: const EdgeInsets.all(16), child: _CupertinoSelectableText(text), ), ], diff --git a/app/lib/features/runs/ui/run_detail_visit.dart b/app/lib/features/runs/ui/run_detail_visit.dart index 7510f250..ec77e561 100644 --- a/app/lib/features/runs/ui/run_detail_visit.dart +++ b/app/lib/features/runs/ui/run_detail_visit.dart @@ -165,18 +165,15 @@ class _RunVisitPaneState extends State { ), ], ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(8, 0, 0, 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - widget.visit.title, - key: const Key('run-visit-title'), - style: style.heading, - ), - ], - ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.visit.title, + key: const Key('run-visit-title'), + style: style.heading, + ), + ], ), ], ), diff --git a/app/lib/features/runs/ui/run_detail_visit_sections.dart b/app/lib/features/runs/ui/run_detail_visit_sections.dart index 24465a0d..810c9d99 100644 --- a/app/lib/features/runs/ui/run_detail_visit_sections.dart +++ b/app/lib/features/runs/ui/run_detail_visit_sections.dart @@ -63,6 +63,9 @@ class RunVisitSectionStrip extends StatelessWidget { ); Widget _cupertinoControl() => CupertinoSegmentedControl( + // The strip already insets 16; the control's default inset would push + // the tabs out of line with the content. + padding: EdgeInsets.zero, groupValue: selected, onValueChanged: onSelected, children: { diff --git a/app/test/features/runs/ui/run_detail_visit_test.dart b/app/test/features/runs/ui/run_detail_visit_test.dart index f8a84128..04bc8b17 100644 --- a/app/test/features/runs/ui/run_detail_visit_test.dart +++ b/app/test/features/runs/ui/run_detail_visit_test.dart @@ -31,6 +31,17 @@ void main() { } expect(find.text('Verdict'), findsOneWidget); expect(find.text('Diagnostic'), findsOneWidget); + + // The title, its facts and the section tabs share one leading edge; the + // Cupertino control's own default inset used to push the tabs 16 in. + final title = tester.getTopLeft(find.text('plan ยท visit 1')).dx; + expect( + tester.getTopLeft(find.textContaining('Status: completed')).dx, + title, + ); + // A centred segment label sits ~49 in from a 16 inset control (65), but + // 81 behind the control's default 16 inset. + expect(tester.getTopLeft(find.text('Input')).dx, lessThan(title + 56)); }); testWidgets('${platform.name} duration hides without both timestamps', (