- Issue created by @lauriii
- Status changed to Postponed: needs info
4 months ago 11:20am 19 July 2024 - š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
Let's research how we could generate an accurate preview for components automatically.
Ever since āØ Allow specifying default props values when opting an SDC in for XB Fixed , we are guaranteed to have default values for every SDC prop.
Which means accurate previews are as trivial as rendering the component with those default values.
Which means the only thing that's missing is:
- making that markup available as part of the "components lists" response ā already the case ever since
š
Add component instance edit form to contextual panel
RTBC
:
ā¦ // A pre-rendered version of the component is provided so no requests // are needed when adding it to the layout. 'default_markup' => (string) $this->prepareRenderArray($component_plugin->getPluginId())['markup'], ā¦
- also loading the associated CSS/JS ā issue for that: š Load assets inside preview Active
IOW: AFAICT this can be worked on right now, I don't see what research is still needed? This component preview would simply be yet another
<iframe>
? - making that markup available as part of the "components lists" response ā already the case ever since
š
Add component instance edit form to contextual panel
RTBC
:
- Status changed to Active
4 months ago 11:22am 19 July 2024 - š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
AFAICT no back-end work is necessary here. To clarify #2:
- Loading a preview without CSS/JS ā has been possible for weeks now.
- Loading a preview with CSS/JS ā will become possible once š Load assets inside preview Active lands, and it's on the verge of landing!
- ā generating a full preview of a single SDC is as simple as sending a subset of the client-side layout+model to
\Drupal\experience_builder\Controller\SdcController::preview()
š
Since only front-end work remains, making š± [META] Early phase front-end work coordination Active the parent š
- š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
š Load assets inside preview Active is in now, so now it's definitely actionable.
Also finally updating the issue title, per:
This component preview would simply be yet another
<iframe>
, withuser-select: none;
to disallow interaction, rather than an image? š¤ - Assigned to bnjmnm
- šŗšøUnited States bnjmnm Ann Arbor, MI
Draft is pushed and in progress
I temporarily changed the styles of some sdcs so I could distinguish their background from the preview container backgroundThis already largely works, but I'm still refining the logic that determines how to scale the iframe contents so we can see the entire SDC without necessarily having to create a same-sized preview
- š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
Can you add a GIF showing the current state? š That gives the 4 people following this issue already a sense of where this is at š
- šŗšøUnited States bnjmnm Ann Arbor, MI
This is the current state. Components temporarily have loud BG colors to distinguish the component from BG
- šŗšøUnited States bnjmnm Ann Arbor, MI
The MR now works but still
- Needs Tests
- Cleanup leftover code from an approach I dropped in favor of something faster & simpler
- Assigned to hooroomoo
- Status changed to Needs review
4 months ago 4:10pm 31 July 2024 -
bnjmnm ā
committed e69b8399 on 0.x
Issue #3462636: Preview component when selecting in left sidebar
-
bnjmnm ā
committed e69b8399 on 0.x
- Status changed to Fixed
4 months ago 7:21pm 31 July 2024 - šŗšøUnited States bnjmnm Ann Arbor, MI
I got FE and BE signoffs, so here's yalls previews.
Committed. - Issue was unassigned.
Automatically closed - issue fixed for 2 weeks with no activity.