Linux desktop: optimized release build, installer, Linux gaps

Build: split Dart debug info out of libapp.so (13.96 -> 11.27 MB, symbols
kept in the cache) and fix icon tree shaking, which Flutter 3.44's Linux
CMake backend silently disables by quoting the define; the build image
patches its SDK copy (MaterialIcons 1.6 MB -> 25 KB). Impeller cannot be
enabled in a Linux release build and was slower in a profile-build bench.

Install: `./install --linux --install` installs the bundle into
<prefix>/lib/app-linux with com.pipelines.app.desktop (the GTK/Wayland
app id), its icon and a ~/.local/bin/pipelines-app link, through
scripts/install-linux-app.sh.

Linux gaps: notifications through the freedesktop daemon; HTML artifacts
explain the missing web view instead of throwing; no Share for files;
a GTK clipboard reader for pasting files and screenshots (Ctrl+V and
Omarchy's Super+V); GTK header bar only on GNOME; window icon.

Bench: native fixture frame log, wheel/mark steps and
tool/perf/linux_desktop_bench.py (private Xvfb); results in
app/notes/linux-desktop-optimized.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 12:54:18 +00:00
parent c4de1de27b
commit 8138cdc3d9
26 changed files with 722 additions and 60 deletions
@@ -7,7 +7,9 @@ import 'package:flutter/widgets.dart';
import 'chat_attachment_picker.dart';
import 'chat_clipboard_paste.dart';
/// The macOS Runner's pasteboard reader (macos/Runner/MainFlutterWindow.swift).
/// The desktop Runners' clipboard reader: macOS's
/// (macos/Runner/MainFlutterWindow.swift) and Linux's
/// (linux/runner/clipboard_files.cc).
const MethodChannel chatClipboardFilesChannel = MethodChannel(
'pipelines/clipboard_files',
);
@@ -17,7 +19,7 @@ const MethodChannel chatClipboardFilesChannel = MethodChannel(
///
/// Flutter's own [Clipboard] carries text only, so a native host reads the
/// pasteboard through the Runner. Each subscription watches for the platform
/// paste shortcut (Cmd+V). When its composer may take the paste it consumes
/// paste shortcut (Cmd+V on macOS, Ctrl+V on Linux). When its composer may take the paste it consumes
/// the key, asks the Runner for the pasteboard's files (Finder file URLs, else
/// a copied or screenshot image) and hands them over; a pasteboard without
/// files pastes its text into the composer instead, so the consumed key never
@@ -46,13 +48,14 @@ ChatClipboardPaste nativeChatClipboardPaste({
);
/// Whether the held modifiers make V the host's paste shortcut: Cmd alone on
/// macOS.
bool chatIsNativePasteShortcut() {
/// macOS; Ctrl on Linux, also with Super held (Omarchy's universal Super+V
/// sends Ctrl+V while Super is down).
bool chatIsNativePasteShortcut([TargetPlatform? platform]) {
final keys = HardwareKeyboard.instance;
return keys.isMetaPressed &&
!keys.isControlPressed &&
!keys.isAltPressed &&
!keys.isShiftPressed;
if (keys.isAltPressed || keys.isShiftPressed) return false;
return (platform ?? defaultTargetPlatform) == TargetPlatform.linux
? keys.isControlPressed
: keys.isMetaPressed && !keys.isControlPressed;
}
Future<void> _readPasteboard(
@@ -121,4 +124,5 @@ String chatNothingToPasteMessage(List<String> types) => types.isEmpty
/// Whether [platform] has a Runner that answers [chatClipboardFilesChannel].
bool chatHostReadsClipboardFiles(TargetPlatform platform) =>
!kIsWeb && platform == TargetPlatform.macOS;
!kIsWeb &&
(platform == TargetPlatform.macOS || platform == TargetPlatform.linux);
@@ -5,7 +5,7 @@ import 'chat_clipboard_paste_native.dart';
/// Native clipboard-file paste.
///
/// macOS reads the pasteboard through its Runner
/// macOS and Linux read the clipboard through their Runners
/// ([nativeChatClipboardPaste]). Other native hosts have no pasteboard reader
/// yet: they report that missing capability rather than pretending no paste
/// happened, and the composer keeps the host field's own text paste.