Skip to content

fix(content-sharing): Include direct link logic#4529

Merged
mergify[bot] merged 1 commit into
masterfrom
fix-content-sharing-direct-link
May 1, 2026
Merged

fix(content-sharing): Include direct link logic#4529
mergify[bot] merged 1 commit into
masterfrom
fix-content-sharing-direct-link

Conversation

@reneshen0328
Copy link
Copy Markdown
Contributor

@reneshen0328 reneshen0328 commented Apr 30, 2026

Summary by CodeRabbit

  • New Features
    • Shared links now include download URLs and expose direct-link availability in link settings; password-protected links continue to be supported
  • Tests
    • Extended test coverage to validate direct-link available and unavailable scenarios for shared links

@reneshen0328 reneshen0328 requested review from a team as code owners April 30, 2026 19:53
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

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: b15255fc-b42c-4158-851f-cda710461175

📥 Commits

Reviewing files that changed from the base of the PR and between ea4c6e3 and e18a7d0.

📒 Files selected for processing (3)
  • src/elements/content-sharing/utils/__mocks__/ContentSharingV2Mocks.js
  • src/elements/content-sharing/utils/__tests__/convertItemResponse.test.ts
  • src/elements/content-sharing/utils/convertItemResponse.ts
✅ Files skipped from review due to trivial changes (1)
  • src/elements/content-sharing/utils/mocks/ContentSharingV2Mocks.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/elements/content-sharing/utils/convertItemResponse.ts

Walkthrough

Adds direct-download information to content-sharing mocks, extends convertItemResponse to surface shared link download URL and direct-link availability, and updates tests to cover both available and unavailable direct-link scenarios.

Changes

Cohort / File(s) Summary
Mocks
src/elements/content-sharing/utils/__mocks__/ContentSharingV2Mocks.js
Added download_url to MOCK_SHARED_LINK and set shared_link_features.download_url: true in DEFAULT_ITEM_API_RESPONSE.
Conversion Logic
src/elements/content-sharing/utils/convertItemResponse.ts
Destructures shared_link_features.download_url into isDirectLinkAvailable; reads shared_link.download_url and returns sharedLink.downloadUrl and sharedLink.settings.isDirectLinkAvailable.
Tests
src/elements/content-sharing/utils/__tests__/convertItemResponse.test.ts
Extended assertions to include sharedLink.downloadUrl and sharedLink.settings.isDirectLinkAvailable; added tests for both direct-link available and unavailable cases.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

ready-to-merge

Suggested reviewers

  • jfox-box
  • tjuanitas
  • jpan-box

Poem

🐰 I found a link beneath a log,
Direct downloads now spring from the bog,
Mocks updated, tests in tune,
Conversion hums a happy tune,
Hoppity-hop, the code’s in vogue! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is entirely a template comment block containing merge process guidance with no implementation details, technical context, or explanation of the changes being made. Replace the template comment with a clear description of what direct link logic was added, why it was needed, and how the changes affect content-sharing functionality.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and specifically describes the main change: adding direct link logic to content-sharing, which aligns with the codebase modifications that add download_url handling throughout mocks, tests, and the conversion utility.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-content-sharing-direct-link

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: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

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

Comment thread src/elements/content-sharing/utils/__mocks__/ContentSharingV2Mocks.js Outdated
@mergify mergify Bot added the queued label May 1, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 1, 2026

Merge Queue Status

  • Entered queue2026-05-01 16:14 UTC · Rule: Automatic strict merge
  • Checks skipped · PR is already up-to-date
  • Merged2026-05-01 16:14 UTC · at e18a7d0df61ee28eadb291434d5335dfcb9cda6d · squash

This pull request spent 11 seconds in the queue, including 2 seconds running CI.

Required conditions to merge

@mergify mergify Bot merged commit 9fb30b5 into master May 1, 2026
12 checks passed
@mergify mergify Bot deleted the fix-content-sharing-direct-link branch May 1, 2026 16:14
@mergify mergify Bot removed the queued label May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants