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>
This commit is contained in:
2026-12-03 12:47:42 +00:00
parent c4de1de27b
commit 61c7eee2b0
46 changed files with 3223 additions and 72 deletions
+20 -3
View File
@@ -1,6 +1,7 @@
#include "my_application.h"
#include <flutter_linux/flutter_linux.h>
#include <stdio.h>
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#endif
@@ -25,6 +26,13 @@ static void my_application_activate(GApplication* application) {
GtkWindow* window =
GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
// A detached window (a chat, the terminal or a diff sent to a window of
// its own) is named after its item and sized for it by the main process.
const gchar* detached_title = g_getenv("PIPELINES_WINDOW_TITLE");
const gchar* title = detached_title != nullptr && detached_title[0] != '\0'
? detached_title
: "Pipelines";
// Use a header bar when running in GNOME as this is the common style used
// by applications and is the setup most users will be using (e.g. Ubuntu
// desktop).
@@ -45,14 +53,23 @@ static void my_application_activate(GApplication* application) {
if (use_header_bar) {
GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
gtk_widget_show(GTK_WIDGET(header_bar));
gtk_header_bar_set_title(header_bar, "Pipelines");
gtk_header_bar_set_title(header_bar, title);
gtk_header_bar_set_show_close_button(header_bar, TRUE);
gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
} else {
gtk_window_set_title(window, "Pipelines");
gtk_window_set_title(window, title);
}
gtk_window_set_default_size(window, 1280, 720);
gint width = 1280, height = 720;
const gchar* detached_size = g_getenv("PIPELINES_WINDOW_SIZE");
if (detached_size != nullptr) {
gint w = 0, h = 0;
if (sscanf(detached_size, "%dx%d", &w, &h) == 2 && w > 0 && h > 0) {
width = w;
height = h;
}
}
gtk_window_set_default_size(window, width, height);
g_autoptr(FlDartProject) project = fl_dart_project_new();
fl_dart_project_set_dart_entrypoint_arguments(