Skip to content

feat(attachments): add Attachments and the file drop zone - #12

Closed
pratikbuilds wants to merge 1 commit into
conversation/07-conversation-mapfrom
conversation/10-attachments
Closed

pratikbuilds wants to merge 1 commit into
conversation/07-conversation-mapfrom
conversation/10-attachments

Conversation

@pratikbuilds

Copy link
Copy Markdown
Owner

Attachments renders files as a stack above the input, tiles in a message, or a list, with preview, info, remove and more parts. The host owns the list: useAttachments applies the count, size and duplicate limits, builds previews and revokes every object URL it made once its attachment leaves the list. useFileDrop and AttachmentDropZone accept files and whole folders, and a stray drop elsewhere never replaces the page.

Stacked on #11: review only this commit. Part of corbitsdev#94.

Notes for review

  • Hosts call release(ids) before moving attachments into a sent message, so the message keeps its previews (otherwise their object URLs are revoked).
  • Files from a dropped folder are named by their path ("project/src/index.ts") so same-sized files in different folders aren't refused as duplicates. Folder walks have an entry budget (default 500) and skip hidden entries.
  • "Show less" and "Remove all" are host buttons, not library parts; no text excerpts in previews.
  • Drag-over state uses an enter/leave depth counter (WebKit omits relatedTarget on drag events). When the last attachment is removed, focus goes to returnFocusTo.

Verification

  • This commit passes bun run typecheck and bun run lint on its own (the stack is checked commit by commit).
  • At the top of the stack: bun run check, bun run build, bun run dep-guard, bun run contrast-test and bun run test:e2e (Playwright specs and the Storybook axe sweep in light and dark) pass.

Closes corbitsdev#104

Attachments renders files as a stack above the input, tiles in a
message, or a list, with preview, info, remove and more parts. The host
owns the list: useAttachments applies the count, size and duplicate
limits, builds previews and revokes every object URL it made once its
attachment leaves the list. useFileDrop and AttachmentDropZone accept
files and whole folders, and a stray drop elsewhere never replaces the
page.
@pratikbuilds

Copy link
Copy Markdown
Owner Author

Moved upstream: corbitsdev#124

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