Skip to content

feat(card): attach files directly when creating a card - #548

Open
HeinrichNebula wants to merge 1 commit into
kanbn:mainfrom
cachly-dev:feat/attach-files-on-card-create
Open

feat(card): attach files directly when creating a card#548
HeinrichNebula wants to merge 1 commit into
kanbn:mainfrom
cachly-dev:feat/attach-files-on-card-create

Conversation

@HeinrichNebula

Copy link
Copy Markdown

What

The new-card modal only supports title/description/labels/members/due date. Attaching a file requires creating the card first, reopening it, and uploading there. This PR lets users queue files in the create form itself:

  • Paperclip button (hidden multi-file input) plus drag & drop onto the form
  • Queued files render as removable chips below the option row
  • On submit, the card is created first, then the files are uploaded sequentially to the existing /api/upload/attachment endpoint, followed by a board invalidation
  • If the card mutation fails, the queue is restored so a retry keeps the files
  • If some uploads fail, the card is kept and a popup reports how many attachments failed (no rollback)
  • "Create another" clears the queue

Also removes duplicate comments/checklists/attachments keys in the optimistic card payload in the same file (TS1117, a hard error under tsc --noEmit).

Notes

  • Files are kept in component state, not in the persisted modal form state (File objects do not survive serialization)
  • No new endpoints or schema changes; reuses the upload path and its 50MB limit
  • i18n via the existing lingui t macros

Testing

  • Create card with 2 files: both appear as attachments on the created card
  • Create card without files: behavior unchanged
  • Upload failure (oversized file): card exists, popup reports the failed count
  • "Create another": queue resets between cards

The new-card form only supported title/description; attachments required
creating the card first and reopening it. Files can now be queued in the
form (picker button or drag and drop), are uploaded sequentially to the
existing /api/upload/attachment endpoint once the card is created, and
failures surface via popup without rolling back the card.
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