-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Fix up rich text editor initial selection and add blocks #35286
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
Conversation
Test Results SummaryCommit SHA: 134b32e
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
louwie17
left a comment
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 tested well, and code changes look good!
Before approving, I was wondering if we could hide the Upload button on the image and video blocks for now? Given they don't work yet (just like the image library).
Also I wonder if we should increase the spacing between the blocks a little bit? The plus icon does show up, but it is a rather fine line to be hovering over. It's also very hard to notice as it appears GB added a delay, and you have be hovering for close to a second.
|
@joshuatf there also appears to be two broken tests. |
|
One last issue I noticed, is that upon refresh the cursor is always active on the description field now, this feels a little odd. |
Good catch! I added an
Agreed. I'd opt for a follow-up on this if possible since that may require modifying the default block styling and open a new can of worms.
I posted about this somewhere, but this is an unfortunate side effect of Gutenberg's block selection. Selecting the block, which we need in order to show the toolbar, also causes Gutenberg to focus the input initially. We'll either need to open a PR in Gutenberg to address this or come up with a hacky workaround. I have a feeling we might need to do the latter, since this will cause a cascade of required changes in Gutenberg if we change how selection/focus works. |
| <ShortcutProvider> | ||
| <EditorWritingFlow /> | ||
| <EditorWritingFlow | ||
| blocks={ blocksRef.current } |
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.
I don't love passing this down as opposed to getting it from the store, but there's a delay initially when setting blocks in the store that causes the editor to think it's empty when it's not.
louwie17
left a comment
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.
Thanks for adding the media upload function, this seemed to test well.
Agreed. I'd opt for a follow-up on this if possible since that may require modifying the default block styling and open a new can of worms.
I am fine with a follow up on the spacing. I just wasn't sure if this is something we specifically set to being narrower, given on P2 it's quite a bit bigger.
I posted about this somewhere, but this is an unfortunate side effect of Gutenberg's block selection. Selecting the block, which we need in order to show the toolbar, also causes Gutenberg to focus the input initially.
We'll either need to open a PR in Gutenberg to address this or come up with a hacky workaround. I have a feeling we might need to do the latter, since this will cause a cascade of required changes in Gutenberg if we change how selection/focus works.
That's unfortunate, I wonder if we set an auto focus to the name field if that will fix it, as that would be a relatively simple fix, although there is a high likely hood that the GB editor triggers it after.
d6b93f5 to
134b32e
Compare
louwie17
left a comment
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.
LGTM 🚀 Thanks for the rebase.
|
Hi @joshuatf, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:
|
All Submissions:
Changes proposed in this Pull Request:
How to test the changes in this Pull Request:
Describe this product...)/and insert an image or video blockOther information:
pnpm changelog add --filter=<project>?FOR PR REVIEWER ONLY: