Repository navigation
feat(composer): show attachments as inline badges in the text - #200
Merged
Merged
Conversation
nixuuu
marked this pull request as ready for review
November 5, 2026 16:21
nixuuu
force-pushed
the
feat/inline-attachments-2
branch
from
November 5, 2026 16:24
3f8c36f to
1ecc67e
Compare
Files added by the paperclip, a drop or a paste become badges at the caret (the end without one), using the composer's chip mechanism. Each badge shows its upload (spinner and bar, red when it failed) without moving the text; a tap opens an image in the Lightbox or a file's card with Remove. A file lives with its badge: Backspace, Delete and Remove take both, Undo brings both back, and cut and paste in the composer keep the badge. The tray above the text is gone. Sent messages show the badges at the same places.
nixuuu
force-pushed
the
feat/inline-attachments-2
branch
from
November 5, 2026 16:26
1ecc67e to
2dda5ac
Compare
nixuuu
added a commit
that referenced
this pull request
Nov 5, 2026
…231) Stage 5 of 5, mobile UX: catch up with recent web features in the thread view. **Done** - Full access with confirmation. - The work group is open while the agent works and collapsed after the turn (the default fold behaviour from #195). - Tighter work rows in the `work` scale; commands in monospace. - The shell command card and `!` mode in the composer (#194). - "Starting" for a dispatched queued turn (#197). - File badges in the message bubble. - Finished subagents collapse into one count that opens the lineage panel (#182). - The type scale for overlays, chrome, work rows and the context row (#174/#193). - Rejected messages show their reason, instead of a generic retry note. **Deferred** - The work fold settings (per device on the web). - Badges placed inline in the text and queue editing (#200/#201); files stay as chips. - Linked computers in pickers (needs `LinkedComputerSnapshot` merging). - Worktree and ref in a new thread. - Approval countdown and expiry cards. - Connector errors. - Mentions, side threads and goal editing. **Checked** on the Android emulator, light and dark. `check:tmp`: 1425 passed, 0 failed. `expo lint` and `tsc` are clean. **Copy audit (§8):** - "Runs as a shell command when delivered." - "Starting" - "N finished subagents" - "Set and manage goals in Canopy on the web."
nixuuu
added a commit
that referenced
this pull request
Nov 6, 2026
…ges (#237) Stage 2 of 4, mobile parity round 2: the composer. **Changed** - **Inline badges:** a picked file goes into the text as a badge `[name]` at the caret (an ATTACHMENT mention, as on the web since #200). The text field renders mentions as tinted spans, so the characters stay plain text. - An edit that touches a badge removes all of it and its file; text typed inside a badge lands after it. - Removing a file removes its badge. - The field cannot show progress, so files that are uploading or failed keep a chip above the text with the state and Remove. A stored file has only its badge. - Messages send `mentions` with the stored attachment ids; new threads send `initial_mentions`. - **Sent messages** show badges at their places (`Turn.mentions`); chips remain only for files not placed in the text. - **Queued messages** (as the web queue editor, #201): a "…" next to "Queued" offers Edit message and Delete. - The editor uses the same badges; deleting one shows "‹name› leaves the message when you save." (or "N files leave …"). - Save sends `EditQueuedTurn` with the full positions and `mentions_complete`; Delete sends `DeleteQueuedTurn`. - The text and mentions model is `features/composer/message-value.ts`, shared by the composer and the queue editor. **Keyboard gap fix** (reported from a real Galaxy Z Fold, folded, gesture navigation) - **Bug:** with the keyboard open, the composer floated well above it, with an empty band under it. Seen in bot chats and threads. - **Cause, measured on the emulator** at phone width: window 841 dp, keyboard top at y = 538, status bar 24 dp, nav-bar inset 32 dp. - The app runs edge-to-edge, so the window never resizes. - `KeyboardAvoidingView` sat inside a `SafeAreaView` that kept the 32 dp bottom inset, and `keyboardVerticalOffset={insets.top}` counted the status bar again, since frames are already in window coordinates. - The composer ended 24 dp plus its padding above the keyboard here, more with a taller status bar. - **Fix,** no new dependency: `ui/KeyboardArea.tsx` measures how far the keyboard reaches up from the window's bottom edge (window height minus the keyboard's `screenY`; on Android `height` leaves out the nav bar under the keyboard). - With the keyboard open, the composer sits directly on it with its normal padding. With the keyboard closed, it keeps the bottom safe-area inset. - Applied to the thread screen, bot chat, New thread and Pair, whose `SafeAreaView` now leaves out the bottom edge. - The same gap was in `Overlay`'s bottom sheets (Rename, queue editor, goal and side-thread forms): the sheet now sits on the keyboard and drops its bottom inset while the keyboard is open. - New thread on Android had no avoidance at all (the lower pills were under the keyboard); it now shrinks and scrolls. - On iOS the area follows `keyboardWillShow`/`Hide` with the keyboard's own animation timing (instant with reduced motion). **iOS was not checked on a device:** there is no iOS dev build, and building one did not fit the Mac's disk budget. - **Checked** on Canopy_Fold with the stock keyboard: phone width (folded) and unfolded, keyboard open and closed, a four-line draft. Thread, bot chat, New thread, Pair and a bottom-sheet form all sit flush on the keyboard; with the keyboard closed, the composer keeps its inset above the gesture bar. **Not done** - Undo: React Native's text field has no undo stack. - Tapping a badge to preview the file, and moving queued messages or switching queueing from the menu. **Checked** - Gates clean, as in stage 1. - Android emulator, light and dark, unfolded and phone width: - a badge inserted after typed text, and a long file name wrapping; - Backspace into a badge removes the badge and its file; - a message with a badge in the queue, then sent and shown with the badge in place; - edit and save of a queued message; - a badge removed in the editor with the "leaves the message" line, saved without the file. **Copy audit (§8)** - "Edit message", "Delete", "Queued message actions", "Edit queued message", "Cancel", "Save": verbs first; the web's labels. - "‹name› leaves the message when you save." / "N files leave the message when you save.": the web's text, one idea, present tense.
This was referenced Nov 13, 2026
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.
Stage 2 of 3, inline attachments: badges in the composer text (web).
Composer
!): attachments are not allowed. The hint by "+" says: "Remove attachments, quotes and mentions to send a shell command."Timeline: user messages show the badges at the same positions, clickable to preview or download.
Checked in a browser, light and dark, desktop and phone width:
Copy audit (§8)