fix(app): pipeline Run and Runs share one action row, as the web
This commit is contained in:
@@ -330,33 +330,37 @@ class _PipelineDetailPanelState extends State<PipelineDetailPanel> {
|
||||
children: [
|
||||
heading,
|
||||
const SizedBox(height: 4),
|
||||
Align(
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
child: RunPipelineAction(
|
||||
controller: _controller,
|
||||
detail: detail,
|
||||
gateway: widget.gateway,
|
||||
onRunStarted: widget.onRunStarted,
|
||||
),
|
||||
),
|
||||
Align(
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
child: Semantics(
|
||||
button: true,
|
||||
label: detail.name.trim().isEmpty
|
||||
? 'View runs of this pipeline'
|
||||
: 'View runs of ${detail.name}',
|
||||
child: ExcludeSemantics(
|
||||
child: TextButton.icon(
|
||||
onPressed: widget.onViewPipelineRuns == null
|
||||
? null
|
||||
: () => widget.onViewPipelineRuns!(detail.id),
|
||||
icon: const Icon(Icons.list_alt),
|
||||
label: const Text('Runs'),
|
||||
key: const Key('pipeline-view-runs'),
|
||||
// One action row, as the web's `.pipeline-actions`: the primary Run,
|
||||
// then the secondary Runs, 8 apart.
|
||||
Wrap(
|
||||
key: const Key('pipeline-actions'),
|
||||
spacing: 8,
|
||||
runSpacing: 4,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: [
|
||||
RunPipelineAction(
|
||||
controller: _controller,
|
||||
detail: detail,
|
||||
gateway: widget.gateway,
|
||||
onRunStarted: widget.onRunStarted,
|
||||
),
|
||||
Semantics(
|
||||
button: true,
|
||||
label: detail.name.trim().isEmpty
|
||||
? 'View runs of this pipeline'
|
||||
: 'View runs of ${detail.name}',
|
||||
child: ExcludeSemantics(
|
||||
child: OutlinedButton.icon(
|
||||
onPressed: widget.onViewPipelineRuns == null
|
||||
? null
|
||||
: () => widget.onViewPipelineRuns!(detail.id),
|
||||
icon: const Icon(Icons.list_alt),
|
||||
label: const Text('Runs'),
|
||||
key: const Key('pipeline-view-runs'),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -106,6 +106,11 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.bySemanticsLabel('View runs of Alpha review'), findsOneWidget);
|
||||
// Run and Runs share one action row, as the web's pipeline actions.
|
||||
final runs = tester.getCenter(find.byKey(const Key('pipeline-view-runs')));
|
||||
final actions = tester.getRect(find.byKey(const Key('pipeline-actions')));
|
||||
expect(actions.height, lessThan(56));
|
||||
expect(runs.dx, greaterThan(actions.left + 40));
|
||||
await tester.tap(find.byKey(const Key('pipeline-view-runs')));
|
||||
expect(opened, [1]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user