Complete prompt presets, body-priority panes and clearer chat and stage layouts
This commit is contained in:
@@ -189,17 +189,21 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
|
||||
: Column(
|
||||
children: [
|
||||
Expanded(child: _destinationStack(contents, index)),
|
||||
CupertinoTabBar(
|
||||
currentIndex: index,
|
||||
onTap: (value) =>
|
||||
_select(AppDestination.values[value]),
|
||||
items: _items((destination) {
|
||||
final item = destinationDetails(destination);
|
||||
return BottomNavigationBarItem(
|
||||
icon: _icon(destination, item.cupertinoIcon),
|
||||
label: item.label,
|
||||
);
|
||||
}),
|
||||
// Match CupertinoTabScaffold's native tab-label policy;
|
||||
// content elsewhere still follows the user's scaler.
|
||||
MediaQuery.withNoTextScaling(
|
||||
child: CupertinoTabBar(
|
||||
currentIndex: index,
|
||||
onTap: (value) =>
|
||||
_select(AppDestination.values[value]),
|
||||
items: _items((destination) {
|
||||
final item = destinationDetails(destination);
|
||||
return BottomNavigationBarItem(
|
||||
icon: _icon(destination, item.cupertinoIcon),
|
||||
label: item.label,
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -6,13 +8,16 @@ import '../ui/adaptive/host.dart';
|
||||
/// At least this wide, a destination keeps its list beside the open item
|
||||
/// (with the destination rail) instead of pushing the item as its own page.
|
||||
const double kListDetailMinWidth = 600;
|
||||
const double _bodyWindowTarget = 0.6;
|
||||
const double _bodyWindowMinimum = 0.5;
|
||||
const double _bodyAvailableMaximum = 0.75;
|
||||
|
||||
/// Whether the window at [context] shows list and detail side by side.
|
||||
bool showsListBesideDetail(BuildContext context) =>
|
||||
MediaQuery.sizeOf(context).width >= kListDetailMinWidth;
|
||||
|
||||
/// Equal flexible panes, shared by Pipelines, Runs and Chat. No destination
|
||||
/// supplies a pixel width, minimum/maximum pane width or split ratio.
|
||||
/// One body-priority policy for all destinations, derived from the full window
|
||||
/// and actual available space after navigation. No fixed pixel pane widths.
|
||||
class ListDetailPanes extends StatelessWidget {
|
||||
const ListDetailPanes({super.key, required this.list, required this.detail});
|
||||
|
||||
@@ -27,33 +32,50 @@ class ListDetailPanes extends StatelessWidget {
|
||||
color: CupertinoColors.separator.resolveFrom(context),
|
||||
)
|
||||
: const VerticalDivider(width: 1);
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Expanded(
|
||||
child: SizedBox.expand(
|
||||
key: const ValueKey('list-detail-list'),
|
||||
child: Semantics(
|
||||
container: true,
|
||||
explicitChildNodes: true,
|
||||
identifier: 'list-detail-list',
|
||||
child: list,
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final window = MediaQuery.sizeOf(context).width;
|
||||
// Target 60% of the full window. Keep at least half for the body while
|
||||
// leaving a flexible share for native list controls on tighter windows.
|
||||
final requestedMinimum = window * _bodyWindowMinimum;
|
||||
final minimum = constraints.maxWidth > requestedMinimum
|
||||
? requestedMinimum
|
||||
: constraints.maxWidth * _bodyWindowMinimum;
|
||||
final maximum = math.max(
|
||||
minimum,
|
||||
constraints.maxWidth * _bodyAvailableMaximum,
|
||||
);
|
||||
final bodyWidth = (window * _bodyWindowTarget).clamp(minimum, maximum);
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Expanded(
|
||||
child: SizedBox.expand(
|
||||
key: const ValueKey('list-detail-list'),
|
||||
child: Semantics(
|
||||
container: true,
|
||||
explicitChildNodes: true,
|
||||
identifier: 'list-detail-list',
|
||||
child: list,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
divider,
|
||||
Expanded(
|
||||
child: SizedBox.expand(
|
||||
key: const ValueKey('list-detail-body'),
|
||||
child: Semantics(
|
||||
container: true,
|
||||
explicitChildNodes: true,
|
||||
identifier: 'list-detail-body',
|
||||
child: detail,
|
||||
divider,
|
||||
SizedBox(
|
||||
width: bodyWidth,
|
||||
child: SizedBox.expand(
|
||||
key: const ValueKey('list-detail-body'),
|
||||
child: Semantics(
|
||||
container: true,
|
||||
explicitChildNodes: true,
|
||||
identifier: 'list-detail-body',
|
||||
child: detail,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user