-
Notifications
You must be signed in to change notification settings - Fork 2k
Move help-center managing code into the dashboard #105120
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
base: trunk
Are you sure you want to change the base?
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~69426 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~89924 bytes removed 📉 [gzipped])
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 (~7362 bytes added 📈 [gzipped])
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. Generated by performance advisor bot at iscalypsofastyet.com. |
62c99cb
to
5f83833
Compare
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
@@ -0,0 +1,10 @@ | |||
import HelpCenter from '@automattic/help-center'; // eslint-disable-line no-restricted-imports |
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.
What if we move these rules directly to our .eslintrc
? I found it pretty weird that only HC import restrictions are being inlined in the components 🤔
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.
Since I'm happily importing from this package perhaps we should just allow it in the linter. But I'm not super happy that we allow it tbh 😅 Looking at what the help center depends on, it pulls in a bunch of calypso and onboarding code. Things we wouldn't normally want to include in HD. I would say that we to port the help center over to using core components.
But given that the help center is embedded in wp-admin, I guess that means it must be fairly portable right?
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.
My concern about adding it to the .eslintrc might send the unintended message that it's fine to import it as-is when it should be done asynchronously.
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've allowed allowed @automattic/help-center
in the eslint config—but not @automattic/data-stores
.
The help center data store isn't actually that bad to use. It's how we're able to share state between HD and wp-admin/gutenberg for example, making it feel like "one product". So I think that's ok.
The issue with @automattic/data-stores
though is that there are stores we really don't want folks to use. All the site/domain/user/onboarding related stores, we want people to use React Query instead.
My concern about adding it to the .eslintrc might send the unintended message that it's fine to import it as-is when it should be done asynchronously.
This is true, but I don't think many people will be tempted to load the help-center package directly. The one they'll be most tempted to use is data-stores
(since that's how they show hide the help center). That's the one where we want to direct them to use the app/help-center
hook instead.
@@ -0,0 +1 @@ | |||
@import '@automattic/calypso-color-schemes/root-only'; |
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.
Question: What was missing from the HC when this file was not imported?
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.
Interesting question, I didn't even try that.
For the HD use case, if there was a way to force it to use the default color scheme that would actually be better 😮
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.
Short story is that most everything works pretty well. It is mostly just missing some colours.

The help content itself looks no different without the scss, except for the table of contents at the top

This popup menu in live chat is busted without the scss

But I bet that menu could be improved so that it doesn't have a hard dependency on the scss file.
So it looks like the scss file is more than just for Calypso colour schemes and actually contains real component styling info.
The package readme says that root-only
is just for getting the CSS variables defined at :root
.

Makes sense.
Part of DOTDASH-242
Proposed Changes
setSubject
andsetNavigateToRoute
methods available in the dashboard tooReact.lazy
rather than Calypso'sAsyncLoad
Why are these changes being made?
The DOTDASH-241 task needs access to more help center methods than just show/hide. It also needs the ability to set the search terms within the help center. That was the impetus to rearranging the hook so that it would async load the data store, regardless of what method was used first.
It also removes some dependency on the calypso client code. The
client/component/help-center
code is a pretty thin wrapper around the@automattic/
packages. So I figured it was better to just depend on the packages directly.Testing Instructions
The two existing ways the help center is currently accessed in the HD should work just as they used to.
The help button in the top-right works just as it did before. Clicking the button toggles the help center.
CleanShot.2025-08-08.at.13.58.02.mp4
When the help center is currently open and you create a new site with AI, the help center is closed. I don't know why this is exactly, but I'm guessing it is to prevent the help center from being auto opened when you sand in the big sky environment.
CleanShot.2025-08-08.at.13.58.58.mp4
Pre-merge Checklist