Merge branch 'main' into pipelines/run-20261112-2323-read-chat-replies-aloud-with-word-highli-e079
This commit is contained in:
@@ -106,6 +106,8 @@ class ChatThreadHeader extends StatelessWidget {
|
||||
if (action is! SegmentedOverflowable) action,
|
||||
if (settingsEntry != null || menuActions.isNotEmpty)
|
||||
SegmentedMoreButton(
|
||||
sheetTitle: title.isEmpty ? 'Chat' : title,
|
||||
sheetSubtitle: folder.isEmpty ? null : folder,
|
||||
entries: [
|
||||
?settingsEntry,
|
||||
for (final action in menuActions) action.overflowEntry,
|
||||
|
||||
@@ -1467,6 +1467,10 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
||||
);
|
||||
}
|
||||
|
||||
/// A pane control that closes the pane: listed last in the menu.
|
||||
static bool _closes(Widget control) =>
|
||||
control is ChatBarAction && control.destructive;
|
||||
|
||||
Widget _buildHeader(
|
||||
JsonMap? session,
|
||||
bool inShellBar,
|
||||
@@ -1484,6 +1488,12 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
||||
final folder = directory
|
||||
.split(RegExp(r'[/\\]'))
|
||||
.lastWhere((part) => part.isNotEmpty, orElse: () => '');
|
||||
final openTerminal = terminalOpenMenuAction(
|
||||
context,
|
||||
gateway: widget.gateway,
|
||||
directory: directory,
|
||||
onRefused: _terminalRefused,
|
||||
);
|
||||
return ChatThreadHeader(
|
||||
key: const Key('chat-thread-header'),
|
||||
chatColor: chatSessionColor(session),
|
||||
@@ -1514,8 +1524,9 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
||||
materialIcon: _filesVisible ? Icons.folder : Icons.folder_outlined,
|
||||
),
|
||||
// A narrow layout's terminal button, beside Files; wide keeps the
|
||||
// shell bar's.
|
||||
?terminalChatBarAction(context),
|
||||
// shell bar's. Where the menu already offers the chat's terminal
|
||||
// (Open in terminal) there is no second terminal entry.
|
||||
if (openTerminal == null) ?terminalChatBarAction(context),
|
||||
],
|
||||
moreActions: [
|
||||
?widget.sidebarControl,
|
||||
@@ -1536,16 +1547,12 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
||||
onPressed: _openInfo,
|
||||
materialIcon: Icons.info_outline,
|
||||
),
|
||||
...widget.paneControls,
|
||||
chatShellRunMenuAction(onPressed: _runShellFromMenu),
|
||||
...widget.paneControls.where((c) => !_closes(c)),
|
||||
if (_shellRuns.finishedIds.isNotEmpty)
|
||||
chatShellDismissAllMenuAction(onPressed: _dismissFinishedShellRuns),
|
||||
?terminalOpenMenuAction(
|
||||
context,
|
||||
gateway: widget.gateway,
|
||||
directory: directory,
|
||||
onRefused: _terminalRefused,
|
||||
),
|
||||
?openTerminal,
|
||||
// Closing comes last.
|
||||
...widget.paneControls.where(_closes),
|
||||
],
|
||||
controls: [
|
||||
// Labelled, so a narrow bar's settings sheet shows their names.
|
||||
|
||||
Reference in New Issue
Block a user