#10822 Auto preview cannot skip browser-only failures#10824
Conversation
ba60d98 to
db2495f
Compare
Probes are answered from the server's network view, but some liveview widgets only learn whether they can render once their document probes from the browser. Widgets that declare verdict:true in their probe data are now framed behind the loading mask; the mask drops on an ok liveview-render-verdict (or a 6s fail-open timeout) and a failed verdict advances auto mode to the next candidate without the widget ever becoming visible. Explicit selection keeps the widget's own failure UI, as does auto mode when no other candidate remains. The failed set resets when the content selection changes. Widgets that promise nothing reveal on load as before. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
bda9a40 to
566e77f
Compare
| ViewExtensionEvent.on(this.handleExtensionEvent.bind(this)); | ||
| EmulatedDeviceEvent.listen(this.handleEmulatorEvent.bind(this)); | ||
| IframeEventBus.get().onEvent(RENDER_STATUS_EVENT, (event) => { | ||
| // the bus delivers the parsed message detail, not an IframeEvent |
There was a problem hiding this comment.
It does inflate it as long as you register the class with IframeEventBus.get().registerClass('EventName', EventClass), but it's the legacy approach and the DTO is preferred.
There was a problem hiding this comment.
This is just a demo - how to workaround CSP.
Feel free to implement it the way you like it
| this.renderedExtension = extension; | ||
| this.renderedInAutoMode = isAuto; |
There was a problem hiding this comment.
Both of these are available to the widget and therefore can be sent from the iframe wrapper in the RenderStatusData event instead of creating extra fields here.
| this.clearVerdictWait(true); | ||
| return; | ||
| } | ||
| if (!this.renderedInAutoMode || !this.renderedExtension) { |
There was a problem hiding this comment.
Add those to RenderStatusData event returned from the iframe wrapper
| private renderedExtension: Extension; | ||
|
|
||
| private renderedInAutoMode: boolean = false; |
There was a problem hiding this comment.
Used to carry info between async events and should be added to the event itself.
| }).finally(() => { | ||
| deferred.resolve(isRenderable); | ||
| if (isRenderable !== wasRenderable) { | ||
| this.notifyRenderableChanged(isRenderable, wasRenderable); |
There was a problem hiding this comment.
All the listeners are still notified if the page is renderable the old way, paying no attention to new verdict.
Closes #10822
The widget probe is synchronous and answered from the server's network view, but some liveview widgets (e.g. the same-origin wrapper in enonic/app-liveview-iframe#22) only learn whether they can render once their document probes from the browser. This adds the verdict half of that contract to
ExtensionRenderingHandler:verdict: truein its probe'senonic-widget-data→ Content Studio frames it but keeps the loading mask up.liveview-render-verdict({ok, contentId, url}, IframeEventBus envelope): ok reveals the preview; not ok marks the widget failed for the current content and auto mode re-renders the remaining candidates behind the mask — no widget flash.Companion: enonic/app-liveview-iframe#22 (wrapper + verdict emission). Independent of #10788 — works with or without the CSP adoption branch;
tscand eslint clean.🤖 Generated with Claude Code