Skip to content

feat: file-upload block - #59

Merged
zyx1121 merged 1 commit into
mainfrom
feat/file-upload
Oct 7, 2026
Merged

zyx1121 merged 1 commit into
mainfrom
feat/file-upload

Conversation

@zyx1121

@zyx1121 zyx1121 commented Oct 7, 2026

Copy link
Copy Markdown
Member

Replaces portal's 8 upload UIs (trip's drop zone, approve's dashed label that promised drag-and-drop it never had, plain Input type=file in receipts and door sounds…). shadcn has no upload component, so this is our own, built on the new attachment.

  • A dashed drop area (rounded-surface, p-6) that is also the picker's label (keyboard focus shows on it); paste also takes files pasted anywhere on the page, as trip does today.
  • Chosen files list as attachment rows (image thumbnails, icons by kind, size) with a remove button.
  • accept / acceptLabel / maxSize: files that do not fit show as error rows with the reason (不支援這種檔案, 超過 10 MB) and stay out of value.
  • name mirrors value into a named file input, so it posts inside form-dialog.
  • Also restores data-day on calendar day buttons (lint flagged the unused day).
  • CI smoke installs the block.

Verified on sandbox with WebKit (dark): picking a PDF, a PNG, a .docx and an 11 MB PDF gave 2 accepted rows (PNG with thumbnail) and 2 error rows with the right reasons; removing one left 1; no console errors.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zyx1121
zyx1121 merged commit 03a8520 into main Oct 7, 2026
2 checks passed
@zyx1121
zyx1121 deleted the feat/file-upload branch October 7, 2026 14:30
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