Skip to content
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

Track canvas mode changes in the Site Editor #81335

Merged
merged 2 commits into from
Sep 4, 2023

Conversation

okmttdhr
Copy link
Member

@okmttdhr okmttdhr commented Sep 4, 2023

Related to https://github.com/Automattic/dotcom-forge/issues/3301

Proposed Changes

I added the sidebar click events on the Site Editor in #80953. This PR tracks events when the "canvas" is clicked, as well as navigation clicks. This is because users can start editing without clicking on the navigation, and we want to track that point.

Alternatives I did not go for

  • Intercept the redux action; This cannot be done with the current implementation since setCanvasMode is private API and unlock function override JS object somehow.
  • addEventListener to the DOM (.edit-site-layout__canvas-container); This might not be exactly the same as canvas mode changes.

Testing Instructions

e52dd3f431c383e3467fc7dd5b58ab46

Screen Shot 2023-09-04 at 10 43 40
  • Patch this PR to your sandbox with cd apps/wpcom-block-editor/ && yarn dev --sync
  • Sandbox widgets.wp.com and your site
  • Go to the Site Editor
  • See if events fire with Automattic/tracks-chrome-extension

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • https://wpcalypso.wordpress.com/devdocs/docs/testing/index.md for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-ajp-p2)?

@github-actions
Copy link

github-actions bot commented Sep 4, 2023

@matticbot
Copy link
Contributor

This PR modifies the release build for wpcom-block-editor

To test your changes on WordPress.com, run install-plugin.sh wpcom-block-editor add/site-editor-track-canvas-mode on your sandbox.

To deploy your changes after merging, see the documentation: PCYsg-l4k-p2

@matticbot
Copy link
Contributor

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.

@okmttdhr okmttdhr marked this pull request as ready for review September 4, 2023 01:50
@okmttdhr okmttdhr requested a review from a team September 4, 2023 02:07
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 4, 2023
@okmttdhr okmttdhr self-assigned this Sep 4, 2023
@okmttdhr okmttdhr force-pushed the add/site-editor-track-canvas-mode branch from 6aae601 to 205fb2d Compare September 4, 2023 04:11
@okmttdhr okmttdhr force-pushed the add/site-editor-track-canvas-mode branch from 205fb2d to cd1c44a Compare September 4, 2023 04:11
@okmttdhr okmttdhr requested a review from a team September 4, 2023 04:12
@matticbot
Copy link
Contributor

This PR modifies the release build for editing-toolkit

To test your changes on WordPress.com, run install-plugin.sh editing-toolkit add/site-editor-track-canvas-mode on your sandbox.

To deploy your changes after merging, see the documentation: PCYsg-mMA-p2

Copy link
Contributor

@arthur791004 arthur791004 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@okmttdhr okmttdhr merged commit 93a8628 into trunk Sep 4, 2023
5 checks passed
@okmttdhr okmttdhr deleted the add/site-editor-track-canvas-mode branch September 4, 2023 05:47
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants