merge(app): land full-screen graph without maximise
This commit is contained in:
@@ -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<RunGraphView> {
|
||||
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,
|
||||
|
||||
@@ -91,6 +91,8 @@ class RunGraphPreview extends StatelessWidget {
|
||||
Future<void> _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,
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user