Skip to content

feat(v2): auto-send file as a message on attach (no draft staging)#273

Open
samxu01 wants to merge 1 commit intomainfrom
feat/v2-attach-auto-send
Open

feat(v2): auto-send file as a message on attach (no draft staging)#273
samxu01 wants to merge 1 commit intomainfrom
feat/v2-attach-auto-send

Conversation

@samxu01
Copy link
Copy Markdown
Contributor

@samxu01 samxu01 commented May 3, 2026

Second of three "artifact polish" PRs. Will not auto-merge.

What this changes

Picking a file from the composer now uploads + sends a message containing the upload directive in one shot instead of inserting raw `[[upload:fileName|…]]` into the textarea.

Why: the previous flow showed raw directive tokens as the user typed, which felt off. Drag-and-drop in Slack, Discord, and Linear all match the new shape: pick → goes now. The user's existing draft text is preserved — they can keep typing and hit Send when ready, and the file lands as its own message.

Images keep the existing inline-image-message behavior (URL-as-content, `messageType: 'image'`).

Diff

`V2PodChat.tsx` — `handleAttachFile` calls `sendMessage(directive)` instead of mutating `draft` with `setDraft`.

Test plan

  • Deploy dev: `gh workflow run deploy-dev.yml --ref feat/v2-attach-auto-send`
  • Open a pod, type some text in the composer ("hey, see this") but don't send
  • Attach a PDF — confirm a separate message appears with the file pill, and the typed text stays in the composer
  • Attach a PNG — confirm legacy inline-image behavior (image message lands)
  • Confirm no `[[upload:…]]` raw text ever appears in the textarea

🤖 Generated with Claude Code

Picking a file from the composer now uploads + sends a message
containing the upload directive in one shot. The previous flow
inserted `[[upload:fileName|…]]` into the textarea as raw text,
which made the user see the raw token as they typed and felt off.

The user's existing draft text is preserved untouched — they can
keep typing and hit Send when ready, and the file lands as its
own message.

Matches the drag-and-drop pattern in Slack / Discord / Linear:
pick → goes now. Images keep the existing inline-image behavior.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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