Skip to content

Composer file attachments (picker, drop, chips) and larger composer #159

Closed

Description

@BunsDev

Item 2 under Next in docs/status.md asks for image attachments in the composer. This issue comes from the 2026-10-06 rails-canvas plan. That plan stopped after its first step, and its worktree was retired on 2026-10-09.

Already done: resizable side panels

The plan's resizable-rails step shipped separately in #154 (5071ce8, in v0.0.10):

  • PanelResizeHandle resizes by drag, arrow keys, Home and End, and resets on double-click or Enter.
  • Widths persist in shared/layout.ts.
  • e2e/panel-resize.spec.ts and e2e/panel-layout.spec.ts cover it.

This issue does not repeat that work. If the shipped panels fall short of the plan, file a separate issue. The one plan criterion not checked here is keeping at least 350px for the conversation at the 900px minimum window width.

Scope

1. Attachment storage (main process)

  • Add apps/desktop/src/main/engine/attachments.ts. It copies each picked or dropped file into the app's private attachments directory (<modex home>/attachments/…).
  • Keep the original bytes, give each copy a unique storage path, sanitize the filename, and enforce a size limit. Reject anything over the limit with a readable error.
  • Expose it through typed IPC in both the desktop and development command sets. Main validates every input, and the renderer never chooses the storage path.
  • Pass attachments to the coding CLIs as local file references, through the existing claude and codex backends only. Do not add an API path (see AGENTS.md).

2. Composer UI (renderer)

  • Add an Attach files item to the composer's menu, which opens a file picker.
  • Show a drop overlay (attachment-dropzone) while files are dragged over the composer, then accept the drop.
  • Show each attachment as a removable chip (attachment-chip), and show an error state when a copy fails or a file is too large.
  • Block sending while a copy is still in progress.
  • Allow sending a message that has attachments but no text.
  • App owns the draft, so attachments survive switching threads and failed sends.

3. Composer size (from the same plan)

  • Raise .composer-inner's max-width from 736px to 960px, and the resting composer height from 98px to 109px. Keep the width responsive.

Out of scope

  • Canvas (live HTML/SVG/Markdown previews in the workspace). It was the third part of the same plan and should get its own issue.

Acceptance

  • An e2e test (a starting draft exists, described below) checks that:
    • a file picked with Attach files shows a chip that can be removed;
    • a dropped reference.md shows the drop overlay and then a chip;
    • after sending, the file exists under <home>/attachments/… with identical bytes, and the chip clears.
  • Unit tests for attachments.ts cover filename sanitizing, unique paths, the size limit and byte preservation.
  • A live check with each CLI that an attached image reaches the model, recorded in docs/reviews/.
  • npm run build && npm test, npm run typecheck and npm run test:e2e all pass.
  • docs/status.md is updated: the attachments item moves out of Next.

Starting material

The retired worktree's first step was a Playwright test, e2e/workbench.spec.ts. Its attachments can be picked, removed, dropped and sent with readable file contents case defines the test IDs used above. The test and the full plan were saved outside the repository when the worktree was retired, and can be attached to the implementing PR.

Activity

  1. added
    enhancement
    on Oct 10, 2026
  2. BunsDev commented on Oct 11, 2026

    @BunsDev
    ContributorAuthor

    Delivered by #157 after protected checks and squash merge 5e80b46912a6ba2f278ece14bf18efaac55a2c8a; the signed merge tree exactly matches the reviewed candidate.

    • Picker, drop overlay, image paste, removable chips, copy errors, attachment-only sends, and copying/send gates are covered.
    • Main owns unique byte-preserving copies, size and 20-item limits, identity checks, persisted claims, and ownership-safe cleanup. Typed desktop and authenticated development commands use the same store.
    • App-owned thread/project drafts survive switches and failed sends; the responsive composer reaches 960px and rests at 109px.
    • Real installed Claude Code and Codex CLI runs both read the controlled image and text correctly. Final source/build hashes match the recorded receipts.
    • Local build and typecheck passed; 621 unit tests passed with one existing optional skip; the final full run passed 199 desktop and 7 site tests. Protected current-head checks are recorded on the PR.
    • Status moves attachments out of Next. Store attachments remain explicitly unavailable, including connected-host mode.

    The acceptance report records the full evidence and the unresolved cause of one earlier Space resize mismatch; the final full run passed its unchanged exact assertion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions