Skip to content

fix: add onUploadStart prop to be called when a file upload started #276

Open
tomrndom wants to merge 2 commits into
mainfrom
fix/upload-v3-on-upload-start
Open

fix: add onUploadStart prop to be called when a file upload started #276
tomrndom wants to merge 2 commits into
mainfrom
fix/upload-v3-on-upload-start

Conversation

@tomrndom

@tomrndom tomrndom commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

ref: https://app.clickup.com/t/86b9n7p5w

Signed-off-by: Tomás Castillo tcastilloboireau@gmail.com

Summary by CodeRabbit

Release Notes

  • New Features
    • Added optional onUploadStart callback to the file upload component, triggering when upload begins and enabling custom behavior independent of completion events.

… upload

Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@tomrndom, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 52 minutes and 7 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 41ae16b4-1f00-429c-8e04-13428125acf7

📥 Commits

Reviewing files that changed from the base of the PR and between 9b8531e and 0697857.

📒 Files selected for processing (1)
  • src/components/inputs/upload-input-v3/index.js
📝 Walkthrough

Walkthrough

UploadInputV3 gains an optional onUploadStart callback prop (default null). It is destructured from the component's props and invoked with the file argument inside handleAddedFile when the first upload item is added, before existing upload progress handling.

Changes

onUploadStart callback for UploadInputV3

Layer / File(s) Summary
onUploadStart prop declaration and invocation
src/components/inputs/upload-input-v3/index.js
Adds onUploadStart = null to props destructuring and calls onUploadStart(file) inside handleAddedFile when the callback is provided.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A bunny hops in, file in paw,
"Upload begins!" it says with awe.
onUploadStart now rings the bell,
Before the progress bars can swell.
🐇✨ Small change, but oh so well!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding an onUploadStart prop to the UploadInputV3 component that is invoked when file uploads begin.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/upload-v3-on-upload-start

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

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@src/components/inputs/upload-input-v3/index.js`:
- Around line 142-145: The handleAddedFile callback uses the onUploadStart prop
but the useCallback hook has an empty dependency array, causing the callback to
capture a stale reference to onUploadStart that won't update when the prop
changes. Add onUploadStart to the dependency array of the useCallback in the
handleAddedFile function to ensure the latest prop value is always captured.
🪄 Autofix (Beta)

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

Run ID: cb918a50-1ac7-40a2-9ca9-2a533ab27cb9

📥 Commits

Reviewing files that changed from the base of the PR and between 8cf6c39 and 9b8531e.

📒 Files selected for processing (1)
  • src/components/inputs/upload-input-v3/index.js

Comment thread src/components/inputs/upload-input-v3/index.js Outdated
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
@tomrndom tomrndom requested a review from smarcet June 23, 2026 20:46
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