Skip to content

feat: multi-file uploads, progress overlay, batched send#186

Merged
ValwareIRC merged 1 commit into
mainfrom
feat/multimedia-uploads
May 10, 2026
Merged

feat: multi-file uploads, progress overlay, batched send#186
ValwareIRC merged 1 commit into
mainfrom
feat/multimedia-uploads

Conversation

@ValwareIRC
Copy link
Copy Markdown
Contributor

The "Upload Image" picker is now "Upload Files" -- it accepts multiple images, videos, and audio in one go, shows live per-file progress above the chat input, and on completion sends a single PRIVMSG containing every successful URL space-joined so the receiver sees one logical send instead of N separate messages.

  • lib/mediaUpload.ts: XHR-based uploader (fetch() doesn't expose upload-side progress events), with a signal for cancellation and a memo'd fetchUploadInfo() that pulls the backend's /upload/info policy once per filehost. validateFileAgainstInfo() does cheap client-side allowlist / size checks before pushing bytes. Form data is posted under both "file" (new) and "image" (legacy) so the new client works against older backend deployments too.

  • components/ui/UploadProgressOverlay.tsx: progress strip anchored above the input. One row per file with a determinate bar fed by upload.onprogress, "done" / "failed" marks once each settles, and a per-row cancel button.

  • components/layout/ChatArea.tsx:

    • New uploadJobs state + handleFilesUpload(files) that runs uploads in parallel, surfaces progress, and on full success fires one PRIVMSG <target> :<url1> <url2> <url3>. PMs get the local addMessage echo since channels echo back via echo-message.
    • The plus-menu "Upload Files" picker uses accept="image/*,video/*,audio/*" and multiple. Single images still pass through the existing image-preview modal so the user can confirm before sending; everything else (or multi-select) goes straight to the upload path.
    • Image preview's "send" now routes through handleFilesUpload so single-image uploads also get the progress strip.
    • cancelUploadJob aborts the in-flight XHR.

The "Upload Image" picker is now "Upload Files" -- it accepts
multiple images, videos, and audio in one go, shows live per-file
progress above the chat input, and on completion sends a single
PRIVMSG containing every successful URL space-joined so the receiver
sees one logical send instead of N separate messages.

  * lib/mediaUpload.ts: XHR-based uploader (fetch() doesn't expose
    upload-side progress events), with a `signal` for cancellation
    and a memo'd fetchUploadInfo() that pulls the backend's
    /upload/info policy once per filehost.  validateFileAgainstInfo()
    does cheap client-side allowlist / size checks before pushing
    bytes.  Form data is posted under both "file" (new) and "image"
    (legacy) so the new client works against older backend
    deployments too.

  * components/ui/UploadProgressOverlay.tsx: progress strip anchored
    above the input.  One row per file with a determinate bar fed
    by upload.onprogress, "done" / "failed" marks once each
    settles, and a per-row cancel button.

  * components/layout/ChatArea.tsx:
    - New `uploadJobs` state + `handleFilesUpload(files)` that runs
      uploads in parallel, surfaces progress, and on full success
      fires one `PRIVMSG <target> :<url1> <url2> <url3>`.  PMs get
      the local addMessage echo since channels echo back via
      echo-message.
    - The plus-menu "Upload Files" picker uses
      `accept="image/*,video/*,audio/*"` and `multiple`.  Single
      images still pass through the existing image-preview modal
      so the user can confirm before sending; everything else (or
      multi-select) goes straight to the upload path.
    - Image preview's "send" now routes through handleFilesUpload
      so single-image uploads also get the progress strip.
    - cancelUploadJob aborts the in-flight XHR.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

Warning

Rate limit exceeded

@ValwareIRC has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 57 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 06a649ac-86a7-41eb-b1d5-d1a1537763ef

📥 Commits

Reviewing files that changed from the base of the PR and between e7d7899 and 0252928.

📒 Files selected for processing (3)
  • src/components/layout/ChatArea.tsx
  • src/components/ui/UploadProgressOverlay.tsx
  • src/lib/mediaUpload.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/multimedia-uploads

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
Review rate limit: 0/1 reviews remaining, refill in 22 minutes and 57 seconds.

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Pages Preview
Preview URL: https://feat-multimedia-uploads.obsidianirc.pages.dev

Automated deployment preview for the PR in the Cloudflare Pages.

Copy link
Copy Markdown
Contributor

@matheusfillipe matheusfillipe left a comment

Choose a reason for hiding this comment

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

user name only showing in first picture. Collapsing broke.

Image

@ValwareIRC ValwareIRC merged commit 179a622 into main May 10, 2026
4 checks passed
@ValwareIRC ValwareIRC deleted the feat/multimedia-uploads branch May 10, 2026 02: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.

2 participants