Fix Showcase footer scroll jitter - #109
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7c0773e8c3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| <a routerLink="/agents" (click)="prepareRouteTopNavigation()" i18n="@@shell.footer.col.pages.agents">Agents</a> | ||
| <a routerLink="/privacy" (click)="prepareRouteTopNavigation()" i18n="@@shell.footer.col.pages.privacy">Privacy</a> | ||
| <a routerLink="/support" (click)="prepareRouteTopNavigation()" i18n="@@shell.footer.col.pages.support">Support</a> | ||
| <a routerLink="/" i18n="@@shell.footer.col.pages.home">Home</a> |
There was a problem hiding this comment.
Preserve top scroll for same-route footer links
In this app provideRouter(...) does not set onSameUrlNavigation, so Angular uses its default same-URL behavior and ignores a routerLink click that targets the current route. After these footer links lost their click handler, clicking the footer link for the page you are already on (for example /about → footer About) no longer emits a router scroll event and leaves the user at the bottom instead of returning to the top; keep a guarded top-scroll path for same-route footer clicks or configure same-URL navigation explicitly.
Useful? React with 👍 / 👎.
Summary
Removes the pre-bootstrap and shell-level retry loops so Angular router restoration is the sole route-scroll owner, while preserving real footer links and reduced-motion behavior.
Root cause
Competing smooth-scroll resets were scheduled for up to three seconds, repeatedly restarting the animation and overriding later user scrolling.
Impact
Internal Showcase footer navigation now produces one uninterrupted top scroll without delayed snap-back, while back/forward restoration and external links remain unchanged.
Validation
Passed the 51-contract Showcase foundation test, all 16 Angular ChromeHeadless tests, HTML lint, and a production build that prerendered 54 routes.