Files
pipelines/app/lib/features/chat/ui/sessions/session_pane_menu.dart
T
alan 61c7eee2b0 App: open a chat, the terminal or a diff in a new window
"Open in new window" sits beside Float: the chat pane and chat list row
menus, a floating chat window's title bar, the terminal options menu and
the diff bar, plus Alt+Shift+Y for the chat with the keyboard (listed in
the shortcut help). Once the window opens the item leaves the main window
as Float takes a pane out of the tiling.

The window is its own app instance at /window/chat/<id>,
/window/terminal?tab=<key> or /window/diff/<token>: only that item, named
after it, with "Bring back to main window". It has its own connection and
writes no shared layout (no open-chat workspace, window store or terminal
layout) and posts no notifications, so they stay the main window's.

Web opens a popup window (a blocked popup offers a tab); Linux and macOS
start a second process with --detached (Flutter's multi-window API is still
experimental); Android and iOS hide the action. The capture kit gains a
follow step for windows a page opens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 12:47:42 +00:00

43 lines
1.2 KiB
Dart

import 'package:flutter/widgets.dart';
import '../../../../core/api_gateway.dart';
/// The pane More menu's choices that a chat row's menu also offers.
enum SessionPaneAction {
newWindow,
addPane,
openChats,
centerStage,
moveUp,
moveDown,
moveLeft,
moveRight,
closePane,
chatDetails,
files,
runCommand,
openTerminal,
dismissFinished,
}
/// One pane choice as the row's menu shows it: the pane's own label. A
/// disabled choice stays listed, as the pane lists it (a move with no pane
/// across that edge).
typedef SessionPaneChoice = ({
SessionPaneAction action,
String label,
bool enabled,
});
/// The open chat panes, as a chat row's menu reaches them. The offers are read
/// when the menu opens, so they follow the panes as they are then.
abstract interface class SessionPaneMenu {
/// The pane More menu's choices for [session] now, in the pane's order and
/// with its visibility (narrow layouts, one pane, no window or terminal).
List<SessionPaneChoice> choicesFor(BuildContext context, JsonMap session);
/// Runs [action] for [session], opening the chat first where the pane's
/// handler acts on an open chat.
void run(BuildContext context, JsonMap session, SessionPaneAction action);
}