Commit Graph

471 Commits

Author SHA1 Message Date
alan e8baf07bf4 Revert "Measure the running composer border once per size"
Measured at 4K it saved nothing (602 ms -> 621 ms over a streamed reply):
on the web the engine rebuilds every drawn path from its recorded
operations, so keeping the measured outline in Dart does not avoid the
CanvasKit path work. The border needs a path-free drawing instead.

This reverts commit 9d37db59.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:36:29 +00:00
alan 6a0b49853c Merge branch 'worktree-agent-a1681d54b6f75fd9a' 2026-11-22 18:24:33 +00:00
alan 42c8346a65 Merge branch 'worktree-agent-a86b9c8a03da895c2' 2026-11-22 18:24:30 +00:00
alan 269d040c18 Merge branch 'worktree-agent-ad9ee94c5e17e5b87' 2026-11-22 18:24:30 +00:00
alan 914ecb285d Reuse chat table cell measurements across rebuilds
A markdown table measures each cell's paragraph at infinite width before
laying it out. Cells rebuilt when a row scrolls back in or a chat is opened
again now reuse those widths from a bounded cache keyed by the cell markdown
and its paragraph style, cleared when fonts change. Layout is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:24:11 +00:00
alan 9be31b8ba0 Re-derive only the live turn's transcript rows per streamed delta
ChatTranscriptRows keeps each message run's rows while the run holds the
identical message objects; applyChatEvent and the controller keep untouched
messages' identity. Shown-item filtering, task-notice groups and row-key ids
are held per row object, and the view reads message ids once per list.
Tests check the incremental path equals a full derivation across streaming,
appends, shown items, cards, turn diffs and prepended pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:24:02 +00:00
alan fa92b9a1a0 Group each transcript row's text into one selectable
The transcript's scroll view kept every text run of every mounted row as
its own selectable and merged newly mounted runs into that list by
comparing global transforms, which dominated slow scroll frames at 4K.
Each row now wraps its content in a SelectionContainer, so the scroll
view orders rows and each row orders only its own runs once on mount.
Cross-row selection and copy order are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:21:28 +00:00
alan 1be2418892 Give running-turn spinners their own animation controller
Without one, CircularProgressIndicator looks its controller up on every
frame, walking the widget tree for the ambient Theme (89 ms over a
streamed reply at 4K). AppSpinner is the stock indicator with its own
controller and the stock period.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:19:22 +00:00
alan 9d37db5939 Measure the running composer border once per size
The highlight's outline was rebuilt and measured (computeMetrics) on
every animation frame of a running turn, the largest app cost while a
reply streams (about 600 ms of CPU over 15 s at 4K). The painter now
keeps the measured outline for its size and only extracts the moving
pieces per frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:19:22 +00:00
alan 95e9f66a58 Merge branch 'worktree-agent-a527a8fc9a8f7527b' 2026-11-21 20:43:37 +00:00
alan f8ea50fd70 Paste files and images into the chat composer on macOS
Native hosts reported clipboard-file paste as unsupported, and Flutter's
Clipboard carries text only, so Cmd+V of a Finder file or a screenshot in the
macOS app pasted nothing (or the file name). The macOS Runner now answers a
pipelines/clipboard_files channel with the pasteboard's file URLs, else its
image as PNG; the composer's Cmd+V reads it and attaches the files, falling
back to the pasteboard text when there are none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 20:42:05 +00:00
alan 99f7edc0ec Keep numbered lists counting across nested items and blank lines
A list ended at the first line that was not an item, so a numbered list
with nested bullets, wrapped lines or blank lines between items became
one-item lists that each showed 1. Lists now nest (an item holds the
blocks indented under it), continue across blank lines, join wrapped
lines, and number from their first item.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 20:39:39 +00:00
alan dd742ec8e4 Open a diff as a floating window
Diffs join the app's window system: Open in a window on a diff page or a
chat diff card shows the same files, on the same file, in a draggable,
resizable window with the full diff viewer (keys, search, all-files
view). Offered only where floating windows show; a diff window's files
live in memory, so it is not restored after a reload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 20:06:45 +00:00
alan 01040a7b12 Stop the replaced session on /new for every harness
/new already released the old native session through the chat-close
release path, but two gaps let the replaced session stay alive, and the
client told the operator it could still be resumed in a terminal:

- Claude Code: ReleaseSession only closed a host this server was
  attached to. A host registered for the session but not attached (a
  failed reattach, or one left by an earlier server) kept running. It is
  now asked to close over its socket and killed as a fallback.
- Codex: ReleaseSession only interrupted an active turn. It now also
  sends thread/unsubscribe so the App Server unloads the thread; a later
  prompt reloads it through the existing "thread not found" resume path.
- The /new notice now says the previous session was stopped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 18:10:41 +00:00
alan cfebd3a05b update 2026-11-21 17:28:45 +00:00
alan 616d95c1d8 Merge branch 'main' of https://git.a-wan.net/alan/pipelines
# Conflicts:
#	app/lib/features/chat/ui/transcript/chat_markdown_view.dart
2026-11-21 17:11:45 +00:00
alan 059eb1bb0d Add show_diff chat tool and diff card
The Pipelines MCP server gains show_diff: it runs Git in a repository
inside the operator's home (default: the chat's directory) and records
the per-file patches. Without base it shows uncommitted work against
HEAD; with base it shows everything since the merge base (a pull
request preview), optionally committed changes only. Bounded at 300
files, 256 KiB per patch and 1 MiB total, with partial diffs labelled;
diff bodies share the per-chat retention budget with HTML views.

The chat draws the item as a card listing each changed file with its
stat; a row opens the existing file diff viewer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 17:08:02 +00:00
alan 93e9042a8b Wrap chat markdown tables to the transcript width
Tables no longer scroll sideways: columns size to content and shrink to
fit, wrapping cell text; an unbreakable token breaks inside its cell.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 10:15:12 +00:00
alan 5425001d82 Send artifacts, runs and pipelines to a new or existing chat
One picker offers a new chat (the saved Open in chat harness and model)
or any open chat. An existing chat gets the reference appended to its
draft and focused, never sent. Artifacts gain the action in their viewer
and gallery; the run and pipeline item becomes Send to chat.
2026-11-13 18:43:14 +00:00
alan b190db8b3a Keep center stage the widest pane on wide monitors
The stage had a fixed preferred width, so on a big monitor the panes
beside it shared the leftover and grew wider than the chat on stage. The
stage is now at least 1.5 times as wide as each other column.
2026-11-13 18:05:16 +00:00
alan aabd6245bf Merge commit '5639e5cb057836100683e8f0c06c1bb70cd71bf0' into pipelines/run-20261113-1605-esc-keeps-background-tasks-stop-tasks-faa1 2026-11-13 16:47:49 +00:00
alan 2a182d7f17 Stop background tasks separately from chat turns
Keep Esc and /stop scoped to the foreground turn while exposing an explicit stop-tasks operation for supported chat backends. Add the protocol, server routing, app command, and coverage for task stopping and unsupported harnesses.
2026-11-13 16:47:41 +00:00
alan 5639e5cb05 Merge main into search-opens-the-selected-chat 2026-11-13 16:26:22 +00:00
alan 3164b7c8df Prefer natural voices for read aloud
Rank platform voice quality and select the most natural automatic voice while keeping explicit voice choices intact. Surface natural labels, hide novelty voices in the picker, and guide Apple users to download enhanced voices when needed.
2026-11-13 15:59:35 +00:00
alan ec3c1e4c6a Open selected chats from search
Re-apply explicit chat routes after workspace restoration and repeated route notifications so search results and chat notifications open the requested session. Add regression coverage for route, registration, and workspace restore behavior.
2026-11-13 15:58:16 +00:00
alan 6cd7774811 Open in chat opens beside the active chat and uses a chosen harness
A chat opened from a run or pipeline now goes in a new pane beside the
active chat instead of replacing it, becomes active and takes the
keyboard once built. Settings > Open in chat chooses its harness and
model (models listed from that harness's most recent chat).
2026-11-13 13:34:26 +00:00
alan f7f2504a30 Drag chats at once with a mouse and mark only the receiving zone
The list rows used a long-press drag, which a mouse rarely triggers; they
now drag immediately with the chip at the pointer. The drop indicator
outlines just the area that will receive the chat (the pane, or the
right or bottom half) with a label saying what happens.
2026-11-13 13:00:57 +00:00
alan ad05909b75 Merge main into chat drag 2026-11-13 12:46:09 +00:00
alan cb49aeef34 Drag chats from the list onto panes
On desktop a chat dragged from the list or compact rail onto a tiled
pane replaces that pane's chat when dropped in its centre, or opens in a
split right of or below it when dropped on that edge; an open chat moves
without duplicating and a floating chat docks.
2026-11-13 12:45:42 +00:00
alan 3838b02ad8 Merge main into open in chat 2026-11-13 12:38:27 +00:00
alan e5403ae257 Open a run or pipeline in a new chat
The run and pipeline More menus offer Open in chat: a new chat in the
run's (or the pipeline's latest run's) workspace opens on the Chat tab
with a draft naming the run or pipeline and how to inspect or change it.
2026-11-13 12:38:27 +00:00
alan 3de6a9cbc1 Merge branch 'main' into pipelines/run-20261113-1158-ctrl-tab-cycles-all-chats-with-a-single-a9b6 2026-11-13 12:23:56 +00:00
alan b4d67d6ba8 Cycle Ctrl-Tab through available chats
When a tiled workspace has one chat pane, navigate the sidebar chat order while preserving pane state and composer focus. Keep pane and floating-window cycling behavior for their existing layouts, and update shortcut documentation and coverage.
2026-11-13 12:23:52 +00:00
alan 0a51add958 Add New chat to compact sidebar
Expose the existing chat creation flow from the compact rail so users can start chats without expanding the session list. Add focused callback coverage and document the verified behavior.
2026-11-13 12:14:16 +00:00
alan df0614e2f7 Steady read-aloud highlight and a calmer default pace
The spoken word is now painted behind unchanged text instead of
restyling the paragraph, so words never reshape, shift or rewrap as the
highlight moves. Revealing the word measures its own boxes against the
visible area, so a reversed transcript no longer jumps for a word already
in view. Sentence breaks the reading adds no longer map onto the next
item's first letter. 1.0x now reads at 0.8 of the platform's normal rate.
2026-11-13 09:41:02 +00:00
alan b2736683e7 Merge branch 'main' into pipelines/run-20261112-2323-read-chat-replies-aloud-with-word-highli-e079 2026-11-13 01:29:09 +00:00
alan 6367cce68a Read chat replies aloud with word highlighting
An assistant reply gets Read aloud beside Copy; while it reads it becomes
Pause/Resume and Stop, one reply at a time app-wide. The spoken word is
highlighted in the rendered reply (across multi-part replies) and the
transcript scrolls only when that word leaves the viewport. Reading stops
when its chat closes or is swapped, another reply starts, or the app goes
to the background. Markdown is spoken as sentences; code blocks are
announced as "Code block.".

Speech goes through a SpeechEngine seam with a flutter_tts implementation
(Android, macOS, web; hidden on Linux) and a fake for tests. Settings has
a Read aloud section: a voice picker grouped by language (device language
first, a sample per voice), a rate slider and reset, saved per device.

flutter_tts has no Swift package, so macOS/iOS gain the CocoaPods
integration (Podfiles with the Runner deployment targets); Android
declares the TTS_SERVICE query. The capture fixture gains ?speech=fake.
2026-11-13 01:29:04 +00:00
alan 046de9db4d Use proper phone sheets for chat and Files menus
On phones the chat's More menu, chat list rows and Files entries open a
Material bottom sheet headed by the chat or file, with full-width icon
rows and destructive actions last in the error colour; desktop menus
show icons, a minimum width and destructive actions after a divider.
The chat menu drops Run command and Open chats, keeps a single terminal
entry and lists Close pane last.
2026-11-13 01:14:12 +00:00
alan a440859108 Fit long Files breadcrumb labels to the panel
Each folder in the path gets a maximum width (the current folder the
whole row) and its label is shortened in the middle to what actually
fits, measured with the label's style, so a long name never pushes the
current folder out of a narrow panel.
2026-11-12 23:13:08 +00:00
alan 6ce67dc491 Merge branch 'main' into pipelines/run-20261112-2239-files-path-keeps-the-current-folder-in-v-3cb2
# Conflicts:
#	app/tool/probe_files_fixture.dart
2026-11-12 23:08:42 +00:00
alan d56a76c9a7 Keep Files breadcrumbs aligned to the current folder
Pin the horizontally scrolling breadcrumb to its trailing edge so deep paths keep the current folder visible. Preserve tappable navigation, middle-ellipsize long labels, and cover the behavior with focused widget tests and the rendered fixture.
2026-11-12 23:08:03 +00:00
alan 1928cfe51b Remember the last Files folder per chat
Persist each chat session's last navigated Files folder, restore it with bounded parent fallback, and forget it when the session closes. Add persistence coverage and capture-fixture support for the reviewed behavior.
2026-11-12 22:56:52 +00:00
alan d19a14b9f9 Hide the phone chat as soon as its Back is pressed
_back marked the open chat hidden without rebuilding and relied on the
owner's route change to redraw. When the chat was shown while the app was
already on /chat (a restored layout, the Chat tab re-selected) nothing
changed, so the chat stayed on screen for seconds while the list behind
it took the taps. Found on the device: closeChat logged route=null and
the entrance never animated out. _back now rebuilds itself.
2026-11-12 20:19:10 +00:00
alan 3029295b1f Rebind chat file and center-stage shortcuts
Give Cmd/Ctrl+E to the active chat Files panel while preserving terminal behavior, and move Center Stage to the shifted chord. Update shortcut documentation and regression coverage for the new bindings.
2026-11-12 19:52:39 +00:00
alan 19b1d1326a Close the phone chat page explicitly from its Back button
The chat page's Back had no handler and relied on the stock Back popping
the nearest route, while the system gesture went through the app's own
back handling. Back now pops the page's own route (or leaves the open
chat), the same path the gesture takes.
2026-11-12 19:20:33 +00:00
alan a3fb506a57 Dim inactive chat panes more
Raise the inactive pane scrim from 0.35 to 0.5 so the active pane stands
out more clearly.
2026-11-12 14:15:59 +00:00
alan 677d202ae7 Thicken the running highlight while the composer has focus
The focus ring outlines the pill in the same colour, hiding the 2 px
highlight; draw it 4 px wide over a focused field.
2026-11-12 14:15:48 +00:00
alan ff39114e4f Drop the count badge from the background tasks gear
The caption beside the gear already says how many tasks run.
2026-11-12 14:12:34 +00:00
alan 45f5323c75 Keep phone chat back on the list
Treat server-synced open workspace snapshots as pane membership only so they do not show or retain a phone chat page. Add regression coverage for repeated system, button, and predictive Back cycles with tiled and floating entries.
2026-11-12 13:18:05 +00:00
alan 692ce7ec1a Merge commit '7f31e16bc1f9fe8cd6d0ac0fbe0d509756880aff' into pipelines/run-20261112-1235-gear-icon-for-background-tasks-1cb4 2026-11-12 12:47:40 +00:00