fix(uve): QA feedback on prevent breadcrumb from showing stale title during navigation#35856
Conversation
…g navigation Guard $updateBreadcrumbEffect with status === UVE_STATUS.LOADED so the breadcrumb only updates once the new page's data has fully resolved from the API. Previously, keeping the previous pageAsset visible during fetch (introduced in #35539) caused the effect to fire with stale title + new URL, and addNewBreadcrumb's URL deduplication then blocked the correct update from ever landing. Closes #35807 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d optional chains Add untracked() on pageParams to prevent TypeError when resetPageParams() nulls the signal during ngOnDestroy before the effect is torn down. Also remove dead optional chaining on page.title/page.identifier since page is already narrowed truthy by the if-guard. Adds a test covering the destroy path: resetPageParams() while status is LOADED must not throw and must not call addNewBreadcrumb. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Move untracked url read inside the if-guard so it only runs when the breadcrumb is actually going to be updated - Add inline comment explaining the dual purpose of untracked (per store CLAUDE.md rule on documenting non-obvious untracked usage) - Fix destroy regression test to actually exercise the async teardown race: cycle uveStatus after resetPageParams() so the effect re-fires with pageParams = null, confirming no TypeError is thrown Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…breadcrumb-stale-title-qa-feedback
|
Claude finished @adrianjm-dotCMS's task in 2m 54s —— View job Review
Overall: The refactor from 🟡 Latent bug papered over, not fixed
🟡 Breadcrumb URL captures the current sub-tab, not always
|
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Revised comments in the DotEmaShellComponent to enhance understanding of the breadcrumb functionality. The changes clarify the purpose of the untracked function, specifically its role in preventing unnecessary re-execution on URL changes and avoiding potential TypeErrors during component destruction.
Updated the DotEmaShellComponent tests to better handle loading states during navigation. Introduced a Subject to simulate pending requests, ensuring that breadcrumb actions are correctly suppressed while data is loading. This change improves the accuracy of the tests by reflecting the component's behavior during asynchronous data fetching.
…ponent Updated the DotEmaShellComponent to ensure that breadcrumbs are only added when a valid URL is present. This change prevents potential errors when the page parameters are not available, enhancing the stability of breadcrumb functionality. Additionally, updated the corresponding test to match the new URL validation logic.
Updated the DotEmaShellComponent to utilize signalMethod for breadcrumb updates, ensuring that breadcrumbs are added only when valid page data is available. This change improves the clarity of the breadcrumb logic and eliminates the need for untracked functions, enhancing overall component performance and maintainability.
Fixes #35807
What changed
dot-ema-shell.component.tsuntracked(() => this.uveStore.pageParams()?.url)with full URL construction viapageFriendlyParams()+normalizeQueryParams()+router.createUrlTree(), producing a proper clickable/dotAdmin/#/edit-page/content?...breadcrumb link instead of just the raw page pathif (!this.uveStore.pageParams()) return nullinsideuntrackedto prevent a crash in headless configs whereuveConfig.urlis set —normalizeQueryParamscallsnew URL(params.clientHost)which throws ifpageParamswas cleared byresetPageParams()before the effect is torn downdot-ema-shell.component.spec.ts#/edit-page/content?...format; one usesstringMatchingto verify the/dotAdmin/#prefixLOADINGand is called exactly once with the new page data afterLOADEDresetPageParams()+ cycleuveStatus) still covers the null-pageParams crash pathTest plan
This PR fixes: #35807