Skip to content

docs(docs-infra): preserve navigation origin when clicking cross-category links#68023

Open
erkamyaman wants to merge 1 commit intoangular:mainfrom
erkamyaman:fix/navigation-cross-category-back
Open

docs(docs-infra): preserve navigation origin when clicking cross-category links#68023
erkamyaman wants to merge 1 commit intoangular:mainfrom
erkamyaman:fix/navigation-cross-category-back

Conversation

@erkamyaman
Copy link
Copy Markdown
Contributor

@erkamyaman erkamyaman commented Apr 3, 2026

docs(docs-infra): preserve navigation origin when clicking cross-category links

When a sidebar item links to a page in a different category (e.g., "Route transition animations" under Animations links to a Routing page), clicking back navigates to the main menu instead of the originating category.

Store the originating category in NavigationState when clicking a cross-referenced item, so the back button returns to the correct section.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

When navigating to a cross-category link in the docs sidebar (e.g., clicking
"Route transition animations" under Animations, which routes to a Routing
page), the sidebar switches to the Routing section. Pressing the back arrow
navigates to the main menu instead of returning to Animations.

The same issue affects "Testing routing and navigation" under Testing, which
routes to a Routing page.

Screen.Recording.2026-04-03.at.21.56.54.mov

Issue Number: N/A

What is the new behavior?

Clicking back returns to the originating category. A crossCategoryOrigin
signal in NavigationState stores the parent section when a cross-referenced
item is clicked. The back button checks this signal and navigates to the
stored origin instead of the main menu.

Items that link across categories are marked with isCrossReferenced: true
in the navigation data.

Screen.Recording.2026-04-03.at.22.13.29.mov

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Affected files:

  • NavigationItem interface — added isCrossReferenced property
  • NavigationState service — added crossCategoryOrigin signal
  • NavigationList component — back button and link click logic
  • Navigation entries — flagged 2 cross-category items

@pullapprove pullapprove bot requested review from JeanMeche and alan-agius4 April 3, 2026 19:22
@angular-robot angular-robot bot added the area: docs-infra Angular.dev application and infrastructure label Apr 3, 2026
@ngbot ngbot bot added this to the Backlog milestone Apr 3, 2026
@JeanMeche
Copy link
Copy Markdown
Member

Can you make to make that change a single docs(docs-infra): ... commit. Thanks.

@erkamyaman erkamyaman force-pushed the fix/navigation-cross-category-back branch from cdc32b9 to e807223 Compare April 3, 2026 21:11
@erkamyaman
Copy link
Copy Markdown
Contributor Author

erkamyaman commented Apr 3, 2026

Can you make to make that change a single docs(docs-infra): ... commit. Thanks.

Done! Thank you

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

Deployed adev-preview for 0f1c3e8 to: https://ng-dev-previews-fw--pr-angular-angular-68023-adev-prev-lpj2n820.web.app

Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt.

@erkamyaman erkamyaman force-pushed the fix/navigation-cross-category-back branch from e807223 to e1138d0 Compare April 3, 2026 21:15
@angular-robot angular-robot bot added the area: docs Related to the documentation label Apr 3, 2026
…gory links

When a sidebar item links to a page in a different category (e.g., Route
transition animations under Animations links to a Routing page), clicking
back navigates to the main menu instead of the originating category.

Store the originating category in NavigationState when clicking a
cross-referenced item, so the back button returns to the correct section.
@erkamyaman erkamyaman force-pushed the fix/navigation-cross-category-back branch from e1138d0 to 0f1c3e8 Compare April 4, 2026 16:07
@erkamyaman
Copy link
Copy Markdown
Contributor Author

Added missing crossCategoryOrigin signal to FakeNavigationListState to match the updated NavigationState service.

@erkamyaman erkamyaman changed the title fix(docs-infra): preserve navigation origin when clicking cross-category links docs(docs-infra): preserve navigation origin when clicking cross-category links Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adev: preview area: docs Related to the documentation area: docs-infra Angular.dev application and infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants