feat(edit-content): related-content navigation via agnostic EditContentHost (#36349)#36491
feat(edit-content): related-content navigation via agnostic EditContentHost (#36349)#36491adrianjm-dotCMS wants to merge 10 commits into
Conversation
…ntHost (#36349) Restore navigating between related content in the new Edit Contentlet: clicking a related content's title opens it and a "Relating content" breadcrumb tracks the trail (grows/trims, click to go back, unsaved-changes prompt preserved). Makes the editor presentation-agnostic via an `EditContentHost` port so the same editor works full-screen and inside a dialog (and, later, a side panel) with no `isDialogMode` conditionals: - `RouterEditContentHost` (full-screen): identity from the route, router navigation, document title + shell breadcrumb, URL-driven trail (`rc` param). - `DialogEditContentHost` (dialog): identity from the dialog config, in-place reloads, in-memory trail, save result reported to the opener via `saved$`. Identity (`resolveIdentity`), navigation (related content, crumbs, locale switch, post-save/restore), the save result (`reportSaved`) and title/breadcrumb all go through the host; `isDialogMode` is removed entirely. Related-content navigation now also works from within a dialog (in-place reload). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Claude finished @adrianjm-dotCMS's task in 9m 56s —— View job Code Review — PR #36349
This is a clean, well-abstracted refactor. The New Issues
Notes (non-blocking)
Verdict: 🟢 approve-worthy pending the two Medium items (both plausibly by-design). No 🔴/🟠 found. |
…36349) Update stale JSDoc/comments that still described the old "dialog mode vs route mode" branching: the nav store now holds a URL-or-in-memory trail and does not navigate (the host does), and workflow/layout comments reflect host delegation. Comment-only; no behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ath (#36349) Resolve the two behavioral findings from the PR review plus the smaller ones: - Dialog "Keep editing" no longer leaves a stale breadcrumb: the in-place trail is now emitted with the reload request and committed by the layout (host.setTrail) ONLY after the unsaved-changes check passes, instead of being written up-front. - The dialog no longer blanks a full-screen editor's breadcrumb behind it: the in-memory trail moved off the root nav store onto a per-instance signal on DialogEditContentHost. The nav store is URL-only again; the host owns its trail (host.trail) and the layout reads that. - Guard the `rc` query param against a repeated-param string[] before .split. - Rename layout `relatedNavItems` → `$relatedNavItems` (signal convention). - Explicit `: void` on relationship-field `openRelated`. Tests: cover the in-place reload dirty-guard (clean/keep-editing/discard/locale), the breadcrumb `command` branch, RouterEditContentHost.resolveIdentity route walk, and DialogEditContentHost identity/saved$/deferred-trail. edit-content suite green (107 suites), lint + typecheck clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tent dialog - Adjusted CSS classes for error and loading states in the edit content dialog to enhance layout consistency. - Updated test specifications for `DotEditContentLayoutComponent` to improve readability and maintainability. - Enhanced `DotRelatedContentNavigationStore` to persist title cache in sessionStorage, ensuring titles are retained across page refreshes. - Added tests for title cache persistence and hydration to ensure reliability in various scenarios. These changes collectively improve the user experience and maintainability of the edit content features.
…tentHost (#36349) The overlay host backs any overlay presentation (dialog or side panel), not just the dialog, so the name now reflects that. Pure rename — class, file, and references; no behavior change. edit-content suite green, lint + typecheck clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…dge cases (#36349) Two related-content breadcrumb fixes: - Locale switch to an untranslated locale left the content without an inode, so clicking a related content did nothing. Now navigation seeds the trail origin with the version we came from (new `translationSourceInode` state), falling back to a fresh trail when there is none. - In an overlay (dialog/side panel), saving mints a new inode but the overlay host did not repoint its in-memory trail, so a title change never showed in the breadcrumb. OverlayEditContentHost.goToSavedContent now repoints the current crumb to the saved inode — mirroring RouterEditContentHost's `rc` update. edit-content suite green (107 suites), lint + typecheck clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ontent-breadcrumb-navigation
…ontent and router-edit-content host specs
…ttps://github.com/dotCMS/core into issue-36349-related-content-breadcrumb-navigation
Proposed Changes
Restores navigating between related content in the new Edit Contentlet and, to enable it cleanly, makes the editor presentation-agnostic.
Fixes #36349
Related-content navigation (the feature)
rcquery param) and inside a dialog (in-place reload, in-memory trail).Agnostic editor via
EditContentHost(the mechanism)The editor and its store no longer branch on
isDialogMode— that conditional is removed entirely. Everything presentation-specific goes through an injectedEditContentHostport:RouterEditContentHost(full-screen)DialogEditContentHost(dialog)saved$The shell provides the router host; the dialog component provides the dialog host. Adding a new presentation (e.g. side panel) is then just a new adapter + a thin host wrapper — no editor changes.
How to test
Full-screen (
/content/:id): open a content with a relationship field → click a related content's title → it opens with the "Relating content" banner → click a crumb to go back. Verify locale switch, version restore, and post-save navigation still work; and that unsaved changes prompt.Dialog (UVE or "create new related content"): edit/create content in the dialog → click a related content in a relationship field → the editor reloads in place within the dialog with the breadcrumb → go back via a crumb → save reports back to the opener.
Checklist
pnpm nx test edit-content— 107 suites green🤖 Generated with Claude Code