8000 feat(chat): attach files to a message by aorumbayev · Pull Request #192 · kagan-sh/kagan · GitHub
[go: up one dir, main page]

Skip to content

feat(chat): attach files to a message - #192

Closed
aorumbayev wants to merge 16 commits into
mainfrom
feat/chat-attach
Closed

aorumbayev wants to merge 16 commits into
mainfrom
feat/chat-attach

Conversation

@aorumbayev
@aorumbayev aorumbayev commented Dec 4, 2026 •
Copy link
Copy Markdown
Member

What

The composer's + attaches files by dialog, paste and drop, and a message sends them as the ACP content blocks the agent advertises. A staged card now reads as one card: a long name ellipsizes clear of its remove x, the row keeps a gap above the bar, a video fills the thumbnail tile with a play mark, and a sent card is a button that says it opens Preview and carries its place when a name repeats. A sent card starts on its message's own left edge, and a pasted image over the 8 MB limit is refused in the box rather than at Send. A deleted thread's copies go with it, and an attached file is read from the absolute path its card showed. A video has no frame to draw without a decoder, so its card is the play tile on purpose: the mark, the name and the size.

The + menu, its one item and the limit line
An image and a file staged with a prompt
The sent message: cards above the words, both on its left edge
A long name cut clear of the remove control
A video's play tile in the dark: the mark, the name and the size
The same tile in the light theme
A sent video card on its message's own spine
Two files of one name staged side by side
Compact density: the tile keeps its mark, name and size

Why

The first cut sent a relative path that could name a different file than the card showed, gave two same-named cards one id, and put a video in the plain file card.

Test plan

  • cargo t --workspace --locked
  • sh scripts/smoke.sh --keep
  • Attach by menu, paste and drop; remove one; send; click a sent card

The prompt joined a staged file's relative path to the thread folder and read the whole file before checking its size, and the file URI encoded a Windows drive and separators into a string an agent cannot open. The path is absolute before the first read, the link names it from the root with slashes, and the size is checked before the bytes are read, with the post-read check kept for a file that grows.
A steer that names a waiting message carries that row's own files, so fresh files beside its number were checked and then dropped. The check now refuses the combination and says why.
A long name ran under the remove x and was cut mid-word, the cards sat on the bar so its focus ring painted over one, and two files of one name were one card to a driver and a screen reader. A sent card is now a button that says it opens Preview and carries its place in the message; a video fills the thumbnail tile with a play mark and its name, since kagan has no decoder; and the card sizes follow the density.
Every keystroke cloned each staged attachment into the window's draft map, up to 80 MiB per letter with a full message. A text change now updates the draft's words in place and leaves its files alone, and the attach step refuses a window that has no chat instead of acting on the front window.
A person who attached a private document and then deleted the thread still had the copy under the data folder. The copies now go with the approved delete, and a copy that cannot be removed does not fail a delete that has already happened.
Decision 306 now says what the cards, the video tile, the absolute path, the Windows link and the delete cleanup do, names the entries it amends, and carries the size budget after main's comment trim.
The card body outgrew the one-hundred-line ceiling once the video tile joined it, so the image, video and file forms are three functions behind one dispatch.
The x sits on the tile's top-right corner, and at the compact density it covered the play mark. The mark now keeps that corner's width clear, and the size budget follows the line.
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
A prompt with no files built its text block only after resolving the
thread's environment and hopping to the background, so a text-only send
failed in a thread whose environment is not ready and cost two reads on
the common path. It now builds the block directly.

A copy under a U
10BC8
NC path became `file:////server/...`; the share now goes
in the URI's authority, `file://server/...`, which is the form an agent
can open.
A sent message put its cards and its words in a column aligned to the
bubble's right edge, so one card floated away from the text it belongs
to; the column now starts at the left, where the box's cards already do.

A pasted image was base64-encoded into the draft whatever its size and
refused only at Send, though the box promises to refuse it there; the
paste is now measured before it is held. The formatter map also names a
Pnm paste `pnm` with its own type instead of a `.png` name and an
octet-stream type.

A video's play mark was centred in the tile minus a whole control width,
which left it 12 points off centre; it now sits at the tile's centre,
with the remove control as the smaller chip in the corner, clear of it.
The mark, the name strip and a file card's name column carry their own
ids, so a test holds the mark's centre, the strip inside the tile, and a
long name cut clear of the remove control.

`kg ui attach` returned done on a screen with no chat, which a driver
reads as success; a terminal thread or Settings now answers not-found.

A card of two same-named files showed the same name and size as its
twin; its tooltip now carries the card's place, as its spoken name does.
Centring the play mark left the standard chip at the tile's edge, and
at compact density the two touched by a point. The chip now sits on the
tile's corner, the smaller one, so the mark keeps clear of it at every
density, and the card test measures the compact look the window uses.
The record says the branch count and the new ceiling, and the budget
file carries the two files the round grew past their own ceilings.
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
CI's clippy denies `too_many_arguments`, and the builder derived the
size it was handed anyway, so it reads the staged size itself. The
paste test's byte count converts with `try_from` rather than a cast
clippy reads as a truncation on a 32-bit target.
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
aorumbayev added a commit that referenced this pull request Dec 4, 2026
Root accepted the play tile for a video in place of a frame no decoder
can draw, so the tile now says what it is: the play mark in the space
the caption leaves, then the file's name and size on two caption lines
with the tile's own background. It reads the same in either theme, and
the mark keeps clear of both the caption and the remove chip at every
density.

The behaviour text and decision 306 say name and size, and the cost
follows the new count.
@aorumbayev aorumbayev closed this Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0