Commit Graph

958 Commits

Author SHA1 Message Date
alan 94798b2224 Merge branch 'worktree-agent-afa6a05b31a0831e8' 2026-11-25 19:23:57 +00:00
alan 54be08994b Show selection over inline code; link URLs inside code
An opaque inline-code fill painted over the selection highlight, so a
selected code span looked unselected; it now keeps half the fill. Bare
URLs inside inline code, fenced blocks and operator messages' backticks
are now links like any other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 19:23:47 +00:00
alan 85a7284fba Stages: optional skills block loading pinned library skills per visit
A model stage may declare a skills block (name or name@N per line).
Drafts and publications are validated against the server skill library;
human/ntfy stages reject the block. Each run resolves unpinned names to the
latest version at admission and records name@N per stage (run
stage_skills, step skills); retry reuses the recorded versions. Every visit
gets a private read-only copy of exactly those bundles under the run's
artifact tree, and the harness loads only them: Claude via a session
plugin (--plugin-dir, Skill tool with per-skill allow rules, bundled skills
off, ambient loads fail the visit), Pi via --skill under --no-skills, and
OpenCode via per-session instruction entries (V2 only). The app shows the
block in the stage definition and the resolved versions on each visit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 19:17:16 +00:00
alan 509d4c624f Render agent questions as markdown
A question's text, its description and its options' descriptions now
use the transcript's markdown renderer (bold, code, lists, links) in
the card's own text styles; tapping an option's formatted description
still selects it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 15:23:24 +00:00
alan 03688f0c1f Merge branch 'worktree-agent-af8d861f87bcc614c'
# Conflicts:
#	app/tool/perf/chat_scroll_fixture.dart
2026-11-25 11:11:38 +00:00
alan a7265038f5 Merge branch 'worktree-agent-a61ceab0eeab6ea76' 2026-11-25 11:11:18 +00:00
alan a3a59adb30 Quieter transcript metadata: day dividers, time-only rows, muted meta rows
- Date once per calendar day: a muted centred divider above each day's
  first timed row (chatDayDividers); rows show only their time ("10:16"),
  with the full date and time kept in the tooltip and semantics. The user's
  time shares the delivery line; a harness notice's time trails its line.
- Activity line and turn chips are secondary: bodyMedium, regular weight,
  onSurfaceVariant (error colour kept for failures), a small chevron_right
  that turns down while its details are open (replaces expand_less).
- Copy / Read aloud: 18 px muted icons; on pointer devices shown only while
  the reply is hovered or an action is focused (also without the gutter);
  touch keeps them visible with a full tap target. The time leads the
  footer so hidden actions leave no gap.
- Settled questions: the question on one line, the operator's answer in
  full on its own line beneath it.
- Meta rows (activity, chips, notices, compaction line) start at the reply
  text's leading edge; turn chips sit in their own column under the answer.
- Scroll fixture: ?timestamps=1 spreads messages over two days.

Row keys are unchanged; the divider joins a row without replacing it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 11:10:51 +00:00
alan 22866ec0ce Chat: fold activity-only rows between messages into one summary line
Tool-only turns, thinking-only turns and background-task notices that sit
between two content rows become one collapsible activity_group row, e.g.
"Ran 7 commands · used 9 tools · 8 background tasks finished · 1 failed",
the failure count in the error colour and never ellipsized. Expanding it
shows the folded rows as they render on their own. A run's task notices
fold into one chip at the newest notice; a notice whose id recurs later is
counted only at its latest position.

Grouping is a pure domain step (groupChatActivity) applied last in the
thread view's row pipeline; group rows list every member id so ChatRowKeys
keeps their identity, unchanged runs return the identical group object, and
the transcript anchor accepts a group's agent-turn ids. The scroll fixture
gains ?bgwork=1 for the shape.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 10:58:25 +00:00
alan a70a4a3c86 Clear pasted and picked attachments from the composer at send
The chips stayed until the server accepted the prompt, a few seconds
after the sent turn already showed the files. They now leave the field
with the text as the prompt goes out; a refusal that gives the composer
its text back restores the same chips.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 10:45:28 +00:00
alan 33874005c4 Question answers: no shaking while typing; Enter sends, Shift+Enter breaks
Typing in a question card's answer box asked the transcript to reveal
the caret on every keystroke; the split, bottom-following transcript
jumped and followed back, so the conversation shook. The request now
stops at the card, which is on screen while the operator types.

A free-text answer now behaves like the chat composer: it grows to six
lines, Enter sends it (desktop and web keyboards) and Shift+Enter
breaks the line; an open IME candidate keeps its Enter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 10:30:30 +00:00
alan 53d8b911a6 Schedule a message for when the usage limit resets
When the open chat's account has an exhausted quota window, a banner above
the composer reads "Usage limit reached · resets at HH:MM" and offers to
send the last message (or the current draft) a minute after the reset, via
chat_prompt send_at. Queued prompts with a future send_at read
"Scheduled · sends at HH:MM" and keep Remove.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 00:59:33 +00:00
alan f72c46d599 Make the open chat unmistakable in the chat list
The open chat's row now has a strong fill in its colour, a full outline
with a thick leading bar, a bold title and a pointer on its trailing
edge toward the conversation shown beside the list. A selected chat
that is not shown keeps a lighter fill; a chat visible in another pane
keeps its thin bar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 00:10:13 +00:00
alan bfccf39671 Answer Claude questions in your own words, or dismiss them
Claude's question forms now accept a free-text answer beside the
offered options and can be dismissed. A dismissal tells Claude the
operator will reply in the chat instead, the card's button reads
Dismiss, and the composer takes the keyboard so the reply can be typed
at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 00:02:59 +00:00
alan 4c82a9637e Show loudly in the chat list when a chat is waiting on the operator
The server's chat activity now counts each session's unanswered
approvals and questions (awaiting_operator) and pushes it to every
connection when it changes. A waiting chat's list row pulses in the
error colour with a solid bar on its leading edge, its avatar wears a
ringing bell in place of the spinner, and its state line leads with a
bold "Waiting for you". Reduced motion holds the pulse and the bell
still.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:54:38 +00:00
alan 50c89976fa Let the composer being typed in take pasted files; free Cmd+V on macOS
A composer outside the active pane (a floating chat window, a side pane)
refused file pastes even while focused, so the field's own text paste
ran instead: a Finder copy pasted its file name and an image nothing.
The focused composer now always takes the paste.

On macOS the Edit > Paste menu item owned Cmd+V and sent paste: to the
native text view, which pastes plain text only and never lets the key
reach Flutter. The item keeps working from the menu but no longer claims
the shortcut, so Cmd+V reaches the composer's file paste.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 00:06:06 +00:00
alan 4fe16375d9 macOS paste: read more image and file kinds, never fail silently
The pasteboard reader now also takes any image AppKit can read (JPEG,
HEIC, PDF and others, converted to PNG) and the legacy Finder filenames
list. A paste with no files, no image and no text now shows which types
the clipboard held instead of doing nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 22:38:09 +00:00
alan cbc06b2f13 Remember the diff layout across reloads
One file at a time or all files stacked is saved in the app's
preferences and restored when the app starts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:23:21 +00:00
alan 9bf080597a Place items shown mid-turn inside the running turn
Live chat events name a message by id and carry no time, so messages the
client created from them had no created_at. A running turn then had no
timed rows, and an item the agent showed mid-turn (show_file, show_diff)
was placed after the last timed row: above the prompt and the whole
running reply, usually off screen, until a reload brought the server's
times. Messages created from live events are now stamped with their
arrival; a history read still replaces them with the server's times.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:23:21 +00:00
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 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 71719b5707 Say why an app update check found nothing
The check dropped every per-server failure and showed one generic
message. It now lists each machine with its reason (sign in first, a
feed key this app does not trust, a timeout), and an APK signed with
another certificate than the installed app is named plainly with how
to install it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 19:50:50 +00:00
alan ce5e744419 Merge branch 'worktree-agent-a16cd7d38c66c90bd' 2026-11-21 18:13:17 +00:00
alan d407a72a06 Diff viewer: vim keys, scrolling, find in diff and an all-files view
Left/right and h/l step between files (or headers in the all-files
view), up/down and j/k scroll, / opens find-in-diff (highlighted
matches across every file, n/N or Enter/Shift+Enter to move, Escape to
close), and a top-bar toggle switches between one file at a time and
every file stacked with collapsible headers, like a pull request's
Files changed tab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 18:13:08 +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 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 83e6553da4 Expect /stop_tasks among the /s command suggestions 2026-11-13 18:00:57 +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 bdcda84093 Merge branch 'main' into pipelines/run-20261113-1520-search-opens-the-selected-chat-5f6a 2026-11-13 16:06:24 +00:00
alan 560202f5b7 Merge commit 'c3c2c1bbc9adcb06c09ac53dd572948890a868e3' into pipelines/run-20261113-1519-natural-read-aloud-voices-1d6b 2026-11-13 16:06:12 +00:00
alan c3c2c1bbc9 Open Chat with Cmd+K as well as Ctrl+K
Cmd is the natural modifier on a Mac. Like Option+K, it also opens Chat
from the terminal, where Ctrl+K stays kill-line.
2026-11-13 16:02:31 +00:00
alan fb04936bce Merge branch 'main' into pipelines/run-20261113-1519-natural-read-aloud-voices-1d6b 2026-11-13 15:59:38 +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 41b4314c64 Merge branch 'main' into pipelines/run-20261113-1520-search-opens-the-selected-chat-5f6a 2026-11-13 15:58:19 +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