fix(app): pipeline Run and Runs share one action row, as the web

This commit is contained in:
2026-10-23 13:32:22 +01:00
parent f759579c4d
commit 57a4844d4f
2 changed files with 34 additions and 25 deletions
@@ -330,33 +330,37 @@ class _PipelineDetailPanelState extends State<PipelineDetailPanel> {
children: [ children: [
heading, heading,
const SizedBox(height: 4), const SizedBox(height: 4),
Align( // One action row, as the web's `.pipeline-actions`: the primary Run,
alignment: AlignmentDirectional.centerStart, // then the secondary Runs, 8 apart.
child: RunPipelineAction( Wrap(
controller: _controller, key: const Key('pipeline-actions'),
detail: detail, spacing: 8,
gateway: widget.gateway, runSpacing: 4,
onRunStarted: widget.onRunStarted, crossAxisAlignment: WrapCrossAlignment.center,
), children: [
), RunPipelineAction(
Align( controller: _controller,
alignment: AlignmentDirectional.centerStart, detail: detail,
child: Semantics( gateway: widget.gateway,
button: true, onRunStarted: widget.onRunStarted,
label: detail.name.trim().isEmpty ),
? 'View runs of this pipeline' Semantics(
: 'View runs of ${detail.name}', button: true,
child: ExcludeSemantics( label: detail.name.trim().isEmpty
child: TextButton.icon( ? 'View runs of this pipeline'
onPressed: widget.onViewPipelineRuns == null : 'View runs of ${detail.name}',
? null child: ExcludeSemantics(
: () => widget.onViewPipelineRuns!(detail.id), child: OutlinedButton.icon(
icon: const Icon(Icons.list_alt), onPressed: widget.onViewPipelineRuns == null
label: const Text('Runs'), ? null
key: const Key('pipeline-view-runs'), : () => 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(); await tester.pumpAndSettle();
expect(find.bySemanticsLabel('View runs of Alpha review'), findsOneWidget); 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'))); await tester.tap(find.byKey(const Key('pipeline-view-runs')));
expect(opened, [1]); expect(opened, [1]);
}); });