fix(app): float content behind top bars and give each wide pane its own bar row
- Top-bar clearance helpers (withTopBarClearance, withBarClearance, SliverTopBarClearance, BelowTopBar, TopBarNotices); shell, DetailPane and the runs/pipelines/templates/artifacts/stage definition/filter/usage pages drop their top SafeArea and pad their own lists, pinned headers pin at the inset. - Wide windows: the shell bar narrows to the list pane (ShellPaneSplit) and the open item's bar shares its row; item tabs float at the pane's top (PageTabsEdge) instead of stacking on the shell's tab bar; the floating tab pill no longer swells over leftover media padding. - Pipeline detail is a DetailPane on wide too; Run/Runs move from FABs into the bar's actions; name and identity live in the title pill. - Run detail title pill shows the real title with Run N, pipeline and version (the pill links to the pipeline); the body keeps only status, actions and notices; standalone detail draws the same segmented bar. - One Runs tab badge: attention outranks running. - Tests for content-behind-bar padding and the no-stacking wide layout; notes/app-chrome-fixes.md.
This commit is contained in:
@@ -217,7 +217,20 @@ class _PipelinesScreenState extends State<PipelinesScreen> {
|
||||
final body = LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final wide = showsListBesideDetail(context);
|
||||
// On a phone an open pipeline is its own page over the tabs.
|
||||
// The open pipeline publishes its name, identity and Run/Runs to
|
||||
// its own bar: a page over the tabs on a phone, a pane beside the
|
||||
// list (on the shell bar's row) when wide.
|
||||
Widget detail() => PipelineDetailPanel(
|
||||
controller: _controller,
|
||||
gateway: widget.gateway,
|
||||
showBack: false,
|
||||
onRunStarted: widget.onRunStarted,
|
||||
onViewPipelineRuns: widget.onViewPipelineRuns,
|
||||
stageKey: stageKey,
|
||||
stagePipelineId: widget.initialPipelineId,
|
||||
stageVersion: widget.initialVersion,
|
||||
stageRequest: _stageRequest,
|
||||
);
|
||||
_page.sync(
|
||||
context,
|
||||
selected: _controller.hasSelection && !wide,
|
||||
@@ -225,20 +238,7 @@ class _PipelinesScreenState extends State<PipelinesScreen> {
|
||||
onClosed: _controller.clearSelection,
|
||||
builder: (context) => AnimatedBuilder(
|
||||
animation: _controller,
|
||||
builder: (context, _) => ShellBar(
|
||||
title: _controller.detail?.displayName,
|
||||
child: PipelineDetailPanel(
|
||||
controller: _controller,
|
||||
gateway: widget.gateway,
|
||||
showBack: false,
|
||||
onRunStarted: widget.onRunStarted,
|
||||
onViewPipelineRuns: widget.onViewPipelineRuns,
|
||||
stageKey: stageKey,
|
||||
stagePipelineId: widget.initialPipelineId,
|
||||
stageVersion: widget.initialVersion,
|
||||
stageRequest: _stageRequest,
|
||||
),
|
||||
),
|
||||
builder: (context, _) => detail(),
|
||||
),
|
||||
);
|
||||
if (!wide) {
|
||||
@@ -250,17 +250,14 @@ class _PipelinesScreenState extends State<PipelinesScreen> {
|
||||
list: ContentWidth(
|
||||
child: PipelineListPanel(controller: _controller),
|
||||
),
|
||||
detail: PipelineDetailPanel(
|
||||
controller: _controller,
|
||||
gateway: widget.gateway,
|
||||
showBack: false,
|
||||
onRunStarted: widget.onRunStarted,
|
||||
onViewPipelineRuns: widget.onViewPipelineRuns,
|
||||
stageKey: stageKey,
|
||||
stagePipelineId: widget.initialPipelineId,
|
||||
stageVersion: widget.initialVersion,
|
||||
stageRequest: _stageRequest,
|
||||
),
|
||||
detail: _controller.hasSelection
|
||||
? DetailPane(
|
||||
key: const ValueKey('pipeline-detail-pane'),
|
||||
destination: AppDestination.pipelines,
|
||||
implyBack: false,
|
||||
builder: (_) => detail(),
|
||||
)
|
||||
: detail(),
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -362,7 +359,7 @@ class _PipelinesScreenState extends State<PipelinesScreen> {
|
||||
_refreshButton(context),
|
||||
],
|
||||
),
|
||||
body: SafeArea(child: body),
|
||||
body: SafeArea(top: false, child: body),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -377,7 +374,7 @@ class _PipelinesScreenState extends State<PipelinesScreen> {
|
||||
_refreshButton(context),
|
||||
],
|
||||
),
|
||||
child: SafeArea(child: body),
|
||||
child: SafeArea(top: false, child: body),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,11 +24,12 @@ class RunPipelineAction extends StatefulWidget {
|
||||
required this.detail,
|
||||
required this.gateway,
|
||||
this.onRunStarted,
|
||||
this.fab = false,
|
||||
this.inBar = false,
|
||||
});
|
||||
|
||||
/// A floating action button instead of an inline button.
|
||||
final bool fab;
|
||||
/// The compact icon-and-word button of a top bar's actions pill instead
|
||||
/// of an inline button.
|
||||
final bool inBar;
|
||||
|
||||
final PipelinesController controller;
|
||||
final PipelineDetail detail;
|
||||
@@ -169,8 +170,8 @@ class _RunPipelineActionState extends State<RunPipelineAction> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final label = const Text(runPipelineActionLabel);
|
||||
if (widget.fab) {
|
||||
return pipelineFab(
|
||||
if (widget.inBar) {
|
||||
return pipelineBarAction(
|
||||
context,
|
||||
key: runPipelineActionKey,
|
||||
primary: true,
|
||||
@@ -195,9 +196,10 @@ class _RunPipelineActionState extends State<RunPipelineAction> {
|
||||
}
|
||||
}
|
||||
|
||||
/// A floating action for a pipeline: Material's extended FAB, or on Cupertino
|
||||
/// a filled pill with the same icon and word and a soft shadow.
|
||||
Widget pipelineFab(
|
||||
/// A pipeline action in its top bar's actions pill: the icon and word as one
|
||||
/// compact button. The primary action (Run) is filled so it reads apart from
|
||||
/// the plain ones around it.
|
||||
Widget pipelineBarAction(
|
||||
BuildContext context, {
|
||||
required Key key,
|
||||
required bool primary,
|
||||
@@ -212,45 +214,39 @@ Widget pipelineFab(
|
||||
children: [
|
||||
Icon(cupertinoIcon, size: 18),
|
||||
const SizedBox(width: 6),
|
||||
Text(label),
|
||||
Flexible(child: Text(label, maxLines: 1, softWrap: false)),
|
||||
],
|
||||
);
|
||||
return DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(28),
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Color(0x33000000),
|
||||
blurRadius: 8,
|
||||
offset: Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: primary
|
||||
? CupertinoButton.filled(
|
||||
key: key,
|
||||
borderRadius: BorderRadius.circular(28),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 14),
|
||||
onPressed: onPressed,
|
||||
child: content,
|
||||
)
|
||||
: CupertinoButton.tinted(
|
||||
key: key,
|
||||
borderRadius: BorderRadius.circular(28),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 14),
|
||||
onPressed: onPressed,
|
||||
child: content,
|
||||
),
|
||||
);
|
||||
const padding = EdgeInsets.symmetric(horizontal: 12, vertical: 6);
|
||||
return primary
|
||||
? CupertinoButton.filled(
|
||||
key: key,
|
||||
padding: padding,
|
||||
minimumSize: Size.zero,
|
||||
onPressed: onPressed,
|
||||
child: content,
|
||||
)
|
||||
: CupertinoButton(
|
||||
key: key,
|
||||
padding: padding,
|
||||
minimumSize: Size.zero,
|
||||
onPressed: onPressed,
|
||||
child: content,
|
||||
);
|
||||
}
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
return FloatingActionButton.extended(
|
||||
key: key,
|
||||
heroTag: key,
|
||||
backgroundColor: primary ? null : scheme.secondaryContainer,
|
||||
foregroundColor: primary ? null : scheme.onSecondaryContainer,
|
||||
onPressed: onPressed,
|
||||
icon: Icon(materialIcon),
|
||||
label: Text(label),
|
||||
);
|
||||
final icon = Icon(materialIcon);
|
||||
final text = Text(label, maxLines: 1, softWrap: false);
|
||||
return primary
|
||||
? FilledButton.icon(
|
||||
key: key,
|
||||
onPressed: onPressed,
|
||||
icon: icon,
|
||||
label: text,
|
||||
)
|
||||
: TextButton.icon(
|
||||
key: key,
|
||||
onPressed: onPressed,
|
||||
icon: icon,
|
||||
label: text,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,10 +4,12 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../core/api_gateway.dart';
|
||||
import '../../../shell/shell_bar.dart';
|
||||
import '../../../ui/adaptive/floating_bar_layout.dart';
|
||||
import '../../graph/domain/graph_definition.dart';
|
||||
import '../../graph/widgets/stage_definition_view.dart';
|
||||
import '../pipeline_models.dart';
|
||||
import '../pipeline_query.dart';
|
||||
import '../pipelines_controller.dart';
|
||||
import '../ui/run_pipeline_action.dart';
|
||||
import 'pipeline_controls.dart';
|
||||
@@ -95,18 +97,47 @@ class _PipelineDetailPanelState extends State<PipelineDetailPanel> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final detail = _controller.detail;
|
||||
if (detail == null) return _withoutDetail(context);
|
||||
// In a page or pane the pipeline's name, identity and actions are its top
|
||||
// bar's; on its own the panel heads itself.
|
||||
final inBar = ShellBar.available(context);
|
||||
if (detail == null) {
|
||||
// Nothing selected is the bare placeholder beside the list; it must
|
||||
// not take a bar over.
|
||||
if (!_controller.hasSelection) return _withoutDetail(context);
|
||||
return ShellBar(child: _withoutDetail(context));
|
||||
}
|
||||
_retainGraphSelection(detail);
|
||||
_applyStageRequest(context, detail);
|
||||
final notices = [
|
||||
if (!inBar) _header(context, detail),
|
||||
if (_controller.detailLoading)
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
child: PipelineProgress(label: 'Refreshing pipeline detail'),
|
||||
),
|
||||
if (_controller.detailError != null)
|
||||
PipelineErrorBanner(
|
||||
message: _controller.detailError!,
|
||||
onRetry: _controller.retryDetail,
|
||||
),
|
||||
];
|
||||
final panel = LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final headerLimit = _headerLimit(constraints);
|
||||
// The tabs float over the bottom of the tab body, as in the run
|
||||
// detail: full width on a phone, at the right edge of a wide pane.
|
||||
// The tabs float over the tab body: at the bottom on a phone page,
|
||||
// under the pane's top bar beside a list (never on the shell's bar).
|
||||
final edge = PageTabsEdge.of(context);
|
||||
final tabs = PipelineDetailTabs(
|
||||
selected: _tab,
|
||||
edge: edge,
|
||||
onSelected: (tab) => setState(() => _tab = tab),
|
||||
);
|
||||
// With nothing above it the tab body reaches the top edge and scrolls
|
||||
// behind the bar; notices stay below the bar and the body below them.
|
||||
// The structure is the same either way, so a refresh never remounts
|
||||
// the open tab.
|
||||
final media = MediaQuery.of(context);
|
||||
final inset = media.padding.top;
|
||||
return Column(
|
||||
key: const Key('pipeline-detail'),
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
@@ -114,23 +145,10 @@ class _PipelineDetailPanelState extends State<PipelineDetailPanel> {
|
||||
ConstrainedBox(
|
||||
constraints: BoxConstraints(maxHeight: headerLimit),
|
||||
child: SingleChildScrollView(
|
||||
padding: EdgeInsets.only(top: notices.isEmpty ? 0 : inset),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
_header(context, detail),
|
||||
if (_controller.detailLoading)
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
child: PipelineProgress(
|
||||
label: 'Refreshing pipeline detail',
|
||||
),
|
||||
),
|
||||
if (_controller.detailError != null)
|
||||
PipelineErrorBanner(
|
||||
message: _controller.detailError!,
|
||||
onRetry: _controller.retryDetail,
|
||||
),
|
||||
],
|
||||
children: notices,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -138,36 +156,35 @@ class _PipelineDetailPanelState extends State<PipelineDetailPanel> {
|
||||
// scroll their own content; the graph fills the slot so its canvas
|
||||
// is never asked for an unbounded extent inside a scroll view.
|
||||
Expanded(
|
||||
child: FloatingBarOverlay(
|
||||
bar: tabs,
|
||||
child: Builder(
|
||||
builder: (context) => Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: switch (_tab) {
|
||||
PipelineDetailTab.summary => _scrolling(
|
||||
PipelineSummaryView(
|
||||
controller: _controller,
|
||||
detail: detail,
|
||||
gateway: widget.gateway,
|
||||
),
|
||||
),
|
||||
PipelineDetailTab.graph => PipelineGraphTab(
|
||||
detail: detail,
|
||||
selectedStage: _graphSelection,
|
||||
onSelected: (stageKey) =>
|
||||
_openGraphStage(context, detail, stageKey),
|
||||
),
|
||||
PipelineDetailTab.source => _source(context, detail),
|
||||
},
|
||||
child: MediaQuery(
|
||||
data: media.copyWith(
|
||||
padding: media.padding.copyWith(
|
||||
top: notices.isEmpty ? inset : 0,
|
||||
),
|
||||
),
|
||||
child: FloatingBarOverlay(
|
||||
edge: edge,
|
||||
bar: tabs,
|
||||
child: Builder(
|
||||
builder: (context) => switch (_tab) {
|
||||
PipelineDetailTab.summary => _scrolling(
|
||||
PipelineSummaryView(
|
||||
controller: _controller,
|
||||
detail: detail,
|
||||
gateway: widget.gateway,
|
||||
showIdentity: !inBar,
|
||||
),
|
||||
),
|
||||
// Run and Runs float over the content, above the tabs.
|
||||
PositionedDirectional(
|
||||
end: 16,
|
||||
bottom: 16 + MediaQuery.paddingOf(context).bottom,
|
||||
child: _fabs(context, detail),
|
||||
PipelineDetailTab.graph => BelowTopBar(
|
||||
child: PipelineGraphTab(
|
||||
detail: detail,
|
||||
selectedStage: _graphSelection,
|
||||
onSelected: (stageKey) =>
|
||||
_openGraphStage(context, detail, stageKey),
|
||||
),
|
||||
),
|
||||
],
|
||||
PipelineDetailTab.source => _source(context, detail),
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -176,7 +193,12 @@ class _PipelineDetailPanelState extends State<PipelineDetailPanel> {
|
||||
);
|
||||
},
|
||||
);
|
||||
return panel;
|
||||
return ShellBar(
|
||||
title: detail.displayName,
|
||||
subtitle: pipelineSubtitle(detail),
|
||||
actions: _actions(context, detail),
|
||||
child: panel,
|
||||
);
|
||||
}
|
||||
|
||||
/// The header keeps its natural height while at least
|
||||
@@ -345,56 +367,62 @@ class _PipelineDetailPanelState extends State<PipelineDetailPanel> {
|
||||
: title;
|
||||
return Padding(
|
||||
key: const Key('pipeline-detail-header'),
|
||||
// The web detail head is a compact single identity line; the recorded
|
||||
// id/version/stage facts live at the top of the Summary tab.
|
||||
// On its own (no top bar) the panel heads itself with the pipeline's
|
||||
// name and its actions; the recorded id/version/stage facts live at the
|
||||
// top of the Summary tab.
|
||||
padding: const EdgeInsets.fromLTRB(12, 6, 12, 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [heading],
|
||||
children: [
|
||||
heading,
|
||||
Align(
|
||||
alignment: AlignmentDirectional.centerEnd,
|
||||
child: Wrap(
|
||||
key: const Key('pipeline-actions'),
|
||||
spacing: 8,
|
||||
runSpacing: 4,
|
||||
children: _actions(context, detail),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Run and Runs float at the bottom right: Runs above, the primary Run at
|
||||
/// the edge.
|
||||
Widget _fabs(BuildContext context, PipelineDetail detail) => Column(
|
||||
key: const Key('pipeline-actions'),
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Semantics(
|
||||
button: true,
|
||||
label: detail.name.trim().isEmpty
|
||||
? 'View runs of this pipeline'
|
||||
: 'View runs of ${detail.name}',
|
||||
child: ExcludeSemantics(
|
||||
child: pipelineFab(
|
||||
context,
|
||||
key: const Key('pipeline-view-runs'),
|
||||
primary: false,
|
||||
materialIcon: Icons.list_alt,
|
||||
cupertinoIcon: CupertinoIcons.list_bullet,
|
||||
label: 'Runs',
|
||||
onPressed: widget.onViewPipelineRuns == null
|
||||
? null
|
||||
: () => widget.onViewPipelineRuns!(detail.id),
|
||||
),
|
||||
/// Runs and the primary Run: the top bar's actions, never floating over
|
||||
/// the content (where they used to cover the version history).
|
||||
List<Widget> _actions(BuildContext context, PipelineDetail detail) => [
|
||||
Semantics(
|
||||
button: true,
|
||||
label: detail.name.trim().isEmpty
|
||||
? 'View runs of this pipeline'
|
||||
: 'View runs of ${detail.name}',
|
||||
child: ExcludeSemantics(
|
||||
child: pipelineBarAction(
|
||||
context,
|
||||
key: const Key('pipeline-view-runs'),
|
||||
primary: false,
|
||||
materialIcon: Icons.list_alt,
|
||||
cupertinoIcon: CupertinoIcons.list_bullet,
|
||||
label: 'Runs',
|
||||
onPressed: widget.onViewPipelineRuns == null
|
||||
? null
|
||||
: () => widget.onViewPipelineRuns!(detail.id),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
RunPipelineAction(
|
||||
controller: _controller,
|
||||
detail: detail,
|
||||
gateway: widget.gateway,
|
||||
onRunStarted: widget.onRunStarted,
|
||||
fab: true,
|
||||
),
|
||||
],
|
||||
);
|
||||
),
|
||||
RunPipelineAction(
|
||||
controller: _controller,
|
||||
detail: detail,
|
||||
gateway: widget.gateway,
|
||||
onRunStarted: widget.onRunStarted,
|
||||
inBar: true,
|
||||
),
|
||||
];
|
||||
|
||||
Widget _source(BuildContext context, PipelineDetail detail) {
|
||||
return ListView(
|
||||
padding: withFloatingBarClearance(context, const EdgeInsets.all(16)),
|
||||
padding: withBarClearance(context, const EdgeInsets.all(16)),
|
||||
children: [
|
||||
if (detail.source.isEmpty)
|
||||
Text('No source recorded.', style: pipelineMutedStyle(context))
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../ui/adaptive/floating_bar_layout.dart';
|
||||
import '../pipeline_filter.dart';
|
||||
import 'pipeline_controls.dart';
|
||||
|
||||
@@ -24,7 +25,7 @@ class PipelineFilterMaterialBody extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
padding: withBarClearance(context, const EdgeInsets.all(16)),
|
||||
children: [
|
||||
TextField(
|
||||
controller: name,
|
||||
|
||||
@@ -111,7 +111,7 @@ class _PipelineFilterPageState extends State<PipelineFilterPage> {
|
||||
),
|
||||
],
|
||||
),
|
||||
child: SafeArea(child: body),
|
||||
child: SafeArea(top: false, bottom: false, child: body),
|
||||
);
|
||||
}
|
||||
return Scaffold(
|
||||
@@ -121,7 +121,7 @@ class _PipelineFilterPageState extends State<PipelineFilterPage> {
|
||||
title: 'Filter pipelines',
|
||||
actions: [TextButton(onPressed: _apply, child: const Text('Done'))],
|
||||
),
|
||||
body: SafeArea(child: body),
|
||||
body: SafeArea(top: false, bottom: false, child: body),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import '../../../ui/theme/app_theme.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../ui/adaptive/floating_bar_layout.dart';
|
||||
import '../../../ui/status/run_status_icon.dart';
|
||||
import '../pipeline_format.dart';
|
||||
import '../pipeline_models.dart';
|
||||
@@ -28,32 +29,42 @@ class PipelineListPanel extends StatelessWidget {
|
||||
(pipeline) =>
|
||||
pipeline.scheduleState == PipelineScheduleState.unclassified,
|
||||
);
|
||||
return Column(
|
||||
// The controls and notices lead the list, so they scroll behind the top
|
||||
// bar with the rows and start below it at rest.
|
||||
final header = [
|
||||
_scope(context, filters),
|
||||
_toolbar(context, filters, hasUnclassified),
|
||||
if (controller.listError != null)
|
||||
PipelineErrorBanner(
|
||||
message: controller.listError!,
|
||||
onRetry: controller.load,
|
||||
),
|
||||
if (controller.runsError != null)
|
||||
PipelineErrorBanner(
|
||||
message:
|
||||
'${controller.runsLoaded ? 'Last runs could not be refreshed' : 'Last runs unavailable'}: '
|
||||
'${controller.runsError}',
|
||||
onRetry: controller.load,
|
||||
),
|
||||
if (controller.listLoading && controller.pipelinesLoaded)
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: kPipelineListInset),
|
||||
child: PipelineProgress(label: 'Refreshing pipelines'),
|
||||
),
|
||||
];
|
||||
return _content(context, header);
|
||||
}
|
||||
|
||||
/// A state without rows: the controls stay at the top, below the bar.
|
||||
Widget _withoutRows(List<Widget> header, Widget state) => BelowTopBar(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
_scope(context, filters),
|
||||
_toolbar(context, filters, hasUnclassified),
|
||||
if (controller.listError != null)
|
||||
PipelineErrorBanner(
|
||||
message: controller.listError!,
|
||||
onRetry: controller.load,
|
||||
),
|
||||
if (controller.runsError != null)
|
||||
PipelineErrorBanner(
|
||||
message:
|
||||
'${controller.runsLoaded ? 'Last runs could not be refreshed' : 'Last runs unavailable'}: '
|
||||
'${controller.runsError}',
|
||||
onRetry: controller.load,
|
||||
),
|
||||
if (controller.listLoading && controller.pipelinesLoaded)
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: kPipelineListInset),
|
||||
child: PipelineProgress(label: 'Refreshing pipelines'),
|
||||
),
|
||||
Expanded(child: _content(context)),
|
||||
...header,
|
||||
Expanded(child: state),
|
||||
],
|
||||
);
|
||||
}
|
||||
),
|
||||
);
|
||||
|
||||
/// The web's compact toolbar: filter (whose page carries the name search),
|
||||
/// sort and clear, on the list's 12px inset with a separator underneath.
|
||||
@@ -105,19 +116,27 @@ class PipelineListPanel extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _content(BuildContext context) {
|
||||
Widget _content(BuildContext context, List<Widget> header) {
|
||||
if (controller.initialListLoading) {
|
||||
return _centered(context, const ['Loading pipelines…']);
|
||||
return _withoutRows(
|
||||
header,
|
||||
_centered(context, const ['Loading pipelines…']),
|
||||
);
|
||||
}
|
||||
if (!controller.pipelinesLoaded) {
|
||||
if (controller.listError != null) return const SizedBox.shrink();
|
||||
return _centered(context, const ['Loading pipelines…']);
|
||||
if (controller.listError != null) {
|
||||
return _withoutRows(header, const SizedBox.shrink());
|
||||
}
|
||||
return _withoutRows(
|
||||
header,
|
||||
_centered(context, const ['Loading pipelines…']),
|
||||
);
|
||||
}
|
||||
final items = controller.visiblePipelines;
|
||||
if (items.isEmpty) {
|
||||
final empty = controller.emptyState;
|
||||
if (empty == null) return const SizedBox.shrink();
|
||||
return _empty(context, empty);
|
||||
if (empty == null) return _withoutRows(header, const SizedBox.shrink());
|
||||
return _withoutRows(header, _empty(context, empty));
|
||||
}
|
||||
// A list pane beside a detail can be very narrow (a 640px window leaves
|
||||
// it ~130px): there the rows drop the identity icon and chevron so the
|
||||
@@ -126,8 +145,8 @@ class PipelineListPanel extends StatelessWidget {
|
||||
builder: (context, constraints) {
|
||||
final compact = constraints.maxWidth < _compactRowWidth;
|
||||
return useCupertinoControls(context)
|
||||
? _cupertinoList(context, items, compact: compact)
|
||||
: _materialList(context, items, compact: compact);
|
||||
? _cupertinoList(context, header, items, compact: compact)
|
||||
: _materialList(context, header, items, compact: compact);
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -178,16 +197,22 @@ class PipelineListPanel extends StatelessWidget {
|
||||
|
||||
Widget _materialList(
|
||||
BuildContext context,
|
||||
List<Widget> header,
|
||||
List<PipelineSummary> items, {
|
||||
required bool compact,
|
||||
}) {
|
||||
final now = DateTime.now();
|
||||
// The default padding is the media padding: the controls start below the
|
||||
// top bar and the last row clears the floating tab bar.
|
||||
return ListView.separated(
|
||||
key: const Key('pipeline-list'),
|
||||
itemCount: items.length,
|
||||
separatorBuilder: (context, index) => const Divider(height: 1),
|
||||
itemCount: header.length + items.length,
|
||||
separatorBuilder: (context, index) => index < header.length
|
||||
? const SizedBox.shrink()
|
||||
: const Divider(height: 1),
|
||||
itemBuilder: (context, index) {
|
||||
final pipeline = items[index];
|
||||
if (index < header.length) return header[index];
|
||||
final pipeline = items[index - header.length];
|
||||
return ListTile(
|
||||
key: Key('pipeline-row-${pipeline.id}'),
|
||||
selected: controller.selectedId == pipeline.id,
|
||||
@@ -210,6 +235,7 @@ class PipelineListPanel extends StatelessWidget {
|
||||
|
||||
Widget _cupertinoList(
|
||||
BuildContext context,
|
||||
List<Widget> header,
|
||||
List<PipelineSummary> items, {
|
||||
required bool compact,
|
||||
}) {
|
||||
@@ -217,6 +243,7 @@ class PipelineListPanel extends StatelessWidget {
|
||||
return ListView(
|
||||
key: const Key('pipeline-list'),
|
||||
children: [
|
||||
...header,
|
||||
CupertinoListSection.insetGrouped(
|
||||
backgroundColor: AppColors.groupedBackground,
|
||||
children: [
|
||||
|
||||
@@ -20,12 +20,17 @@ class PipelineSummaryView extends StatelessWidget {
|
||||
required this.controller,
|
||||
required this.detail,
|
||||
required this.gateway,
|
||||
this.showIdentity = true,
|
||||
});
|
||||
|
||||
final PipelinesController controller;
|
||||
final PipelineDetail detail;
|
||||
final ApiGateway gateway;
|
||||
|
||||
/// Whether to start with the recorded identity line (`id · version ·
|
||||
/// stages`). False when the top bar's title pill already carries it.
|
||||
final bool showIdentity;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final historical = detail.resolvedVersion != detail.latestVersion;
|
||||
@@ -34,13 +39,14 @@ class PipelineSummaryView extends StatelessWidget {
|
||||
children: [
|
||||
// The web's Summary subtitle: the compact header names the pipeline,
|
||||
// this line carries its recorded identity.
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 0),
|
||||
child: Text(
|
||||
pipelineSubtitle(detail),
|
||||
style: pipelineMutedStyle(context),
|
||||
if (showIdentity)
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 0),
|
||||
child: Text(
|
||||
pipelineSubtitle(detail),
|
||||
style: pipelineMutedStyle(context),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (historical)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import '../../../ui/adaptive/floating_bar_layout.dart';
|
||||
import '../../../ui/adaptive/floating_destination_bar.dart';
|
||||
import 'pipeline_controls.dart';
|
||||
import 'pipeline_detail_tab.dart';
|
||||
@@ -7,7 +8,7 @@ import 'pipeline_detail_tab.dart';
|
||||
export 'pipeline_detail_tab.dart';
|
||||
|
||||
/// The pipeline detail's tabs: the app's floating glass tab bar, full width on
|
||||
/// a phone and sized to its tabs at the right edge of a wide pane.
|
||||
/// a phone page; beside a list, sized to its tabs under the pane's top bar.
|
||||
///
|
||||
/// Float it over the tab body with `FloatingBarOverlay`. The whole bar is
|
||||
/// keyed `pipeline-detail-tabs`, each tab `pipeline-detail-tab-<name>`.
|
||||
@@ -16,11 +17,16 @@ class PipelineDetailTabs extends StatelessWidget {
|
||||
super.key,
|
||||
required this.selected,
|
||||
required this.onSelected,
|
||||
this.edge = FloatingBarEdge.bottom,
|
||||
});
|
||||
|
||||
final PipelineDetailTab selected;
|
||||
final ValueChanged<PipelineDetailTab> onSelected;
|
||||
|
||||
/// Where the bar floats: the bottom of a page, or the top of a pane beside
|
||||
/// a list (see `PageTabsEdge`).
|
||||
final FloatingBarEdge edge;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cupertino = useCupertinoControls(context);
|
||||
@@ -30,6 +36,7 @@ class PipelineDetailTabs extends StatelessWidget {
|
||||
child: FloatingDestinationBar(
|
||||
cupertino: cupertino,
|
||||
currentIndex: tabs.indexOf(selected),
|
||||
edge: edge,
|
||||
onTap: (value) => onSelected(tabs[value]),
|
||||
items: [
|
||||
for (final tab in tabs)
|
||||
|
||||
Reference in New Issue
Block a user