-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Site Editor Tracking: Add events for selecting content items in the navigation sidebar #54385
Site Editor Tracking: Add events for selecting content items in the navigation sidebar #54385
Conversation
Link to Calypso live: https://calypso.live?image=registry.a8c.com/calypso/app:build-10118 |
This PR modifies the release build for wpcom-block-editor To test your changes on WordPress.com, run To deploy your changes after merging, see the documentation: PCYsg-l4k-p2 |
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
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 is looking good so far and tests are working well. just a couple comments.
item_type: type, | ||
item_slug: slug, |
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.
It seems when we select a 'category' page we just get item_slug
with the category name and no item_type
.
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.
We don't have that information from the args. 😢 Used a selector to check the active menu. Type is determined based on that in this case.
// TODO: Change this to 1 once https://github.com/WordPress/gutenberg/pull/33286 fix is deployed | ||
assert.strictEqual( editEvents.length, 2 ); |
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.
Another idea might be to debounce the function that sends the event with a very small time window so only 1 event sends. Although, this double-dispatch should definitely be fixed anyways and will solve this problem.
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.
Anyone planning to run e2e tests, make sure to comment this line:
Latest Gutenberg version introduced a regression, showing the snackbar below the inserter, which prevents us from clicking on the notice to dismiss it. |
This PR modifies the release build for notifications To test your changes on WordPress.com, run To deploy your changes after merging, see the documentation: PCYsg-elI-p2 |
This PR modifies the release build for editing-toolkit To test your changes on WordPress.com, run To deploy your changes after merging, see the documentation: PCYsg-mMA-p2 |
Is it expected that
The rest of this may be totally expected but I haven't been following the stats work so I had some questions about expected behaviour. Since I was debugging on Basically what happens is that, after the page is selected, Gutenberg repaints its editor canvas with the blocks of the selected page. This winds up callind |
Nope! Fixed it. Though it's quite hacky 😬
This is a known issue 😞 We have a workaround for reusable blocks and template parts. But we found out this problem comes up with many other blocks that includes/loads inner blocks. |
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 the fixes, this looks good and tests properly 🚢
Changes proposed in this Pull Request
wpcom_block_editor_nav_sidebar_item_edit
item_type
- type of the selected item (page, post, category, etc.)item_slug
- slug of the selected itemNote
setPage
is called twice due to a bug in Gutenberg: WordPress/gutenberg#33286Testing instructions
Make sure E2E tests are passing.
Related to #