feat(uve): Fix same-page navigation handling with anchors with id#35326
Conversation
- Added utility to determine if a URL change is a same-page navigation (hash-only or query-only). - Updated to prevent triggering page load for same-page navigations. - Enhanced tests in to cover various same-page navigation scenarios. - Modified to utilize the new utility for navigation updates. - Updated to exclude hash-only links from triggering navigation actions. This change improves user experience by preventing unnecessary page reloads during internal navigation events.
|
Claude finished @KevinDavilaDotCMS's task in 4m 25s —— View job PR Review
Three issues worth flagging: 1. In if (isSamePageNavigation(incomingUrl, currentPageUrl)) {
return;
}
const isSameUrl = compareUrlPaths(currentPageUrl, incomingUrl);
if (isSameUrl) {
uveStore.setEditorState(EDITOR_STATE.IDLE); // ← never reached
}Both This also introduces a silent behavioral regression: previously, 2. Full-path same-page anchor links still cause VTL iframe reloads The filter in const isHashOnly = href?.startsWith('#');
const hasLink = !!href && !isHashOnly;A link like The issue title mentions "anchor links with internal IDs" — this case is still broken for full-path anchor links on the same page ( 3. Query-param-only changes silently suppressed for all page types
|
- Updated the logic to determine same-page navigation to consider any hash or query changes on the same pathname. - Modified related tests to reflect the new behavior, ensuring that page loads are not triggered for same-page navigations. - Improved documentation for the utility to clarify its functionality. These changes streamline navigation handling, improving user experience by preventing unnecessary page reloads during internal navigation events.
This change improves user experience by preventing unnecessary page reloads during internal navigation events.
2026-04-15.10-08-42.mov
This PR fixes: #35324
This PR fixes: #35324