fix(app): the full-screen run graph has no maximise button

This commit is contained in:
2026-10-23 19:33:47 +01:00
parent 89da394a90
commit 3099dbc5aa
3 changed files with 25 additions and 7 deletions
@@ -47,8 +47,12 @@ class RunGraphView extends StatefulWidget {
this.selectedStage, this.selectedStage,
this.now, this.now,
this.showHeader = true, 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. /// The run's definition graph, or null when the server omitted it.
final JsonMap? graph; final JsonMap? graph;
@@ -207,13 +211,15 @@ class _RunGraphViewState extends State<RunGraphView> {
GraphViewport( GraphViewport(
controller: _viewport, controller: _viewport,
contentSize: Size(geometry.$2.width, geometry.$2.height), contentSize: Size(geometry.$2.width, geometry.$2.height),
onExpand: () => _openExpanded( onExpand: !widget.expandable
nodes, ? null
geometry.$1, : () => _openExpanded(
geometry.$2, nodes,
state, geometry.$1,
statuses, geometry.$2,
), state,
statuses,
),
child: _runCanvas( child: _runCanvas(
nodes: nodes, nodes: nodes,
layout: geometry.$1, layout: geometry.$1,
@@ -91,6 +91,8 @@ class RunGraphPreview extends StatelessWidget {
Future<void> _open(BuildContext context, bool cupertino) { Future<void> _open(BuildContext context, bool cupertino) {
Widget graphView(BuildContext pageContext) => RunGraphView( Widget graphView(BuildContext pageContext) => RunGraphView(
key: const Key('run-detail-graph'), key: const Key('run-detail-graph'),
// Already full screen: no maximise button to open it again.
expandable: false,
graph: graph, graph: graph,
run: run, run: run,
selectedStage: selectedStage, selectedStage: selectedStage,
@@ -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);
});
} }