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:
@@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user