Skip to content

feat(web): allow attaching multiple files at once to a work item - #9560

Open
Syed-Ali-Abbas-Zaidi wants to merge 2 commits into
makeplane:previewfrom
Syed-Ali-Abbas-Zaidi:feat/9544-attach-multiple-files
Open

feat(web): allow attaching multiple files at once to a work item#9560
Syed-Ali-Abbas-Zaidi wants to merge 2 commits into
makeplane:previewfrom
Syed-Ali-Abbas-Zaidi:feat/9544-attach-multiple-files

Conversation

@Syed-Ali-Abbas-Zaidi

@Syed-Ali-Abbas-Zaidi Syed-Ali-Abbas-Zaidi commented Aug 6, 2026

Copy link
Copy Markdown

Work item attachments were limited to one file at a time. All three attachment dropzones passed multiple: false to react-dropzone and read only acceptedFiles[0], so dragging several files uploaded the first and silently discarded the rest with no error shown.

Upload every accepted file with bounded concurrency (3 in flight) so a large drop does not open one request per file. Per-file failures are non-fatal: the batch keeps its successes and names only the files that failed. Files rejected for exceeding the size limit are reported separately, also by name.

The single-file logic was duplicated across the upload card, the quick action button and the attachment list, so it now lives in one shared useAttachmentDropHandler hook and all three surfaces stay in sync.

No API change is needed: the existing endpoint already creates one asset and one presigned POST per call, so the client simply fans out N calls. The per-file size limit still applies unchanged.

i18n: add six attachment keys across all 19 locales and remove only_one_file_allowed and file_size_limit, which no longer apply.

Closes #9544

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Test Scenarios

References

Summary by CodeRabbit

  • New Features

    • Upload multiple attachments at once with progress tracking and up to three concurrent uploads.
    • Continue processing valid files when individual uploads fail, with success, partial-failure, and failure notifications.
    • Identify and report oversized files without blocking other uploads.
    • Refresh attachment views automatically after uploads complete.
  • Bug Fixes

    • Improved upload-state handling and disabled interactions during uploads or when no workspace is selected.
  • Localization

    • Updated attachment upload and failure messages across supported languages.

Work item attachments were limited to one file at a time. All three
attachment dropzones passed `multiple: false` to react-dropzone and read
only `acceptedFiles[0]`, so dragging several files uploaded the first and
silently discarded the rest with no error shown.

Upload every accepted file with bounded concurrency (3 in flight) so a
large drop does not open one request per file. Per-file failures are
non-fatal: the batch keeps its successes and names only the files that
failed. Files rejected for exceeding the size limit are reported
separately, also by name.

The single-file logic was duplicated across the upload card, the quick
action button and the attachment list, so it now lives in one shared
`useAttachmentDropHandler` hook and all three surfaces stay in sync.

No API change is needed: the existing endpoint already creates one asset
and one presigned POST per call, so the client simply fans out N calls.
The per-file size limit still applies unchanged.

i18n: add six attachment keys across all 19 locales and remove
`only_one_file_allowed` and `file_size_limit`, which no longer apply.

Closes makeplane#9544
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 171dc660-7c27-4e8a-891c-a2774cd1872c

📥 Commits

Reviewing files that changed from the base of the PR and between 95a4349 and 0f8b704.

📒 Files selected for processing (2)
  • apps/web/core/components/issues/attachment/attachment-upload.tsx
  • apps/web/core/components/issues/issue-detail-widgets/attachments/quick-action-button.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/web/core/components/issues/attachment/attachment-upload.tsx
  • apps/web/core/components/issues/issue-detail-widgets/attachments/quick-action-button.tsx

📝 Walkthrough

Walkthrough

Attachment uploads now support multiple files, bounded concurrent processing, progress reporting, partial failures, and shared drop handling. Attachment components refresh activity state after uploads settle. Attachment translations now cover pluralized upload outcomes across supported locales.

Changes

Attachment upload flow

Layer / File(s) Summary
Batch upload orchestration
apps/web/core/components/issues/issue-detail-widgets/attachments/helper.tsx
create accepts file batches, processes up to three files concurrently, reports progress, continues after individual failures, and shows success or failure toasts. The shared drop handler validates rejected files and invokes completion callbacks.
Attachment component integration
apps/web/core/components/issues/attachment/..., apps/web/core/components/issues/issue-detail-widgets/attachments/quick-action-button.tsx
Attachment entry points use the shared drop handler, accept multiple files, disable dropzones during uploads or without a workspace, display batch progress, and refresh activities after completion.
Attachment upload translations
packages/i18n/src/locales/*/common.json
Attachment locales replace single-file and generic size-limit messages with pluralized oversized-file, success, partial-failure, and failure messages.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested reviewers: sriramveeraghanta

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant AttachmentDropzone
  participant useAttachmentDropHandler
  participant useAttachmentOperations
  participant IssueActivities
  User->>AttachmentDropzone: Select multiple files
  AttachmentDropzone->>useAttachmentDropHandler: Pass accepted files
  useAttachmentDropHandler->>useAttachmentOperations: Upload batch and report progress
  useAttachmentOperations-->>useAttachmentDropHandler: Return upload results
  useAttachmentDropHandler->>IssueActivities: Refresh activities after settlement
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes enabling multiple file attachments to work items.
Description check ✅ Passed The description explains the change, selects Feature and refactoring, and references issue #9544; the test section is empty but non-critical.
Linked Issues check ✅ Passed The changes satisfy issue #9544 by enabling multi-file uploads, bounded concurrency, progress, non-fatal failures, size reporting, and no backend changes.
Out of Scope Changes check ✅ Passed The implementation and localization changes support the linked issue and stated objectives without unrelated code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/web/core/components/issues/attachment/attachment-upload.tsx`:
- Around line 51-58: Update the upload progress label in the attachment
component to render progress.completed directly as the completed count, removing
the +1 adjustment while preserving the existing total and singular-file display
behavior.

In
`@apps/web/core/components/issues/issue-detail-widgets/attachments/quick-action-button.tsx`:
- Around line 54-59: Update the disabled state in the component using
getRootProps so the native root button receives the same combined condition as
useDropzone: disabled, isUploading, or missing workspaceSlug. Reuse this unified
disabled value for both the dropzone configuration and button props.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: cf31cc1e-e5fa-43cb-a099-852a5bcd8a9e

📥 Commits

Reviewing files that changed from the base of the PR and between 31853ab and 95a4349.

📒 Files selected for processing (23)
  • apps/web/core/components/issues/attachment/attachment-item-list.tsx
  • apps/web/core/components/issues/attachment/attachment-upload.tsx
  • apps/web/core/components/issues/issue-detail-widgets/attachments/helper.tsx
  • apps/web/core/components/issues/issue-detail-widgets/attachments/quick-action-button.tsx
  • packages/i18n/src/locales/cs/common.json
  • packages/i18n/src/locales/de/common.json
  • packages/i18n/src/locales/en/common.json
  • packages/i18n/src/locales/es/common.json
  • packages/i18n/src/locales/fr/common.json
  • packages/i18n/src/locales/id/common.json
  • packages/i18n/src/locales/it/common.json
  • packages/i18n/src/locales/ja/common.json
  • packages/i18n/src/locales/ko/common.json
  • packages/i18n/src/locales/pl/common.json
  • packages/i18n/src/locales/pt-BR/common.json
  • packages/i18n/src/locales/ro/common.json
  • packages/i18n/src/locales/ru/common.json
  • packages/i18n/src/locales/sk/common.json
  • packages/i18n/src/locales/tr-TR/common.json
  • packages/i18n/src/locales/ua/common.json
  • packages/i18n/src/locales/vi-VN/common.json
  • packages/i18n/src/locales/zh-CN/common.json
  • packages/i18n/src/locales/zh-TW/common.json

Comment thread apps/web/core/components/issues/attachment/attachment-upload.tsx
…d state

Address review feedback on makeplane#9560.

The progress label added one to the settled count, so a three file batch
read "3/3" once only two files had finished and the Math.min clamp then
repeated "3/3" for the final step. Render the completed count directly:
uploads run concurrently, so there is no single "current" file to point
at and completed-of-total is the only accurate reading.

react-dropzone does not forward its disabled state to the root element,
so the quick action button stayed natively enabled while an upload was
in flight or the workspace slug was missing, leaving it clickable but
inert. Give the button the same condition as the dropzone.
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.

[feature]: allow attaching multiple files at once to a work item

1 participant