Skip to content

feat(uve): navigate to new edit content editor from Go to Full Editor when the new edit content is active#35493

Open
adrianjm-dotCMS wants to merge 5 commits intomainfrom
issue-33235-new-edit-content-experience-not-launched-from-uve
Open

feat(uve): navigate to new edit content editor from Go to Full Editor when the new edit content is active#35493
adrianjm-dotCMS wants to merge 5 commits intomainfrom
issue-33235-new-edit-content-experience-not-launched-from-uve

Conversation

@adrianjm-dotCMS
Copy link
Copy Markdown
Member

@adrianjm-dotCMS adrianjm-dotCMS commented Apr 28, 2026

Summary

  • When the user clicks Go to Full Editor in UVE, navigate to /content/:inode if the content type has FEATURE_FLAG_CONTENT_EDITOR2_ENABLED in its metadata; otherwise fall back to the existing dialog behavior
  • Update the UVE breadcrumb to use the full /dotAdmin/#/edit-page/content?... URL so users can navigate back to the exact editor page from the breadcrumb trail
  • Fix breadcrumb deduplication to search the entire trail (not just the last crumb), enabling correct truncation when navigating back to a previous UVE page
  • Fix contentEdit regex in breadcrumb utils to prevent /edit-page/content?... UVE routes from incorrectly triggering the replace-last-crumb rule
  • Add untracked() around breadcrumbs read inside the navigation effect to prevent infinite reactive loops
Screen.Recording.2026-04-28.at.4.59.44.PM.mov

Changed Files

  • libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/edit-ema-editor.component.ts — core "Go to Full Editor" routing logic
  • libs/portlets/edit-ema/portlet/src/lib/dot-ema-shell/dot-ema-shell.component.ts — UVE breadcrumb now uses full navigable URL
  • libs/global-store/src/lib/features/breadcrumb/breadcrumb.feature.ts — full-trail deduplication + untracked() fix
  • libs/global-store/src/lib/features/breadcrumb/breadcrumb.utils.ts — regex fix for UVE routes

Acceptance Criteria

  • Clicking "Go to Full Editor" navigates to /content/:inode when FEATURE_FLAG_CONTENT_EDITOR2_ENABLED is true in the content type metadata
  • Falls back to the existing dialog when the flag is absent or false
  • Falls back to dialog when the content type is not in the cache
  • Does nothing when the contentlet has no inode
  • UVE breadcrumb is clickable and navigates back to the correct editor page
  • Navigating back to a previously visited UVE page truncates the breadcrumb trail correctly

Test Plan

  • Unit tests added for all handleOpenFullEditor branches (new editor, dialog fallback, cache miss, no inode)
  • Breadcrumb tests updated and new truncation test added
  • All affected tests pass locally

Closes #33235

🤖 Generated with Claude Code

… button when CONTENT_EDITOR2_ENABLED flag is active

- When clicking Go to Full Editor in UVE, navigate to /content/:inode if the content type has FEATURE_FLAG_CONTENT_EDITOR2_ENABLED in its metadata; otherwise fall back to the existing dialog
- Update UVE breadcrumb to use the full /dotAdmin/#/edit-page/content?... URL so users can navigate back to the exact editor page from the breadcrumb trail
- Fix breadcrumb deduplication to search the entire trail instead of only the last crumb, enabling proper truncation when navigating back to a previous UVE page
- Fix contentEdit regex in breadcrumb utils to prevent /edit-page/content?... UVE routes from incorrectly triggering the replace-last-crumb rule
- Add untracked() around breadcrumbs read in the navigation effect to prevent infinite reactive loops

Closes #33235

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@adrianjm-dotCMS adrianjm-dotCMS marked this pull request as ready for review April 28, 2026 19:09
@github-actions github-actions Bot added the Area : Frontend PR changes Angular/TypeScript frontend code label Apr 28, 2026
Copilot AI review requested due to automatic review settings April 28, 2026 19:09
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 28, 2026

Claude finished @adrianjm-dotCMS's task in 3m 46s —— View job


PR Review

  • Gather context and understand request
  • Read changed files
  • Review breadcrumb feature changes
  • Review UVE editor routing logic
  • Review test coverage
  • Post findings

Issues Found

1. truncateBreadcrumbs silently drops the incoming crumb's updated data

breadcrumb.feature.ts:160-169

When existingIndex is found at a non-last position, the trail is truncated and item is discarded:

if (existingIndex > -1) {
    if (existingIndex === currentBreadcrumbs.length - 1) {
        // ✅ last item — URL update handled
        if (normalizeUrl(currentBreadcrumbs[existingIndex].url) !== url) {
            setLastBreadcrumb(item);
        }
        return;
    }
    truncateBreadcrumbs(existingIndex); // ❌ item's new URL/label are lost
    return;
}

Concrete scenario: User opens UVE page A in English → navigates to a content detail page (breadcrumb appended) → switches language in UVE to Spanish → navigates back to the UVE page. The ID match finds page A at a non-last index. truncateBreadcrumbs keeps the English URL in the crumb; the Spanish URL from item is discarded. Clicking the breadcrumb sends the user to the wrong language.

Fix: after truncateBreadcrumbs(existingIndex) call setLastBreadcrumb(item) to apply the incoming crumb's current data before returning. Fix this →


2. contentEdit regex over-matches /content?filter=...

breadcrumb.utils.ts:169

const regex = /^\/content(?:[/?].+)?$/;

The character class [/?] accepts ? as the separator, so /content?filter=blog satisfies this regex. The PR author correctly explained this is unreachable today because addNewBreadcrumb is never called with a filter URL — those go through the contentFilter ROUTE_HANDLER. But the regex is misleading and fragile: a future caller that passes a filter URL would silently trigger the replace-last rule instead of the expected append.

Tighter: ^\/content\/[^?#]+ (only matches /content/{inode} paths, not query-only variants).


3. uvePage regex is unanchored (inconsistency)

breadcrumb.utils.ts:178

// contentEdit: anchored with ^ and $
const regex = /^\/content(?:[/?].+)?$/;

// uvePage: no anchors
const regex = /\/edit-page\/content/;

uvePage would match /foo/edit-page/content/bar or any URL that merely contains the substring. Unlikely to cause problems now, but inconsistent with contentEdit. Consider ^\/edit-page\/content(?:$|[?#]).


4. $updateBreadcrumbEffect has an undeclared reactive dependency

dot-ema-shell.component.ts:215-216

const cleaned = normalizeQueryParams(this.uveStore.pageFriendlyParams(), baseClientHost);

pageFriendlyParams() is a reactive signal read inside an Angular effect() without untracked(). This is intentional for language/variant switches, but the side-effect is that every query-param change (even transient intermediate states during a page load) causes addNewBreadcrumb to fire. Depending on how many times pageFriendlyParams settles before the new page data is stable, this could add duplicate or stale crumbs to the trail. The guard if (!page) return only protects against a completely absent page — it doesn't guard against partial/intermediate state. Worth verifying empirically.


What's correct

  • Absolute path ['/content', contentlet.inode] and === true strict check are both in place (correctly applied after earlier review round).
  • The untracked() wrapper in the breadcrumb onInit effect is the right fix for the reactive loop.
  • Full router.serializeUrl(router.createUrlTree(...)) breadcrumb URL construction produces stable, navigable back-links.
  • Test coverage is solid — all four handleOpenFullEditor branches (new editor, dialog fallback, cache miss, no inode) are exercised.

@adrianjm-dotCMS adrianjm-dotCMS changed the title feat(uve): navigate to new edit content editor from Go to Full Editor when CONTENT_EDITOR2_ENABLED is active feat(uve): navigate to new edit content editor from Go to Full Editor when the new edit content is active Apr 28, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates UVE (Edit EMA) navigation and breadcrumb handling so that “Go to Full Editor” launches the new Edit Content experience when the content type has the CONTENT_EDITOR2_ENABLED metadata flag, while improving breadcrumb URL correctness and deduplication/truncation behavior in the global breadcrumb store.

Changes:

  • Route “Go to Full Editor” to the new content editor (/content/:inode) when CONTENT_EDITOR2_ENABLED is enabled; otherwise keep the dialog fallback.
  • Make UVE breadcrumbs navigable back to the exact editor URL (/dotAdmin/#/edit-page/content?...).
  • Improve breadcrumb deduplication/truncation and prevent reactive loops in the breadcrumb feature; tighten content-edit matching regex to avoid UVE route collisions.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/edit-ema-editor.component.ts Adds feature-flag-based routing to the new content editor from UVE’s “Go to Full Editor”.
core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/edit-ema-editor.component.spec.ts Adds unit coverage for the new routing vs dialog fallback branches.
core-web/libs/portlets/edit-ema/portlet/src/lib/dot-ema-shell/dot-ema-shell.component.ts Builds breadcrumbs using the full /dotAdmin/#/edit-page/content?... URL for accurate back navigation.
core-web/libs/portlets/edit-ema/portlet/src/lib/dot-ema-shell/dot-ema-shell.component.spec.ts Updates breadcrumb expectations and router mocks to reflect the full breadcrumb URL.
core-web/libs/global-store/src/lib/features/breadcrumb/breadcrumb.feature.ts Expands dedupe to the whole trail and uses untracked() inside the nav effect to avoid loops.
core-web/libs/global-store/src/lib/features/breadcrumb/breadcrumb.feature.spec.ts Updates expectations and adds a truncation test for full-trail dedupe behavior.
core-web/libs/global-store/src/lib/features/breadcrumb/breadcrumb.utils.ts Refines the contentEdit replace-last-crumb regex to exclude /edit-page/content routes.
core-web/libs/global-store/src/lib/features/breadcrumb/breadcrumb.utils.spec.ts Updates test to ensure /edit-page/content?... no longer triggers the content-edit replace rule.

adrianjm-dotCMS and others added 3 commits April 28, 2026 15:20
…and explicit leading slash in router.navigate

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… UVE page rule

- Updated breadcrumb logic to handle cases where the same ID has a different URL, allowing for in-place updates.
- Introduced a new rule for UVE pages to replace the last breadcrumb when navigating between different pages, ensuring a cleaner breadcrumb trail.

This improves user navigation and maintains a more accurate breadcrumb history.
…justments

- Modified test cases to reflect changes in breadcrumb behavior when the same ID has a different URL.
- Updated expectations to ensure accurate validation of breadcrumb labels and URLs.
- Enhanced utility function to correctly identify when to replace the last breadcrumb based on URL patterns.

These changes improve the accuracy of breadcrumb navigation and ensure tests align with the updated logic.
Comment thread core-web/libs/global-store/src/lib/features/breadcrumb/breadcrumb.utils.spec.ts Outdated
Comment thread core-web/libs/global-store/src/lib/features/breadcrumb/breadcrumb.utils.ts Outdated
- Fix test title that contradicted its assertion (uvePage rule keeps returning true for /edit-page/content routes)
- Update contentEdit comment example from /content?filter=... to /content/{inode}?tab=... since filter URLs belong to the contentFilter ROUTE_HANDLER

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dotCMS dotCMS deleted a comment from Adrianjm1 Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Safe To Rollback Area : Frontend PR changes Angular/TypeScript frontend code

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

New edit content experience not launched from UVE for content types that should use the new edit content

3 participants