feat(web): allow attaching multiple files at once to a work item - #9560
feat(web): allow attaching multiple files at once to a work item#9560Syed-Ali-Abbas-Zaidi wants to merge 2 commits into
Conversation
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
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAttachment 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. ChangesAttachment upload flow
Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested reviewers: 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
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (23)
apps/web/core/components/issues/attachment/attachment-item-list.tsxapps/web/core/components/issues/attachment/attachment-upload.tsxapps/web/core/components/issues/issue-detail-widgets/attachments/helper.tsxapps/web/core/components/issues/issue-detail-widgets/attachments/quick-action-button.tsxpackages/i18n/src/locales/cs/common.jsonpackages/i18n/src/locales/de/common.jsonpackages/i18n/src/locales/en/common.jsonpackages/i18n/src/locales/es/common.jsonpackages/i18n/src/locales/fr/common.jsonpackages/i18n/src/locales/id/common.jsonpackages/i18n/src/locales/it/common.jsonpackages/i18n/src/locales/ja/common.jsonpackages/i18n/src/locales/ko/common.jsonpackages/i18n/src/locales/pl/common.jsonpackages/i18n/src/locales/pt-BR/common.jsonpackages/i18n/src/locales/ro/common.jsonpackages/i18n/src/locales/ru/common.jsonpackages/i18n/src/locales/sk/common.jsonpackages/i18n/src/locales/tr-TR/common.jsonpackages/i18n/src/locales/ua/common.jsonpackages/i18n/src/locales/vi-VN/common.jsonpackages/i18n/src/locales/zh-CN/common.jsonpackages/i18n/src/locales/zh-TW/common.json
…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.
Work item attachments were limited to one file at a time. All three attachment dropzones passed
multiple: falseto react-dropzone and read onlyacceptedFiles[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
useAttachmentDropHandlerhook 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_allowedandfile_size_limit, which no longer apply.Closes #9544
Description
Type of Change
Screenshots and Media (if applicable)
Test Scenarios
References
Summary by CodeRabbit
New Features
Bug Fixes
Localization