Repository navigation
fix(docs-support): stop double-prefixing SideNav links with rootURL - #797
Merged
NullVoxPopuli merged 1 commit intoAug 1, 2026
Merged
NullVoxPopuli merged 1 commit into
NullVoxPopuli merged 1 commit into
Conversation
Page/collection paths returned by kolay's PageNav already include the app's rootURL, so wrapping them in joinUrl(this.rootUrl, path) prefixed rootURL twice. For apps whose rootURL isn't '/' (e.g. deployed under a subpath), every sidebar link pointed at a nonexistent route. Signed-off-by: Patrick Pircher <patrick.pircher@ibm.com>
|
|
Contributor
|
Merged
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.
Summary
kolay'spage.path/collection.index.page.pathalready include theapp's
rootURL(seerouter.hrefFor's doc comment: "Includes the rootURL,like
page.path" insrc/browser/services/docs.ts).SideNavwasadditionally wrapping those paths in
joinUrl(this.rootUrl, path), whichprefixed
rootURLa second time.For apps whose
rootURLis/this is a harmless no-op (joinUrldedupesadjacent slashes), which is why it wasn't caught before. But for any app
deployed under a subpath (
rootURLother than/), every link rendered bySideNavpoints at a URL like/subpath/subpath/some-page, which doesn'tresolve to a real route and breaks in-app navigation from the side nav.
Changes
SideNavnow passesx.page.path/x.index.page.pathstraight throughas
@href, without the extrajoinUrl(this.rootUrl, ...)wrapping.joinUrlhelper,routerservice injection, androotUrlgetter.We're carrying this as a
pnpm patchin downstream consumercarbon-components-ember
where
rootURLisn't/; happy to adjust the fix if there's a reason thedouble-prefixing was intentional.
Test plan
pnpm lint:hbs/pnpm lint:prettierpass on the changed filelinks resolve correctly once the double
rootURLprefix is removed