UVE: the copy-decision fork path rebuilds editorSelected.payload from a partial source
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Problem Statement
Follow-up from #37499 / PR #37546, raised in review there.
#37499 fixed one instance of a pattern: applyBoundsForSelection() rebuilt editorSelected.payload from a source that could not carry all of it, silently dropping vtlFiles, contentlet.baseType, onNumberOfPages and dotStyleProperties. That one now merges instead of replacing.
The fork path still does the wholesale replace. dot-uve-copy-decision.component.ts:116:
const activeContentlet = this.#uveStore.getPageSavePayload({
container,
contentlet: newContentletPayload
});
// ...
this.#uveStore.setSelectedPayload(activeContentlet); // :125
The payload is built from {container, contentlet} only, so after a fork the selection loses the same four fields. Its own comment at :121-124 then relies on pageReload re-emitting SET_BOUNDS to re-anchor — but a merge can only preserve what is already there, so once the fork has replaced the payload the data is gone until the user re-clicks the contentlet.
No user-visible symptom today, which is why this was filed rather than folded into PR #37546:
- the VTL menu now reads the hovered contentlet, not the selection
#buildFormreadsdotStylePropertiesfrom the page asset viaextractFromRollback(dot-uve-style-editor-form.component.ts:197), not from the payload
It is the remaining occurrence of the pattern #37499 set out to remove. The next consumer that reads one of those fields off editorSelected.payload without its own workaround will rediscover it.
Steps to Reproduce
- Open a page in UVE with a contentlet that renders a VTL file via
#dotParseand appears on more than one page. - Select it and trigger the copy/fork decision (edit a contentlet used on multiple pages, choose to edit only this one).
- Inspect
editorSelected.payloadafter the fork.
Expected: vtlFiles, contentlet.baseType, onNumberOfPages and dotStyleProperties are still present.
Actual: all four are gone until the contentlet is clicked again.
Acceptance Criteria
- The fork path preserves DOM-sourced contentlet data on the selected payload, the same way
applyBoundsForSelection()now does. - Store-sourced page context (
pageContainers,container.contentletsId,language_id,pageId,personaTag) still refreshes — a freeze would make add/delete write a stale container tree, which is why #37499 merges rather than freezes. - A spec covers it, in the same shape as the
payload merge on re-anchorblock inwithSelectionAnchor.spec.ts. - The comment at
dot-uve-copy-decision.component.ts:121-124is corrected — it currently claims the re-anchor recovers the data, which a merge cannot do.
dotCMS Version
Latest from main, after PR #37546 merges.
Severity
Low - Minor issue or cosmetic
Links
- Origin: #37499, PR #37546 (review thread)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in dot-uve-copy-decision.component.ts around lines 116-125 and compare the fork path with applyBoundsForSelection(). Read the “payload merge on re-anchor” block in withSelectionAnchor.spec.ts, then verify the fork preserves the four DOM-sourced fields while refreshing the listed page context and that the comment at lines 121-124 is accurate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100