fix(sharing): use folder link for Copy link on folders (#2987)#2988
Open
cqnykamp wants to merge 3 commits into
Open
fix(sharing): use folder link for Copy link on folders (#2987)#2988cqnykamp wants to merge 3 commits into
cqnykamp wants to merge 3 commits into
Conversation
The share modal hard-coded the shareable link to /activityViewer/<id> for all content types, but that route only serves activities, so copying the link for a folder produced a 404. Build /sharedActivities/<ownerId>/<id> for folders (matching how folder links are generated elsewhere) and keep /activityViewer/<id> for other content. getEditorShareStatus now returns the owner id needed to build the folder link. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The folder-vs-activity view-link ternary was duplicated across SharedActivities, SharedWithMe, Explore, and (newly) ShareModal. Extract a single contentViewerUrl helper in utils/url.ts and route all four sites through it. Behavior is preserved, including Explore's fallback to the activity viewer for a folder with no known owner. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2987
Problem
Copying the share link for an unlisted folder produced a 404. The link was of the form
.../activityViewer/<id>, which is a route that only serves activities — not folders.Root cause
ShareModalhard-coded the shareable link to/activityViewer/${contentId}for all content types. Folders must be opened via/sharedActivities/${ownerId}/${folderId}(the same format used everywhere else folder links are generated, e.g.SharedActivities.tsx).The issue also reported that manually rewriting the URL to
.../sharedActivities/<id>still 404s. That is not a real API bug:isOpenableSharedFolderalready permitsunlistedfolders, andupdateVisibilitycascades a folder's visibility down to all descendants, so the contents are visible too.The manual URL 404'd only because it placed the folder id in the
ownerIdslot (with no parent segment), sogetUseron a non-user id threw. The correct two-segment link works.Changes
getEditorShareStatusnow returnsownerId(short URL form viafromUUID), needed to build a folder link.ownerIdto theSharingDatatype and plumbed it intoSharePublicly.shareableLinknow builds/sharedActivities/${ownerId}/${contentId}for folders and keeps/activityViewer/${contentId}for other content.ShareModal.cy.tsxcases asserting the clipboard receives the correct folder vs. activity URL.🤖 Generated with Claude Code