Merge commit '1dcef23db2233e9877163a782ae5bee7509ec8db' into pipelines/run-20261112-0152-chat-tab-re-tap-opens-the-active-chats-ff7a
This commit is contained in:
@@ -7,10 +7,13 @@ import '../ui/adaptive/floating_destination_bar.dart';
|
||||
import 'attention_badge.dart';
|
||||
import 'destination.dart';
|
||||
import 'list_detail.dart';
|
||||
import 'navigation_rail.dart';
|
||||
import 'shell_rail_scope.dart';
|
||||
import 'list_pane_widths.dart';
|
||||
import 'shell_bar.dart';
|
||||
import 'shell_chat_shortcut.dart';
|
||||
import 'shell_list_shortcuts.dart';
|
||||
import 'shell_runs_pipelines_shortcut.dart';
|
||||
import 'shell_search_shortcut_labels.dart';
|
||||
import 'tab_history.dart';
|
||||
import '../ui/input/keyboard_owner.dart';
|
||||
@@ -241,7 +244,8 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
|
||||
);
|
||||
// The scaffolds below swap the system insets for their bars'
|
||||
// heights; panes beside a list read the real ones from here.
|
||||
final system = MediaQuery.paddingOf(context);
|
||||
final media = MediaQuery.of(context);
|
||||
final system = media.padding;
|
||||
// A page (Settings) closes to Pipelines on the system Back too; at a
|
||||
// tab's root Back returns to the tab opened before it. Only with neither
|
||||
// does Back reach the platform, so Android's (predictive) Back closes the
|
||||
@@ -255,15 +259,60 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
|
||||
},
|
||||
child: child,
|
||||
);
|
||||
// On a wide window the destinations sit in a rail at the left edge, and
|
||||
// the floating bar is not built; the scaffold gets the rest of the window.
|
||||
// The tree has the same shape at every width (an empty rail slot on a
|
||||
// phone), so resizing across the rail's threshold never remounts a
|
||||
// destination.
|
||||
final rail = showsNavigationRail(context);
|
||||
final scaffold = Scaffold(
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: topBar,
|
||||
body: _destinationStack(contents),
|
||||
extendBody: true,
|
||||
bottomNavigationBar: rail ? null : bar,
|
||||
);
|
||||
return backable(
|
||||
ShellSystemInsets(
|
||||
padding: system,
|
||||
child: Scaffold(
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: topBar,
|
||||
body: _destinationStack(contents),
|
||||
extendBody: true,
|
||||
bottomNavigationBar: bar,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
// Badges (running runs, unread chats) rebuild the rail alone.
|
||||
ListenableBuilder(
|
||||
listenable: _bar.badges,
|
||||
builder: (context, _) => rail
|
||||
? ShellNavigationRail(
|
||||
selected: _selected,
|
||||
icon: (destination) => _icon(
|
||||
destination,
|
||||
destinationDetails(destination).icon,
|
||||
),
|
||||
onSelected: _select,
|
||||
padding: EdgeInsets.only(
|
||||
top: system.top,
|
||||
bottom: system.bottom,
|
||||
),
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
// Three children at every width, so the body keeps its slot.
|
||||
rail
|
||||
? const VerticalDivider(width: 1, thickness: 1)
|
||||
: const SizedBox.shrink(),
|
||||
Expanded(
|
||||
// Beside the rail the panes lay out in the width the rail leaves,
|
||||
// which the window's width fixes here (not in a layout pass), so
|
||||
// the panes and their pages rebuild with the window.
|
||||
child: ShellRailScope(
|
||||
shown: rail,
|
||||
bodyWidth: rail
|
||||
? media.size.width - kNavigationRailSpace
|
||||
: null,
|
||||
child: scaffold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -292,8 +341,9 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
|
||||
}
|
||||
|
||||
/// App-wide search and conversation-list selection are handled before text
|
||||
/// fields. Split-pane navigation belongs to the chat workspace; tab changes
|
||||
/// have no global keyboard chord.
|
||||
/// fields. Split-pane navigation belongs to the chat workspace. Ctrl+A
|
||||
/// bounces between Runs and Pipelines, but leaves text fields and the
|
||||
/// terminal their own Ctrl+A (select all, line start).
|
||||
bool _handleDestinationKeyEvent(KeyEvent event) {
|
||||
final keyboard = HardwareKeyboard.instance;
|
||||
// Ctrl+K is the terminal's kill-line while the terminal has the keyboard;
|
||||
@@ -303,6 +353,13 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
|
||||
if (event is KeyDownEvent) _openChat();
|
||||
return true;
|
||||
}
|
||||
if (shellRunsPipelinesShortcut(event, keyboard)) {
|
||||
if (primaryFocusTakesTyping()) return false;
|
||||
if (event is KeyDownEvent) {
|
||||
_select(shellRunsPipelinesTarget(_selected));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// A terminal keeps its keys (Escape, Ctrl+/, Ctrl+digits).
|
||||
if (primaryFocusIsTypingSurface()) return false;
|
||||
if (_selected == AppDestination.search &&
|
||||
|
||||
Reference in New Issue
Block a user