Skip to content

Components rendering errors are not displayed in the PCV #10675#10792

Open
ashklianko wants to merge 2 commits into
masterfrom
issue-10675
Open

Components rendering errors are not displayed in the PCV #10675#10792
ashklianko wants to merge 2 commits into
masterfrom
issue-10675

Conversation

@ashklianko

@ashklianko ashklianko commented Jun 10, 2026

Copy link
Copy Markdown
Member

Summary

Components that fail to render in the live edit are now marked as invalid in the v6 page components tree, so a broken part/layout/fragment is visible in the outline even though it does not affect form validity.

What changed

  • LiveEditPageProxy reads the render-error snapshot from the page editor protocol's ready message (errorPaths) and forwards the paths via PageEventsManager.notifyPageRenderErrors.
  • The page editor bridge stores them in a dedicated $renderErrorComponentPaths fact store; PageComponentsView merges them into each node's visual invalid flag.
  • Incremental tracking supplements the snapshot: component-loaded clears a mark, component-load-failed adds one.
  • Render-error marks are cleared on page reload and on component add/remove/move.
  • Bumped @enonic/page-editor to 2.0.0-beta.1 (modules/lib and modules/app), which introduces the ready.errorPaths payload.

Why / how it works

editor posts ready{errorPaths} -> LiveEditPageProxy -> PageEventsManager.notifyPageRenderErrors -> bridge -> $renderErrorComponentPaths -> PageComponentsView -> OctagonAlert on the node

The marker reuses the existing invalid visual but is kept separate from form validation: render errors are a real render failure, so they show regardless of validation visibility and never feed $invalidComponentPaths / setWizardFormValidation.

Notable findings / decisions

  • Positional paths drift. Node ids are positional (/main/0). The error set is a snapshot taken at render time; add/remove/move shift sibling indices, and most edits are partial reloads (no fresh snapshot), so the marks would stick to the wrong position. A full positional remap would duplicate the tree's index-shift logic (especially for move) at notable risk, and is overkill for an edge case. We clear the marks on structural changes instead; they are re-reported on the next full render. Move is covered because it fires both component-removed and component-added; config updates do not shift positions and are left untouched.
  • The wire contract carries only error paths, not full component records. The host already owns the page model; the editor reports just the DOM-derived render-error state. See Report component render errors in the LiveEdit ready event #85 npm-page-editor#86.

Closes #10675

Requires @enonic/page-editor >= 2.0.0-beta.1 (enonic/npm-page-editor#86)

Drafted with AI assistance

@edloidas

Copy link
Copy Markdown
Member

I think we will postpone with this a bit and with page editor part, as there will be massive rework of the PE itself and how it works, that would require more changes to these PRs.

@ashklianko ashklianko marked this pull request as draft June 15, 2026 12:08
@ashklianko

Copy link
Copy Markdown
Member Author

Switching to draft then

ashklianko and others added 2 commits July 8, 2026 00:43
Removed debug log and trimmed redundant comments per review.
Added incremental render-error tracking via onComponentLoaded / onComponentLoadFailed to supplement the ready snapshot on partial reloads.

Components rendering errors are not displayed in the PCV #10675

- Marked components that failed the live edit render as invalid in the v6 page components tree
- Sourced render-error paths from LiveEditPageViewReadyEvent component data via the page editor bridge
- Cleared render-error marks on component add/remove/move and on page reload
Sourced the initial render-error snapshot from the ready message errorPaths payload in LiveEditPageProxy.
Removed the dead LiveEditPageViewReadyEvent.getComponents() accessor and LiveEditComponentRecord type.
Bumped @enonic/page-editor to 2.0.0-beta.1.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@edloidas edloidas marked this pull request as ready for review July 8, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Components rendering errors are not displayed in the PCV

3 participants