New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fix element thumbnail visual issues #3329
Conversation
Hey @neatbyte-vnobis - I don't think we want to add the font definitions into the Can we explore another potential approach. Instead of generating thumbnails, can we render the block content directly inside the preview container. Similarly how the page preview is rendered in the drawer, would that be possbile? |
Did a quick POC for @neatbyte-vnobis here, let's see how far we get. |
e6b4680
to
ee17355
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Starting the review with a couple of quick comments.
Additional questions below.
1. Image issue
Adding an image works:
But when saving, I get this error:
Wondering if simply pulling in all changes from next
would resolve this issue? 🤔
2. Still using image?
Also, shouldn't this modal also be rendering the block, instead of displaying its sshot? Did I miss smt here? 🤔
packages/app-page-builder/src/pageEditor/config/blockEditing/BlockPreview.tsx
Outdated
Show resolved
Hide resolved
packages/app-page-builder/src/pageEditor/config/blockEditing/EditBlockDialog.tsx
Outdated
Show resolved
Hide resolved
packages/app-page-builder/src/editor/plugins/elementSettings/save/SaveDialog/domToImage.ts
Outdated
Show resolved
Hide resolved
About this one But I want to say that I was having the same issue as this one when I was working on Dynamic Images (Dynamic Pages). |
packages/app-page-builder/src/pageEditor/config/blockEditing/EditBlockDialog.tsx
Outdated
Show resolved
Hide resolved
packages/app-page-builder/src/editor/plugins/elementSettings/save/SaveDialog/domToImage.ts
Outdated
Show resolved
Hide resolved
packages/app-page-builder/src/blockEditor/config/eventActions/saveBlock/getPreviewImage.ts
Outdated
Show resolved
Hide resolved
...meta, | ||
private: true | ||
} | ||
formData.preview = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this on the backend? 🤔
I think not, maybe I'm wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This question still remains.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we don't. But I need to spend a little bit more time on this question
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adrians5j I have removed preview
form the API, as we no longer need it
packages/app-page-builder/src/admin/components/EditorPluginsLoader.tsx
Outdated
Show resolved
Hide resolved
@@ -46,6 +45,9 @@ const BlockPreview: React.FC<BlockPreviewProps> = props => { | |||
{onDelete && ( | |||
<Styled.DeleteBlock> | |||
<ConfirmationDialog | |||
// We need to have this z-index because without it Delete Block Dialog will be rendered below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please recheck this grammar. I think the dot after the rendered below
is a mistake?
Sorry for the nitpick, but yeah, we're OSS, and companies tend to check our code sometimes before making their decision. I know this is just a drop in the sea, but yeah, gotta start somewhere. :)
width: 600, | ||
minWidth: 600 | ||
const StyledDialog = styled(Dialog)` | ||
// We need to have this z-index because without it Edit Block Dialog will be rendered below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment re grammar.
...meta, | ||
private: true | ||
} | ||
formData.preview = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This question still remains.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will check it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. We just need to revisit this question.
@adrians5j l've checked whether we need to save webiny-js/packages/app-page-builder/src/editor/plugins/elementSettings/save/SaveAction.tsx Line 66 in f5370b5
|
@adrians5j I've removed |
7e4518b
to
5a49afc
Compare
/cypress |
Cypress E2E tests have been initiated (for more information, click here). ✨ |
Cypress E2E tests have been initiated (for more information, click here). ✨ |
Cypress E2E tests have been initiated (for more information, click here). ✨ |
@@ -632,8 +632,7 @@ export type PbEditorBlockPlugin = Plugin & { | |||
blockCategory: string; | |||
tags: string[]; | |||
create(): PbEditorElement; | |||
image?: Partial<File>; | |||
preview?(): ReactElement; | |||
preview(): ReactElement; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this still here? 🤔
Changes
Fix issue "Block Thumbnail visual issues"
How Has This Been Tested?
Manual
Documentation
None