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

Launchpad: Update tasks to redirect into site-editor edit mode #72339

Merged
merged 4 commits into from
Jan 20, 2023

Conversation

agrullon95
Copy link
Contributor

@agrullon95 agrullon95 commented Jan 19, 2023

Estimated Time to Test / Review:

Test -> Short
Review -> Short

Proposed Changes

The latest Gutenburg site editor changes will open the sidebar by default when users navigate to /site-editor/{siteSlug}. This may be confusing for users as we try to direct them towards the template/content editing view.

  • These changes add "canvas=edit" query parameter to the site editor route to navigate directly into "edit" mode (Prevents the sidebar navigation from displaying first)

Testing Instructions

  • Checkout this branch
  • Create new free / link-in-bio site (/setup/free/ or /setup/link-in-bio/) or use existing site
  • Navigate to free flow launchpad screen and select the Edit site design task. Confirm it navigates directly into site-editor edit mode.
  • Navigate to link-in-bio flow launchpad screen (you can use the same site slug) and select the Add links task. Confirm it navigates directly into site-editor edit mode.
  • Create a videopress site (/setup/videopress) and click the Upload your first video task. Confirm that it navigates into site-editor edit mode.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests 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)?

Related to #72019

@agrullon95 agrullon95 self-assigned this Jan 19, 2023
@github-actions
Copy link

github-actions bot commented Jan 19, 2023

@matticbot
Copy link
Contributor

matticbot commented Jan 19, 2023

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~10 bytes added 📈 [gzipped])

name              parsed_size           gzip_size
gutenberg-editor        +14 B  (+0.0%)      +10 B  (+0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@agrullon95 agrullon95 changed the title Launchpad: Update tasks to redirect into site-editor edit mode DRAFT: Launchpad: Update tasks to redirect into site-editor edit mode Jan 19, 2023
@agrullon95 agrullon95 requested a review from a team January 19, 2023 16:43
@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 Jan 19, 2023
@agrullon95 agrullon95 changed the title DRAFT: Launchpad: Update tasks to redirect into site-editor edit mode Launchpad: Update tasks to redirect into site-editor edit mode Jan 19, 2023
@agrullon95
Copy link
Contributor Author

cc: @roundhill & @jgcaruso - I added a minor change related to the videopress flow. Can you review these changes?

@@ -811,6 +812,7 @@ const mapStateToProps = (
...pressThisData,
answer_prompt: getQueryArg( window.location.href, 'answer_prompt' ),
completedFlow,
...( canvasEditMode && { canvas: canvasEditMode } ),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should simply assign this at all times. We don't want to be sending people into the template selection mode at all, ever.

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems sensible to me. But one concern is that changes goes well beyond our current use case and seems to change the calypso site editor handling/display for all cases. That seems like a big change, and I I wonder if that warrants wider discussion beyond our team?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm in agreement with Matt here. We don't want to surface this to our users by default in any entry the way it is right now. But we may be able to in the future after core has iterated on its development.

With that it's important to leave a clear comment that we are doing this.

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems sensible to me. But one concern is that changes goes well beyond our current use case and seems to change the calypso site editor handling/display for all cases. That seems like a big change, and I I wonder if that warrants wider discussion beyond our team?

To me the big change was in Gutenberg that started exposing this to our users by default. It is still being iterated on, but is currently not in a place that is good for us to expose by default to our users on dotcom.

We relayed some of this feedback to core in this p2: p9Jlb4-6ad-p2#comment-6657, expressed desire to be able to bypass this, and were soon after notified that a change had been implemented that would allow us to do so.

We also reached out to team-calypso in slack to make them aware of this change, and present them the option to handle it on their end since they generally handle things around the gutenberg upgrade cycles. They responded that they would be happy for us to handle this, which we are happy to do 😁 p1673663392570019/1673546040.780839-slack-C7YPUHBB2

@edanzer
Copy link
Contributor

edanzer commented Jan 19, 2023

This tests well for me.

  • Free Flow > Edit Site goes to full screen editor (and query arg is present in url)
  • Link in Bio > Add Links goes to full screen editor (and query arg is present in url)
  • VideoPress - Best I can tell this behavior has not changed. The Upload Video link goes to the page editor. The query param is not present there. I see we have a fallback to go to the side editor with query param, but that is not triggered. I assume this is the expected behavior.

Code changes also look good and straightforward.

@jgcaruso
Copy link
Contributor

  • VideoPress - Best I can tell this behavior has not changed. The Upload Video link goes to the page editor. The query param is not present there. I see we have a fallback to go to the side editor with query param, but that is not triggered. I assume this is the expected behavior.

Correct, the site editor link is just a fallback for an extreme case where the Home page id can't be found. Not actually testable without modifying the code to force it into the fallback condition... which I did to test this and the new query param whether there or not seems fine to me.

@agrullon95
Copy link
Contributor Author

@jgcaruso - I reverted the changes since we will just default to edit mode when navigating to the site editor. Thanks for testing.

@sharpirate
Copy link
Contributor

This tests well for me:
✔️ For Free Flow -> Goes directly to the edit screen of the Site Editor
✔️ For Link in Bio -> Goes directly to the edit screen of the Site Editor
✔️ For VideoPress -> Goes to the page editor

@mattwiebe mattwiebe self-requested a review January 20, 2023 15:01
@agrullon95 agrullon95 merged commit 00b4232 into trunk Jan 20, 2023
@agrullon95 agrullon95 deleted the add/launchpad-site-editor-canvas-edit-mode branch January 20, 2023 18:36
@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 Jan 20, 2023
autumnfjeld pushed a commit that referenced this pull request Jan 23, 2023
* Pass site-editor canvas mode query param to iframe

* Update launchpad site-editor navigation

* Default to site editor "edit-mode"

* Revert site editor route changes
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.

7 participants