Skip to content

feat: attach open files to the session draft - #179609

Merged
vyctorbrzezowski merged 2 commits into
mainfrom
brzezowski/files-attach-session-20261021
Oct 21, 2026
Merged

vyctorbrzezowski merged 2 commits into
mainfrom
brzezowski/files-attach-session-20261021

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Adding a file already open in the Control UI to a chat message requires downloading and selecting it again.

User Impact

Choose Attach to session in the file toolbar's ⋯ menu to add the open file to the existing message draft. Sending remains an explicit action.

Why This Change Was Made

The viewer reads the authorized original file and hands it to the existing attachment admission and draft owners. Text with unsaved editor changes uses the editor's retained draft without saving the file. Pending reads are canceled when the file, session, connection, or viewer changes. Images, downloadable files, and the native PDF viewer use the same action.

Evidence

  • Full Control UI against a synthetic Gateway: Markdown, PNG, PDF, and ZIP were attached through their file menus, with no automatic send. A single explicit send preserved every filename, MIME type, and original payload.
  • The native Chromium PDF viewer remained open while its 667-byte document was attached and explicitly sent with matching bytes.
  • Nine focused tests cover pending-read cancellation, reentrant clicks, original and edited text, download-only descriptors, authorization, byte limits, and cancellation. Per-file wall time: attachment action 2.72 s; media source 1.58 s. CI timing is pending.
  • UI typecheck, scoped lint, formatting, i18n baseline, controller guard, and production build passed. The viewer action remains lazy; measured chat boot was 1,499,397 bytes gzip against a 1,500,000-byte limit.
  • CI exposed three type errors in the new fixture. The callback return, authorized download URL fixture, and attachment narrowing are corrected; fixture cleanup is awaited. The exact failing test-type leaf reproduced red and passes after the repair.
  • Fresh Codex review: no actionable P0–P2 findings after resolving the download-only descriptor case.

Risk and coverage

Browser proof uses synthetic data and the real UI attachment/draft/send owners with a mocked Gateway; no live model or external delivery was invoked. Native-device behavior was not exercised. Scoped lint retains three existing Solid reactivity warnings in unchanged code.

Screenshots below show the original menu, the new action, and the file staged in the existing composer.

Before: file actions menu

After: Attach to session in file actions

After: original file staged in the existing draft

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: L labels Oct 21, 2026
@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review October 21, 2026 15:10
@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Oct 21, 2026
@vyctorbrzezowski
vyctorbrzezowski enabled auto-merge (squash) October 21, 2026 16:23
@vyctorbrzezowski
vyctorbrzezowski merged commit f6580eb into main Oct 21, 2026
86 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/files-attach-session-20261021 branch October 21, 2026 16:27
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 22, 2026
* feat: attach open files to the session draft

* test: use the authorized URL contract for file attachments
@vyctorbrzezowski vyctorbrzezowski self-assigned this Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui clawsweeper:intake:feature Preliminary submission classification; full source review pending. docs Improvements or additions to documentation size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant