From 3099dbc5aadc9c4f2f047af7d268d71f7d0642de Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Fri, 23 Oct 2026 19:33:47 +0100 Subject: [PATCH] fix(app): the full-screen run graph has no maximise button --- .../graph/widgets/run_graph_view.dart | 20 ++++++++++++------- .../features/runs/ui/run_graph_preview.dart | 2 ++ .../runs/ui/run_detail_graph_tab_test.dart | 10 ++++++++++ 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/app/lib/features/graph/widgets/run_graph_view.dart b/app/lib/features/graph/widgets/run_graph_view.dart index f2a53419..3ce95beb 100644 --- a/app/lib/features/graph/widgets/run_graph_view.dart +++ b/app/lib/features/graph/widgets/run_graph_view.dart @@ -47,8 +47,12 @@ class RunGraphView extends StatefulWidget { this.selectedStage, this.now, this.showHeader = true, + this.expandable = true, }); + /// False when this graph is already the full-screen view: no maximise. + final bool expandable; + /// The run's definition graph, or null when the server omitted it. final JsonMap? graph; @@ -207,13 +211,15 @@ class _RunGraphViewState extends State { GraphViewport( controller: _viewport, contentSize: Size(geometry.$2.width, geometry.$2.height), - onExpand: () => _openExpanded( - nodes, - geometry.$1, - geometry.$2, - state, - statuses, - ), + onExpand: !widget.expandable + ? null + : () => _openExpanded( + nodes, + geometry.$1, + geometry.$2, + state, + statuses, + ), child: _runCanvas( nodes: nodes, layout: geometry.$1, diff --git a/app/lib/features/runs/ui/run_graph_preview.dart b/app/lib/features/runs/ui/run_graph_preview.dart index 0cec876f..cacbbee2 100644 --- a/app/lib/features/runs/ui/run_graph_preview.dart +++ b/app/lib/features/runs/ui/run_graph_preview.dart @@ -91,6 +91,8 @@ class RunGraphPreview extends StatelessWidget { Future _open(BuildContext context, bool cupertino) { Widget graphView(BuildContext pageContext) => RunGraphView( key: const Key('run-detail-graph'), + // Already full screen: no maximise button to open it again. + expandable: false, graph: graph, run: run, selectedStage: selectedStage, diff --git a/app/test/features/runs/ui/run_detail_graph_tab_test.dart b/app/test/features/runs/ui/run_detail_graph_tab_test.dart index d1a4cbbb..741326f6 100644 --- a/app/test/features/runs/ui/run_detail_graph_tab_test.dart +++ b/app/test/features/runs/ui/run_detail_graph_tab_test.dart @@ -112,4 +112,14 @@ void main() { }, ); } + + testWidgets('the full-screen graph offers no maximise button', ( + tester, + ) async { + await pumpRunDetail(tester, RunDetailTestPlatform.material); + await openRunDetailTab(tester, RunDetailTab.graph); + expect(find.byKey(const Key('run-detail-graph')), findsOneWidget); + expect(find.byKey(const Key('graph-expand')), findsNothing); + expect(find.byKey(const Key('graph-fit')), findsOneWidget); + }); }