Skip to content

feat(content-uploader): add support for item share button and open preview button#4624

Closed
Omfalos wants to merge 3 commits into
box:masterfrom
Omfalos:uploadsManagerItemShareButton
Closed

feat(content-uploader): add support for item share button and open preview button#4624
Omfalos wants to merge 3 commits into
box:masterfrom
Omfalos:uploadsManagerItemShareButton

Conversation

@Omfalos

@Omfalos Omfalos commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Add support to two new callbacks added to the uploads manager that where not passed from wrapping component
They enable to perform action connected to share and to opening in new tab

Summary by CodeRabbit

Release Notes

  • New Features

    • Upload items now support optional share and open action callbacks. You can handle share/open interactions through the upload manager, including safe defaults when callbacks aren’t provided.
  • Tests

    • Added coverage to ensure share/open callbacks are correctly forwarded in the modernized uploads experience, and that missing callbacks fall back to no-op behavior without errors.

@Omfalos
Omfalos requested review from a team as code owners June 12, 2026 11:08
@CLAassistant

CLAassistant commented Jun 12, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ Omfalos
❌ Karol Machulski


Karol Machulski seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 69318c7d-69f2-4b62-a0d9-a18e08312547

📥 Commits

Reviewing files that changed from the base of the PR and between 4ee59c6 and c56b28a.

📒 Files selected for processing (1)
  • src/elements/content-uploader/ContentUploader.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/elements/content-uploader/ContentUploader.tsx

Walkthrough

ContentUploader adds two new optional callback props—onItemShare and onItemOpen—to its public interface. These props are forwarded to UploadsManagerBP in the modernized uploads rendering path, with no-op defaults ensuring safe behavior when omitted. Tests validate prop forwarding and default behavior.

Changes

Modernized Uploads Callback Props

Layer / File(s) Summary
Callback prop contract and wiring
src/elements/content-uploader/ContentUploader.tsx
ContentUploaderProps interface defines onItemShare and onItemOpen callbacks; defaultProps provides no-op defaults; the modernized uploads render path destructures and forwards these props to UploadsManagerBP.
Prop wiring validation tests
src/elements/content-uploader/__tests__/ContentUploader.test.js
Four new tests verify that onItemShare and onItemOpen props are correctly passed through to UploadsManagerBP and that no-op defaults do not throw when invoked.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Possibly related PRs

  • box/box-ui-elements#4571: Modernized UploadsManagerBP integration feature flag that works with this PR's callback prop forwarding.

Suggested reviewers

  • jpan-box
  • olehrybak
  • tjuanitas

Poem

🐰 Two callbacks bound up neat,
Share and open, a complete feat!
Props dance through the upload flow,
Tests ensure the defaults glow. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description explains the purpose of the changes but lacks details about which callbacks were added and how they integrate with the uploads manager. Enhance the description by specifying the callback names (onItemShare, onItemOpen), their signatures, and how they're used in the UploadsManagerBP component.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding support for item share button and open preview button callbacks to the ContentUploader component.
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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed due to a network error.


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 and usage tips.

loonskai
loonskai previously approved these changes Jun 12, 2026
onMinimize?: () => void;
onProgress: (item: UploadItem) => void;
onResume: (item: UploadItem) => void;
onItemShare: (itemId: string) => void;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn’t these be optional? If I’m understanding correctly, the old UploadsManager doesn’t support them.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, we should make them optional

@Omfalos
Omfalos force-pushed the uploadsManagerItemShareButton branch from 4ee59c6 to c56b28a Compare June 15, 2026 10:38
@Omfalos Omfalos closed this Jun 15, 2026
@Omfalos

Omfalos commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

issue with author

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.

5 participants