fix(edit-content): open related content in a side panel from the full-screen editor - #37415
Merged
Conversation
…-screen editor
Clicking a related content in a Relationship field navigated away from the
editor, discarding its unsaved form — the only place a relation created from
that field exists, since nothing persists it at creation time. The
unsaved-changes guard correctly intervened, which left the user choosing
between losing that relation and not opening the content at all. A flow users
are directed into ("create the related content here, then go look at it") could
not be completed.
From the full-screen editor, related content now opens in a side panel over it:
the editor stays mounted, nothing is discarded, and closing the panel returns to
it untouched. From inside a panel, navigation is unchanged — it reloads in place
and keeps its crumb trail, so no second panel is stacked. The decision is
positional (`#opensInSidePanel`), not based on form or item state: two stateful
rules were built and rejected in review because the same click behaved
differently for invisible reasons, losing the trail and breadcrumb.
Editing a related content in the panel now refreshes its row, matched by
identifier so the field's value is unchanged and the refresh cannot dirty the
form by itself.
Also fixes a second, pre-existing defect found while verifying: a contentlet
returned by a workflow action carries only `languageId`, not the language object
the Locales column formats, so a row for content just created from the field
showed a blank locale until the parent was saved. Both paths that put a
just-saved contentlet in the table now resolve the language from the editor's
already-loaded locales, by id, with no extra request.
Test-first was NOT followed here (Constitution Principle V): the implementation
preceded the tests. Each behavioral assertion was afterwards confirmed to fail
against unfixed code by neutering the production helpers, which shows the
assertions are load-bearing but is not Red-before-Green. Disclosed rather than
presented as compliance.
Spec, plan and tasks live in specs/37385-relationship-nav-unsaved/; only spec.md
is tracked, per the repo's Spec-Kit gitignore rules. Implementation ships in this
same PR by developer decision, instead of the usual spec-PR-first flow.
Refs #37385
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
9 tasks
Contributor
|
Claude finished @adrianjm-dotCMS's task in 2m 16s —— View job SDK Compatibility Check
Result: No SDK breaking change detected. This PR only touches
None of these touch a surface any
This falls squarely under the doc's non-breaking calibration example: an admin-UI ( |
`#refreshRelatedItem` went through the store's `setData`, which resets pagination to page 1 and flags the change as a user edit. Editing a related content that sits on page 2 or later and saving it therefore snapped the table back to page 1, losing the user's place — with a page size of 6, that starts at seven related items. Replace it with a dedicated `refreshItem` on the store, mirroring `reorderData`, which exists for the same reason: it replaces one item in place, matched by identifier (stable across saves, unlike the inode), keeps the current page, and marks the change as `'load'` so it can never dirty the form. The relationship itself did not change — only the version of one entry. The old path did not dirty the form either, but only incidentally: the field's value is a list of identifiers, which the refresh leaves untouched, so the computed never emitted. That would have broken silently the moment the value included anything else. Refs #37385 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
fmontes
approved these changes
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #37385.
The problem
Creating content from a Relationship field and then clicking it raised the "unsaved changes" dialog. Navigating away unmounts the editor, and the relation to the content you just created lives only in that unsaved form — so the guard was right to warn, and the user was left choosing between losing the relation and not opening the content.
The fix
From the full-screen editor, related content now opens in a side panel instead of navigating. The editor stays mounted, so nothing is lost and there is nothing to warn about; closing the panel returns to it untouched.
From inside a panel, nothing changes — it navigates in place and keeps its crumb trail, so no second panel is stacked.
The rule is positional, not based on form or item state, so the same click always behaves the same way in the same place.
Editing a related content in the panel also refreshes its row (title, status), keeping the current page and without dirtying the form.
Small extra, found while testing
A contentlet returned by a workflow action carries only
languageId, not the language object the Locales column formats — so a row for content just created from the field showed a blank locale until the parent was saved. Both paths that add a just-saved contentlet to the table now resolve the language from the editor's already-loaded locales, by id, with no extra request.Testing
Known gaps: no automated test proves the editor's form survives the panel round-trip (the spec proves no navigation is requested, which is indirect) — covered by the manual steps below. The hop that opens the panel leaves no crumb; a panel-header trail was scoped and deferred. Inside a panel the original prompt still appears, since that context does not stack.
How to test
This PR fixes: #37385