Preview Modal — Preview of the block in the modal
PreviewModal is a common modal for all Wave-2 settings screens that shows the result of the block's operation in real time. It opens with the "Open in modal" button on the settings screens.
Why is this needed
When you are configuring a block (strategy, filters, audience), you want to immediately understand which products will appear in the output with such settings. PreviewModal allows you to check this without publishing the block on the site and without switching between the admin panel and the front end.
Tab Basic — Product list
The first tab is Basic. It shows a table of products that the API will return with the current block settings:
- Loading is done via infinite scroll through the
NewBlockPreviewTablecomponent. - The table displays previews of cards (name, image, marker, brief metadata).
- The list updates automatically when the block settings change on the parent screen.
Tab Investigate — Diagnostics
The second tab, Investigate, is for debugging. Here you can see what happened "under the hood" during the output generation:
| Field | Meaning |
|---|---|
| appliedAudienceRule | Which audience rule was triggered for the current request. See Audience Filter. |
| warnings | Diagnostics — for example, "the attribute set is empty," "fallback selected products not from the chosen category." |
| fallbackUsed | Flag: whether the fallback path (backup display of trending products) was triggered. |
| contextEcho | Echo of the request context — what the system actually received (user ID, cart, selected categories, etc.). |
If the backend did not return a certain field, the corresponding section in Investigate is simply hidden, without errors. This is done for smooth API development.
Simulated user ID — Preview "on behalf of" the user
Under the Preview field, there is an input for Simulated user ID. Enter the ID of any user — the preview will build the result as if the request came from them. This is useful for:
- Checking personal recommendations (Personal recommendations, Repeat purchase) for a specific client;
- Reproducing a complaint like "I have the wrong products in the block" — enter their ID and see what they would see.
Without specifying a Simulated user ID, the preview uses your own admin context, and for personalized blocks, the output may be empty or irrelevant.
Access right blocks.preview
Access to the admin endpoint for the block preview is controlled by a separate right blocks.preview in the permissions tree.
This allows:
- Granting a role that edits blocks without access to the preview (for example, for content managers with "form-only" access).
- Hiding sensitive data from some admins that may be revealed through Investigate (request context, echo of parameters).
For developers and QA — always provide blocks.preview. For content managers — only if they need to see the actual output of the block before publication.