fix(client): render SharePage at bare #/s/:appId share URL - #3561
Open
greglum wants to merge 1 commit into
Open
Conversation
PR #3549 nested the share route under ProjectLayout with only a splat child. In React Router 6 a nested path="*" child does not match the parent's bare path, so the exact URL copied by the Share App dialog (#/s/<appId>) rendered ProjectLayout with an empty outlet and the shared app never appeared; users could only work around it by appending an extra segment such as /portals. Add an index route so SharePage renders at the bare share URL again.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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.
Problem
Since #3549 (merged Aug 13), the URL copied by the Share App dialog —
<base>#/s/<appId>— is broken: opening it rendersProjectLayoutwith an empty outlet and the shared app never appears. Users found that appending an extra segment (e.g./portals) to the copied URL makes it work.Cause
#3549 restructured the share route from a single leaf splat route to a nested one:
In React Router 6, a nested
path="*"child does not match the parent's bare path — anindexroute is required. Verified against the repo'sreact-router-dom@6.30.3withmatchRoutes:/s/abc→ matched only/ > s/:appId(SharePage never rendered)/s/abc/portals→ matched/ > s/:appId > *(which is why appending/portals"fixed" it)Fix
Add an index child rendering the same
SharePage:After the fix,
matchRoutesresolves/s/abc,/s/abc/, and/s/abc/<anything>to SharePage. The copied URL itself was always correct, so no change to the Share dialog is needed.tsc --noEmitonpackages/clientreports an identical error profile before and after the change (all pre-existing).