Merge branch 'worktree-agent-a099cbf073f6e9e51' into integrate/shell-wide
# Conflicts: # app/lib/features/runs/ui/run_detail_tabs.dart
This commit is contained in:
@@ -112,19 +112,19 @@ class SliverFloatingBarClearance extends StatelessWidget {
|
||||
|
||||
/// The edge a page's own floating tab bar sits at.
|
||||
enum FloatingBarEdge {
|
||||
/// Above the bottom safe area: a phone page, or a page covering the shell.
|
||||
/// Above the bottom safe area: a phone page, a page covering the shell,
|
||||
/// or a detail pane beside a list (the shell's tab bar stays over the
|
||||
/// list pane).
|
||||
bottom,
|
||||
|
||||
/// Just below the page's top bar: a detail pane beside a list, where the
|
||||
/// shell's own tab bar already floats at the bottom.
|
||||
/// Just below the page's top bar, for a surface whose bottom is taken.
|
||||
top,
|
||||
}
|
||||
|
||||
/// Where the pages' own tab bars float in this subtree ([FloatingBarEdge]).
|
||||
///
|
||||
/// A detail pane beside a list says [FloatingBarEdge.top], so an open item's
|
||||
/// tabs never stack on the shell's tab bar; everywhere else they float at the
|
||||
/// bottom.
|
||||
/// Pages float their tabs at the bottom (the default), including a detail
|
||||
/// pane beside a list, whose bottom the shell leaves free.
|
||||
class PageTabsEdge extends InheritedWidget {
|
||||
const PageTabsEdge({super.key, required this.edge, required super.child});
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
/// The widest a detail's reading body (a run or pipeline Summary, a stage
|
||||
/// page's sections) grows on a wide window, so its text, trailing copy
|
||||
/// buttons and facts stay within reach of the title instead of stretching
|
||||
/// to the window's far edge.
|
||||
const double kReadingMaxWidth = 840;
|
||||
|
||||
/// Caps [child] at [maxWidth] from the leading edge, where the detail's bar
|
||||
/// pieces, header strip and tabs start. It passes the full height through
|
||||
/// unchanged, so a scrollable child fills the height as before; only its
|
||||
/// width is capped.
|
||||
class ReadingWidth extends StatelessWidget {
|
||||
const ReadingWidth({
|
||||
super.key,
|
||||
required this.child,
|
||||
this.maxWidth = kReadingMaxWidth,
|
||||
});
|
||||
|
||||
final Widget child;
|
||||
final double maxWidth;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => LayoutBuilder(
|
||||
// One structure at every width, so resizing across the cap never
|
||||
// remounts the body (its scroll offset and open sections stay).
|
||||
builder: (context, constraints) {
|
||||
return Align(
|
||||
alignment: AlignmentDirectional.topStart,
|
||||
child: SizedBox(
|
||||
width: math.min(maxWidth, constraints.maxWidth),
|
||||
height: constraints.hasBoundedHeight ? constraints.maxHeight : null,
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user