Skip to content

HC: minor refactor and remove contact-form navigation#101898

Merged
heavyweight merged 9 commits intotrunkfrom
fix/hc-routing-to-contact-form
Mar 28, 2025
Merged

HC: minor refactor and remove contact-form navigation#101898
heavyweight merged 9 commits intotrunkfrom
fix/hc-routing-to-contact-form

Conversation

@escapemanuele
Copy link
Contributor

@escapemanuele escapemanuele commented Mar 26, 2025

Related to p1742409982270769-slack-C07D72S1135

Before After
Screenshot 2025-03-26 at 17 37 49 Screenshot 2025-03-26 at 17 37 21

Remove leftover redirects to contact-form.
Users creating chat from there will result in anonymous zd users using the Zendesk widget.

Proposed Changes

  • Avoid navigating to contact-form.
  • Improve how contact-options are displayed.
  • Provide code util for support interactions
  • Avoid re-creating direct chats, when current interaction holds an active zd chat.

Why are these changes being made?

  • To improve the user experience and codebase.

Testing Instructions

  • Checkout and build this PR.

Testing Plan Downgrade Direct chat

  • Using a site with premium plan go to /plans/{ site_slug }.
  • Click on the downgrade button for the Personal plan. Direct chat should be created with the initial message User wants to downgrade plan and the relevant siteSlug.

Testing current chat guard

  • While still on the plans page. Write something in the zd chat.
  • Close the help center and click the same downgrade button again.
  • The same chat should be displayed isntead of a new one created.
  • You can test this same thing on other places where we have direct chat.

Testing fallback to contact-options

  • In case direct chat can't be created we now fallback to this route
  • You can test this by provoking the fallback patch or manually doing:
setNavigateToRoute( '/contact-options' );
setShowHelpCenter( true );
  • The contact options should display and behave properly.

Quick regression test

  • The PR touches some parts related to support interactions. Try to see if those can break anything.

@github-actions
Copy link

github-actions bot commented Mar 26, 2025

@matticbot
Copy link
Contributor

matticbot commented Mar 26, 2025

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

Sections (~47 bytes removed 📉 [gzipped])

Details
name                      parsed_size           gzip_size
plugins                        -152 B  (-0.0%)      -47 B  (-0.0%)
plans                          -152 B  (-0.0%)      -47 B  (-0.0%)
jetpack-app                    -152 B  (-0.0%)      -47 B  (-0.0%)
async-step-unified-plans       -152 B  (-0.0%)      -47 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.

Async-loaded Components (~49 bytes added 📈 [gzipped])

Details
name                                             parsed_size           gzip_size
async-load-signup-steps-plans-theme-preselected       -152 B  (-0.0%)      -47 B  (-0.0%)
async-load-signup-steps-plans                         -152 B  (-0.0%)      -47 B  (-0.0%)
async-load-automattic-help-center-stepper              +14 B  (+0.0%)      +96 B  (+0.0%)
async-load-automattic-help-center                      +14 B  (+0.0%)      +96 B  (+0.0%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

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.

@matticbot
Copy link
Contributor

matticbot commented Mar 26, 2025

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • blaze-dashboard
  • help-center
  • notifications
  • odyssey-stats
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/hc-routing-to-contact-form on your sandbox.

@heavyweight heavyweight changed the title HC: Avoid creating new chats when there is active one in the current … HC: minor refactor and remove contact-form navigation Mar 26, 2025
@heavyweight heavyweight marked this pull request as ready for review March 26, 2025 16:42
@heavyweight heavyweight requested a review from a team as a code owner March 26, 2025 16:42
@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 Mar 26, 2025
@agrullon95 agrullon95 self-requested a review March 26, 2025 20:09
@agrullon95
Copy link
Contributor

Remove leftover redirects to contact-form
Avoid navigating to contact-form.

You're only removing contact-form redirections for CHAT mode in this PR, correct?

Testing Plan Downgrade Direct chat & current chat guard

The first time I clicked the downgrade button, I ran into the init() smooch issue, which broke the page and led to a blank page. I refreshed, tried again, and confirmed that a new conversation was initiated. I closed the help center, clicked the downgrade button, and was redirected to the same chat. 👍

Testing fallback to contact-options

The contact options are working correctly,
"Continue your open conversation" - Redirects to my last conversation
"Chat with support" - Opens a new conversation.

Can we update the margin/padding on the spinner when the contact options are loading

CleanShot.2025-03-27.at.09.20.44.mp4

@heavyweight
Copy link
Contributor

Remove leftover redirects to contact-form
Avoid navigating to contact-form.

You're only removing contact-form redirections for CHAT mode in this PR, correct?

Testing Plan Downgrade Direct chat & current chat guard

The first time I clicked the downgrade button, I ran into the init() smooch issue, which broke the page and led to a blank page. I refreshed, tried again, and confirmed that a new conversation was initiated. I closed the help center, clicked the downgrade button, and was redirected to the same chat. 👍

Testing fallback to contact-options

The contact options are working correctly, "Continue your open conversation" - Redirects to my last conversation "Chat with support" - Opens a new conversation.

Can we update the margin/padding on the spinner when the contact options are loading

CleanShot.2025-03-27.at.09.20.44.mp4

I updated the spacing for the spinner.
I'm unable to reproduce the init issue. Let me know if you can find a way to trigger it consistently.

@agrullon95
Copy link
Contributor

We should also disable the input field while loading the support interaction.

Copy link
Member

@alshakero alshakero left a comment

Choose a reason for hiding this comment

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

Code looks good. I tested all the places except migration error as I couldn't reach that code. I'm pretty sure it works great too.

@heavyweight heavyweight merged commit 9a5dbd1 into trunk Mar 28, 2025
13 checks passed
@heavyweight heavyweight deleted the fix/hc-routing-to-contact-form branch March 28, 2025 14:09
@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 Mar 28, 2025
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.

5 participants

Comments