Repository navigation
Agent mode: attachments, send/stop button, picture viewer, working sign, iA layout, and typography - #886
Merged
Conversation
The chat view occludes the terminal element, so GPUI's hit test never reached the terminal's drop handler, which already knows how to turn a drop over a chat into attachments. The chat now takes the drop itself and routes it the same way. Pasting into the composer only handled text: a copied screenshot did nothing and a Finder file copy pasted the file's name. Copied files now attach as a drop would, and a clipboard image is prepared off the UI thread with the terminal's image preparation (TIFF becomes PNG, oversized images shrink), saved to a private per-user folder named by its contents, and attached; on an SSH chat it is copied to the host like any other attachment.
The Stop control sat in the chat header, away from where the prompt is written. While the agent works and the composer holds nothing to send, the send button now shows a stop square and cancels the turn; once something is written or attached it goes back to sending, which queues the prompt as before. The header Stop is gone. The window does not redraw on each keystroke in the composer, so the per-tick chat poll, which already reads the composer's text, records whether the button stops and redraws only when that flips.
Match the phone app's composer: the round button stops a running turn while nothing is written or attached, sends once something is (queued behind a running turn), and is greyed out and inert otherwise, including for blank text. The button's state is one enum the chat poll keeps current, rather than a stop flag beside an always-enabled send.
The in-pane view showed the agent's Markdown as written, with tool commands in bold as loud as the reply and their output six lines deep. Inline code, strong text, and links are now drawn rather than shown, bullets, numbers, headings, and quotes become styled leads, and wrapped items hang under their text; a mark left unclosed stays as written. Tool titles are muted, lose their code ticks, and stop after two lines, and output previews show four lines.
A picture in the conversation, under a tool call, from the web, or a drawn diagram, was only ever shown at its small inline size. Clicking a drawn one now shows it over the chat, fit to the pane with a margin and enlarged at most twice its own size, and a click anywhere or Escape closes it. It fades and grows in and back out through crate::motion.
…ads first A tool call's command, files, and output were set in the terminal font at nearly the prose's size and ink, so a long test log outweighed the reply under it. They now take one size two points under the prose, in the theme's muted color; the kind label, the done or failed status, and the added and removed counts keep their colors.
Only the iMessage layout said anything under the conversation during a turn; the others left it to a small word in the header, out of sight of the reading. Every layout now keeps a row above the composer with a pulsing dot, what the agent is doing (thinking, the command or file a step runs, or writing), and how long the turn has run. It sits outside the list, so it shows however far the conversation is scrolled back, and keeps its height between turns so nothing jumps. iMessage keeps its typing line and gains the dot.
A new chat layout, iA, sets the conversation as one column: the user's prompts smaller and italic under a hanging mark, the agent's steps as one muted line each until opened, and its prose in full ink. Everything before the user's latest prompt is drawn at 40% and comes back to full ink while the pointer rests on it. Rows now know whether they belong to the current turn, and a layout can set the size the user's prompts are drawn at and keep folded tool calls to their title line, so the rich text renderer takes its text size.
…headings At the default reading width, prose ran the full 800 px column, about 95 to 100 characters a line. Paragraphs, lists, and quotes now keep to 34 em, about 70 characters, while code, tables, and pictures still take the column; a reading width the user sets is followed as set. Headings step down to 1.35, 1.18, and 1.05 times the text, and the space between blocks follows what they are: a heading binds to its text, list items sit close, and a list stands apart from the prose around it, all in ems so the rhythm holds at every zoom.
…ture The native chat fixture gains a tools case and a turns case with earlier exchanges, and settings for a working agent with a running turn, a draft, attached files, an agent picture, and that picture opened large, so each new state can be captured without input. Its composer button follows the app's rule, which the fixture's missing chat poll would otherwise leave unset.
Owner
Author
|
|
[Medium impact] The PR appears safe to merge; the previous picture-focus issue is fixed. SummaryAgent mode gains attachments, a send/stop button, a picture viewer, working indicators, the iA layout, and quieter typography.
Reviews (3) · Last reviewed commit: "fix(chat): make a picture's pane active ..." · Reviewed by Greptile |
…mprovements # Conflicts: # crates/herdr-gpui/src/config/chat.rs
A pasted picture was saved in the background without being marked as pending, so a prompt sent meanwhile went without it and the picture joined the next one. It now counts as pending, as a file being copied to an SSH host already does, so sending waits for it; a local chat says "Preparing a picture" while it does. The save also remembers the conversation it was pasted into and attaches only while that one still owns the pane, so an agent restarted meanwhile never receives it.
…arge The composer kept the keyboard behind an open picture, so typing edited the hidden draft and Enter sent it. The viewer now holds the keyboard through its own focus handle, which the chat's focus keeping treats as its own; keys and paste stop at it, Escape closes it, and the keyboard returns to the composer as it closes.
The iA layout sets prompts smaller, but a formula in one kept the picture, baseline, and line box drawn for the chat's full text size. Formulas now scale with the size of the message they sit in.
Drawing Markdown links as underlined text dropped their address, and the terminal cannot open them, so the destination was lost. The address now follows the text, muted, in brackets, unless the text already is the address.
Owner
Author
The picture's click stops at the picture, so it never reached the chat handler that makes the chat's pane the active one. Opening a picture in a split pane that was not active put the keyboard on the viewer, and the next focus check handed it back to the active pane: Escape then left the picture open, and typing went to the other pane's draft. Opening a picture now does what a click on the chat does first.
Owner
Author
|
@greptileai review — the new finding (a picture in an inactive split pane losing the keyboard) is fixed in 2b2c683, with a regression test and a reply on its thread. Full local |
4 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Agent mode (the native chat over a
herdr-acppane) gets easier to read and to use: files and screenshots can be dropped or pasted, the send button behaves like the phone app's, pictures open large, the agent always shows that it is working and on what, tool calls step back behind the answer, prose keeps a readable measure, and a new iA layout mutes everything but the current turn. The in-pane terminal view renders Markdown too.Commits, each its own changelog entry:
crate::motion.›, steps one muted line each until opened, prose in full ink, and everything before the latest prompt at 40% until pointed at.Protocol and compatibility: no wire changes. Layouts gained
prompt_textandtool_previewhooks, rows know whether they belong to the current turn, and the rich text renderer takes its text size.Screenshots
Captured from the native chat fixture at
5f7f342e, except the terminal-view pair (realherdr-acp). "Before" images are from the same fixture on the earlier code.Typography (before / after, then dark and narrow)
Tool calls muted (before / after)
Send button and attachments
Working sign and picture viewer
iA layout (light while working, dark, narrow)
Terminal view in the pane (before / after)
Validation
just cion5f7f342e(macOS arm64): passed.cargo check -p herdr-gpui -p herdr-acp --locked --testsat each commit, no errors or warnings.cargo clippy -p herdr-gpui --locked --all-targets --features integration-test,mockup: clean.cargo test -p herdr-gpui --locked --bins chat::(343 passed) andcargo test -p herdr-acp --locked tui::(36 passed).HERDR_TEST_RICH_CHAT,--features integration-test,mockup), which draws the real views with a synthetic conversation; the terminal-view pair is the realherdr-acpbinary against a stub ACP agent in a headless terminal (vhs).QA
just cion5f7f342e, macOS arm64: passedcargo checkper commit)just lint-linuxandjust lint-windows(nocfggates were touched, so not run here)Known limitations
herdr-chat-images) and not cleaned up, like the chat's HTML pages.worktree/agent-activity.