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

Update help center icon #91130

Merged
merged 8 commits into from
May 28, 2024
Merged

Update help center icon #91130

merged 8 commits into from
May 28, 2024

Conversation

Addison-Stavlo
Copy link
Contributor

@Addison-Stavlo Addison-Stavlo commented May 24, 2024

Related to # Automattic/dotcom-forge#7185

Proposed Changes

  • Update the SVGs used for help center to match the icon we use for it in the global sidebar.
  • Updates the icon component used by the global nav sidebar to the consolidated HelpIcon component that also leverages the notification indicator state.

AFTER

Calypso masterbar
Screenshot 2024-05-24 at 3 33 54 PM

with notif:
Screenshot 2024-05-24 at 3 53 16 PM

Editor
Screenshot 2024-05-24 at 3 32 51 PM

Wp-admin
Screenshot 2024-05-24 at 3 34 17 PM

wp-admin classic
Screenshot 2024-05-24 at 3 46 43 PM

Why are these changes being made?

  • We started by updating the icon in the global nav previously, and are now working to make this consistent across the wpcom experience.

Testing Instructions

Calypso global nav:

  • Visit calypso masterbar on this branch. Verify there are no changes to the icon. This should look the same, but we changed the underlying component so it is worth a check.

Calypso masterbar:

  • Run this branch and visit calypso my home and ensure the help center icon is updated to match that of the global nav.
    • With notification: I wasn't entirely sure how to trigger this to occur so I tested by changing this condition locally to be true. From there you can see the with notif version of the icon appear in the calypso masterbar.

Editor and wp-admin

  • install install-plugin.sh $pluginSlug update/help-center-icon on your sandbox
  • sandbox widgets.wp.com and a test site url
  • visit the editor and wp-admin and verify the new icon is present and help center works as expected.

Atomic

  • find the calypso apps build job in the checks at the bottom of this PR and follow that link.
  • in TC, goto the 'artificats' tab and download the .zip build artifact for editing toolkit.
  • install this plugin on an atomic site. Deactivate the old version of ETK and activate this version.
  • Verify the help center icon is changed and helpcenter works as expected.

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-aUh-p2)?

@matticbot
Copy link
Contributor

matticbot commented May 24, 2024

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

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

  • editing-toolkit

To test WordPress.com changes, run install-plugin.sh $pluginSlug update/help-center-icon on your sandbox.

@matticbot
Copy link
Contributor

matticbot commented May 24, 2024

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

Sections (~21 bytes added 📈 [gzipped])

name                               parsed_size           gzip_size
woocommerce-installation                 +46 B  (+0.0%)      +21 B  (+0.0%)
woocommerce                              +46 B  (+0.0%)      +21 B  (+0.0%)
themes                                   +46 B  (+0.0%)      +21 B  (+0.0%)
theme                                    +46 B  (+0.0%)      +21 B  (+0.0%)
subscribers                              +46 B  (+0.0%)      +21 B  (+0.0%)
stats                                    +46 B  (+0.0%)      +21 B  (+0.0%)
sites-dashboard                          +46 B  (+0.0%)      +21 B  (+0.0%)
site-purchases                           +46 B  (+0.0%)      +21 B  (+0.0%)
site-monitoring                          +46 B  (+0.0%)      +21 B  (+0.0%)
site-blocks                              +46 B  (+0.0%)      +21 B  (+0.0%)
settings-writing                         +46 B  (+0.0%)      +21 B  (+0.0%)
settings-security                        +46 B  (+0.0%)      +21 B  (+0.0%)
settings-reading                         +46 B  (+0.0%)      +21 B  (+0.0%)
settings-podcast                         +46 B  (+0.0%)      +21 B  (+0.0%)
settings-performance                     +46 B  (+0.0%)      +21 B  (+0.0%)
settings-newsletter                      +46 B  (+0.0%)      +21 B  (+0.0%)
settings-jetpack                         +46 B  (+0.0%)      +21 B  (+0.0%)
settings-discussion                      +46 B  (+0.0%)      +21 B  (+0.0%)
settings                                 +46 B  (+0.0%)      +21 B  (+0.0%)
security                                 +46 B  (+0.0%)      +21 B  (+0.0%)
scan                                     +46 B  (+0.0%)      +21 B  (+0.0%)
purchases                                +46 B  (+0.0%)      +21 B  (+0.0%)
promote-post-i2                          +46 B  (+0.0%)      +21 B  (+0.0%)
privacy                                  +46 B  (+0.0%)      +21 B  (+0.0%)
preview                                  +46 B  (+0.0%)      +21 B  (+0.0%)
posts-custom                             +46 B  (+0.0%)      +21 B  (+0.0%)
posts                                    +46 B  (+0.0%)      +21 B  (+0.0%)
plugins                                  +46 B  (+0.0%)      +21 B  (+0.0%)
plans                                    +46 B  (+0.0%)      +21 B  (+0.0%)
people                                   +46 B  (+0.0%)      +21 B  (+0.0%)
pages                                    +46 B  (+0.0%)      +21 B  (+0.0%)
notification-settings                    +46 B  (+0.0%)      +21 B  (+0.0%)
migrate                                  +46 B  (+0.0%)      +21 B  (+0.0%)
media                                    +46 B  (+0.0%)      +21 B  (+0.0%)
me                                       +46 B  (+0.0%)      +21 B  (+0.0%)
marketplace                              +46 B  (+0.0%)      +21 B  (+0.0%)
marketing                                +46 B  (+0.0%)      +21 B  (+0.0%)
jetpack-social                           +46 B  (+0.0%)      +21 B  (+0.0%)
jetpack-search                           +46 B  (+0.0%)      +21 B  (+0.0%)
jetpack-connect                          +46 B  (+0.0%)      +21 B  (+0.0%)
jetpack-cloud-settings                   +46 B  (+0.0%)      +21 B  (+0.0%)
jetpack-cloud-pricing                    +46 B  (+0.0%)      +21 B  (+0.0%)
jetpack-cloud-plugin-management          +46 B  (+0.0%)      +21 B  (+0.0%)
jetpack-cloud-overview                   +46 B  (+0.0%)      +21 B  (+0.0%)
jetpack-cloud-features-comparison        +46 B  (+0.0%)      +21 B  (+0.0%)
jetpack-cloud                            +46 B  (+0.0%)      +21 B  (+0.0%)
import                                   +46 B  (+0.0%)      +21 B  (+0.0%)
hosting                                  +46 B  (+0.0%)      +21 B  (+0.0%)
home                                     +46 B  (+0.0%)      +21 B  (+0.0%)
help                                     +46 B  (+0.0%)      +21 B  (+0.0%)
gutenberg-editor                         +46 B  (+0.0%)      +21 B  (+0.0%)
google-my-business                       +46 B  (+0.0%)      +21 B  (+0.0%)
github-deployments                       +46 B  (+0.0%)      +21 B  (+0.0%)
export                                   +46 B  (+0.0%)      +21 B  (+0.0%)
email                                    +46 B  (+0.0%)      +21 B  (+0.0%)
earn                                     +46 B  (+0.0%)      +21 B  (+0.0%)
domains                                  +46 B  (+0.0%)      +21 B  (+0.0%)
developer                                +46 B  (+0.0%)      +21 B  (+0.0%)
dev-tools                                +46 B  (+0.0%)      +21 B  (+0.0%)
customize                                +46 B  (+0.0%)      +21 B  (+0.0%)
concierge                                +46 B  (+0.0%)      +21 B  (+0.0%)
comments                                 +46 B  (+0.0%)      +21 B  (+0.0%)
checkout                                 +46 B  (+0.0%)      +21 B  (+0.0%)
backup                                   +46 B  (+0.0%)      +21 B  (+0.0%)
add-ons                                  +46 B  (+0.0%)      +21 B  (+0.0%)
activity                                 +46 B  (+0.0%)      +21 B  (+0.0%)
account-close                            +46 B  (+0.0%)      +21 B  (+0.0%)
account                                  +46 B  (+0.0%)      +21 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 (~2125 bytes added 📈 [gzipped])

name                                           parsed_size             gzip_size
async-load-menu-items-help-center-help-center     +20189 B  (+304.5%)    +5850 B  (+201.4%)
async-load-masterbar-help-center                    +516 B    (+1.9%)     +412 B    (+4.9%)
async-load-automattic-help-center                   +516 B    (+0.1%)     +433 B    (+0.2%)
async-load-calypso-reader-sidebar                    +46 B    (+0.0%)      +21 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.

@Addison-Stavlo Addison-Stavlo self-assigned this May 24, 2024
@Addison-Stavlo Addison-Stavlo marked this pull request as ready for review May 24, 2024 19:51
@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 May 24, 2024
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.

Tested Calypso, the Editor, and wp-admin. All work. Left one comment about the stroke.

fill="var( --color-masterbar-unread-dot-background )"
stroke="#101517"
strokeWidth="2"
stroke="white"
Copy link
Member

@alshakero alshakero May 24, 2024

Choose a reason for hiding this comment

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

This makes the notification circle stroked with white, not transparent. Since the icon is rendered against dark backgrounds.

image

This SVG cuts the big circle around the smaller circle.

<svg
					className="help-center__icon-has-new-items"
					ref={ ref }
					width="24"
					height="24"
					viewBox="0 0 24 24"
					fill="none"
					xmlns="http://www.w3.org/2000/svg"
				>
					<path
						d="M19.1328,10.7051c0.0832,0.4607,0.1246,0.9356,0.1161,1.4214c-0.0699,4.0034-3.372,7.1922-7.3754,7.1224
	c-4.0035-0.0699-7.1922-3.372-7.1224-7.3754C4.821,7.87,8.1231,4.6812,12.1265,4.7511c0.9278,0.0162,1.8086,0.2125,2.6185,0.5444
	c0.192-0.4829,0.4729-0.9163,0.8257-1.2848c-1.0456-0.4679-2.2002-0.7381-3.418-0.7594c-4.8318-0.0843-8.817,3.7642-8.9014,8.596
	c-0.0843,4.8317,3.7642,8.817,8.596,8.9014c4.8317,0.0843,8.817-3.7642,8.9014-8.596c0.0119-0.6831-0.0626-1.3463-0.1996-1.9869
	C20.1223,10.4297,19.6452,10.6169,19.1328,10.7051z"
					/>
					<rect x="11.1606" y="15.1716" width="1.5557" height="1.5557" />
					<path
						d="M12.7163,13.2702c2.4199-0.605,3.1113-3.8027,1.1235-5.3584S9,7.8254,9,10.3317h1.5557
	c0-0.8643,0.6914-1.5557,1.5557-1.5557c1.9014,0,2.0742,2.7656,0.1729,3.0249c-0.4321,0-0.9507,0.4321-0.9507,1.0371v1.2964h1.5557
	v-0.8643H12.7163z"
					/>
					<circle cx="18.5" cy="6.5" r="3" fill="var( --color-masterbar-unread-dot-background )" />
				</svg>

Copy link
Contributor

Choose a reason for hiding this comment

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

It's a bit tricky to detect what the stroke color should be, we cannot rely on --color-masterbar since it would be inaccurate in the Editor and the Global Sidebar. And having stroke color being dependent on different vars contextually seems fragile.

@lucasmendes-design could we have a variant for the help center and notification icons where the top right corner is "carved out"? Much like we have for the cart icon:

Screenshot 2024-05-27 at 2 53 19 PM

Copy link
Member

Choose a reason for hiding this comment

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

@taipeicoder yes exactly. The SVG I share above is carved out.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice @alshakero, how did you get that SVG? 🙂

Copy link
Member

Choose a reason for hiding this comment

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

I made it using Illustrator.

Copy link
Contributor Author

@Addison-Stavlo Addison-Stavlo May 28, 2024

Choose a reason for hiding this comment

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

This makes the notification circle stroked with white, not transparent.

Yes, I assumed the circle around it was supposed to be white given this is what @lucasmendes-design shared as the svg on the linked issue (maybe it stands out more if you have dark mode on):

Screenshot 2024-05-28 at 2 02 47 PM

Carving out a the circle like you did with illustrator would definitely be a more fitting approach if we actually don't want that white ring.

Copy link
Contributor Author

@Addison-Stavlo Addison-Stavlo May 28, 2024

Choose a reason for hiding this comment

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

Im realizing that with light mode / dark mode, it was probably shared with light mode and that white circle was likely an oversight.

We may want to go with @alshakero's version.

Copy link
Contributor

@taipeicoder taipeicoder left a comment

Choose a reason for hiding this comment

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

Tested and works as intended 👍

@taipeicoder taipeicoder merged commit 0c15412 into trunk May 28, 2024
12 checks passed
@taipeicoder taipeicoder deleted the update/help-center-icon branch May 28, 2024 01:49
@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 May 28, 2024
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