Files
pipelines/app/lib/features/runs/ui/run_detail_tab_strip.dart
T
alan c6c6dcfe18 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.
2026-10-31 03:36:22 +00:00

67 lines
2.3 KiB
Dart

import 'package:flutter/widgets.dart';
import '../../../ui/adaptive/floating_bar_layout.dart';
import '../../../ui/adaptive/floating_destination_bar.dart';
import '../../../ui/adaptive/host.dart';
import 'run_detail_tab.dart';
/// The tabs the strip renders, in the web's order: Summary first so it is the
/// default, then the Timeline, the run's Artifacts and its Changes. Input and
/// Output are collapsible Summary sections now, so their stable enum keys stay
/// available for old routes but they are not separate tabs. The graph is a
/// preview on Summary that opens full screen, so it has no tab of its own.
const List<RunDetailTab> renderedRunDetailTabs = [
RunDetailTab.summary,
RunDetailTab.timeline,
RunDetailTab.artifacts,
RunDetailTab.changes,
];
/// The run detail's tabs: the app's floating glass tab bar, full width at the
/// bottom of a phone page; beside a list, under the pane's top bar (sized to
/// its tabs) so it never stacks on the shell's own tab bar.
///
/// Float it over the tab body with `FloatingBarOverlay` at the same [edge];
/// every tab is always visible, so a tab selected by the Graph is shown
/// selected without scrolling. The whole bar is keyed `run-detail-tabs`, each
/// tab `run-detail-tab-<name>`.
class RunDetailTabStrip extends StatelessWidget {
const RunDetailTabStrip({
super.key,
required this.selected,
required this.onSelected,
this.tabs = renderedRunDetailTabs,
this.edge = FloatingBarEdge.bottom,
});
final RunDetailTab selected;
final ValueChanged<RunDetailTab> onSelected;
final FloatingBarEdge edge;
/// The tabs this run offers, in [renderedRunDetailTabs] order.
final List<RunDetailTab> tabs;
@override
Widget build(BuildContext context) {
final cupertino = usesCupertinoHost(context);
final index = tabs.indexOf(selected);
return KeyedSubtree(
key: const Key('run-detail-tabs'),
child: FloatingDestinationBar(
cupertino: cupertino,
currentIndex: index < 0 ? 0 : index,
edge: edge,
onTap: (value) => onSelected(tabs[value]),
items: [
for (final tab in tabs)
FloatingDestinationItem(
key: ValueKey('run-detail-tab-${tab.name}'),
icon: Icon(cupertino ? tab.cupertinoIcon : tab.icon),
label: tab.label,
),
],
),
);
}
}