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

Modern Color Scheme: Update to match wp-admin #92399

Closed
wants to merge 7 commits into from

Conversation

chad1008
Copy link
Contributor

@chad1008 chad1008 commented Jul 4, 2024

Part of 7884-gh-Automattic/dotcom-forge

Proposed Changes

Updates the Modern color scheme to address discrepancies from wp-admin, for a more consistent user experience.

Why are these changes being made?

An issue recently highlighted some disconnects that have developed between our unified/redesigned sidebars and the wp-admin styles for various color schemes. This PR is addresses those for the Modern color scheme.

Note

Because the schemes depend on the variables provided by client/my-sites/sidebar/style.scss, this PR is branched off of #92397.

If any changes are recommended for client/my-sites/sidebar/style.scss, please leave a note on that PR instead of this one, so I can make changes there, and then rebase the individual scheme PRs.

Testing Instructions

Important Some items have received changes to their code that won't be reflected visually, because the only change was renaming a variable. That means comparing to production/trunk can be misleading, because a changed sidebar might look just like production, but the change is still needed for the new variables in the sidebar styles to work.

Instead of direct production/trunk comparisons of a link like (for example) My Sites under Hosting, focus on comparing the behavior of the types of links you're looking at. When My Sites on the Hosting sidebar is the currently selected menu item, it should behave the same way and have the same color/hover effect as, for example All Posts under Posts, when it's selected... basically, when testing this one, avoid asking:

Does this sidebar on local calypso look different than it does on production?

Instead, ask:

Does this currently selected sidebar item on local calypso match currently selected submenu items in wp-admin?

There are three views we care about:

  • Calypso sidebar
  • My Home/Hosting sidebar
  • wp-admin (the control that we're updating schemes to match again)
  1. Select a simple site and make sure you have the "default" view (i.e. Calypso) selected
  2. In a separate tab, select an Atomic site. If you haven't already done so previously, select Tools > Hosting for your Atomic site and activate hosting settings. If this site was already atomic, you should already see the Hosting sidebar item. This should open /home/[site-url], where you'll find a Calypso interface with the Hosting section open to the My Home submenu item
  3. Under Settings > General, choose the wp-admin/classic interface for your Atomic site
  4. In a third tab, select the same Atomic site. Open any wp-admin page. This tab isn't changing, but we'll want it open to visually compare the other two tabs to so we can make sure they match.
  5. Activate the Modern color scheme for your site
  6. In your Calypso sidebar tab (from step 1) and your My Home/Hosting sidebar tab (from step 2), confirm that the following items match your wp-admin tab (from step 3):
    6.1. Unfocused text and background colors for menu items and submenu items
    6.2. Unfocused text and background colors in the flyout when hovering over an expandable item like "Posts"
    6.3. Unfocused text and background colors in the in-sidebar submenu when an expandable item is selected
    6.4. Unfocused text and background colors for the currently selected items (e.g. Posts) and submenu items (e.g. All Posts)
    6.5. Hover text and background colors for menu items and submenu items
    6.6. Hover text and background colors in the flyout when hovering over an expandable item like "Posts"
    6.7. Hover text and background colors in the in-sidebar submenu when an expandable item is selected
    6.8. Hover text and background colors for the currently selected items (e.g. Posts) and submenu items (e.g. All Posts)
    6.9. The "Collapse Menu" link, both unfocused and hovered

The hover states of a currently selected submenu item like "All Posts" and the "Collapse Menu" link were where I found the most nuance/variation from one scheme to the next.

@chad1008 chad1008 self-assigned this Jul 4, 2024
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Jul 4, 2024
@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.

@matticbot
Copy link
Contributor

matticbot commented Jul 4, 2024

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

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

  • blaze-dashboard
  • command-palette-wp-admin
  • editing-toolkit
  • happy-blocks
  • help-center
  • notifications
  • odyssey-stats
  • whats-new
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug chad1008/fix-modern-color-scheme on your sandbox.

@nightnei
Copy link
Contributor

nightnei commented Jul 5, 2024

@chad1008

In a third tab, select Tools > Hosting for your Atomic site. This should open /home/[site-url], where you'll find a Calypso interface with the Hosting section open to the My Home submenu item

Hm, I dont see Tools > Hosting
Screenshot 2024-07-05 at 11 50 58

@nightnei
Copy link
Contributor

nightnei commented Jul 5, 2024

In a separate tab, select an Atomic site. Under Settings > General, choose the wp-admin/classic interaface. Open any wp-admin page.

Hm, I didn't get why do we need to do Open any wp-admin page?

@nightnei
Copy link
Contributor

nightnei commented Jul 5, 2024

Activate the Modern color scheme for your site

Sorry 😅 I didn't get - should I activate it for both simple and atomic websites?

UPDATE Oh, the theme activates not for the site, but for account, so it's common configuration

@nightnei
Copy link
Contributor

nightnei commented Jul 5, 2024

Also, I was a bit confused - I have 3 tabs and initially it was hard to understand - which 2 of them is necessary for testing.

In both of your Calypso-based tabs, confirm that the following match wp-admin

Actually, I am still not sure that I understand what necessary to be tested 😅
So, I have the first tab with simple website (default / calypso view) and I have second tab with Atomic website (default / wp-admin view). So what does it mean the following match wp-admin? Should I just compare two mentioned above tabs?

@nightnei
Copy link
Contributor

nightnei commented Jul 5, 2024

Also, it would be very helpful if you provide some screenshots, to understand what to expect and to understand what is the specific block. To make sure that I am testing right thing.

Copy link
Contributor

@nightnei nightnei left a comment

Choose a reason for hiding this comment

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

LGTM and confirm that styles now synced between Calypso and wp-admin 👍

5.1 Unfocused text and background colors for menu items and submenu items:
Screenshot 2024-07-05 at 12 22 17
Screenshot 2024-07-05 at 12 22 28

5.2 Unfocused text and background colors in the flyout when hovering over an expandable item like "Posts"
Screenshot 2024-07-05 at 12 23 36
Screenshot 2024-07-05 at 12 23 48

5.3. Unfocused text and background colors in the in-sidebar submenu when an expandable item is selected
5.4. Unfocused text and background colors for the currently selected items (e.g. Posts) and submenu items (e.g. All Posts)
Screenshot 2024-07-05 at 12 31 08
Screenshot 2024-07-05 at 12 31 16

5.5. Hover text and background colors for menu items and submenu items
Screenshot 2024-07-05 at 12 32 01
Screenshot 2024-07-05 at 12 32 14
Screenshot 2024-07-05 at 12 32 50
Screenshot 2024-07-05 at 12 32 39

5.6. Hover text and background colors in the flyout when hovering over an expandable item like "Posts"
Screenshot 2024-07-05 at 12 33 06
Screenshot 2024-07-05 at 12 33 16

5.7. Hover text and background colors in the in-sidebar submenu when an expandable item is selected
Screenshot 2024-07-05 at 12 33 51
Screenshot 2024-07-05 at 12 33 59

5.8. Hover text and background colors for the currently selected items (e.g. Posts) and submenu items (e.g. All Posts)
Screenshot 2024-07-05 at 12 34 13
Screenshot 2024-07-05 at 12 34 23

5.9. The "Collapse Menu" link, both unfocused and hovered
Screenshot 2024-07-05 at 12 34 33
Screenshot 2024-07-05 at 12 34 42
Screenshot 2024-07-05 at 12 34 51
Screenshot 2024-07-05 at 12 35 00

@chad1008
Copy link
Contributor Author

chad1008 commented Jul 5, 2024

In a third tab, select Tools > Hosting for your Atomic site. This should open /home/[site-url], where you'll find a Calypso interface with the Hosting section open to the My Home submenu item

My mistake, thanks @nightnei. I was going off of my own site which I made atomic for these tests, and I still needed to activate the hosting settings to actually make it go atomic. Your site, I'm guessing, is already atomic, so you'll just want to hit the "Hosting" sidebar item that is probably already present. I've updated the testing instructions.

Hm, I didn't get why do we need to do Open any wp-admin page?

The wp-admin page is just for comparison, so we can confirm that the other two calypso-based views match visually. So you're testing the Calypso sidebar on something like Pages or Posts, in one tab, and the Nav Redesign sidebar (your atomic site with the Hosting menu item selected). As you test, you'll compare both of those tabs to the wp-admin tab.

Copy link
Contributor

@fredrikekelund fredrikekelund left a comment

Choose a reason for hiding this comment

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

Kudos for tackling this – it'll be a nice paper cut fix 👍

I left a comment to clarify whether we need both --color-sidebar-submenu-selected-hover-text and --color-navredesign-sidebar-submenu-selected-hover-text, or if we can do with just one.

I also noticed that the WordPress icon in the master bar doesn't have the same background color as the sidebar and the master bar. That's seems like something we should fix while we're at it.

Calypso: Modern theme Calypso: Classic dark theme wp-admin: Modern theme
Screenshot 2024-07-08 at 11 27 27 Screenshot 2024-07-08 at 11 28 24 Screenshot 2024-07-08 at 11 28 34

@@ -178,6 +179,7 @@ Uses custom theme highlight monochromatic palette for primary + accent
--color-navredesign-sidebar-menu-selected-text: var(--theme-text-color);
--color-navredesign-sidebar-submenu-selected-text: var(--theme-text-color);
--color-navredesign-sidebar-submenu-hover-text: #33f078; /* $menu-submenu-focus-text */
--color-navredesign-sidebar-submenu-selected-hover-text: var(--color-sidebar-submenu-hover-text);
Copy link
Contributor

Choose a reason for hiding this comment

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

The distinction between --color-sidebar-submenu-selected-hover-text and --color-navredesign-sidebar-submenu-selected-hover-text is a little confusing.

I looked up the code history and found that the Nav Redesign variables were introduced in #90193. It's a little difficult to tell if adding those new variables was necessary or convenient… Knowing that might help inform us if we should add a single variable, or if adding both makes more sense.

Because all the CSS vars in the L632-L655 block in client/my-sites/sidebar/style.scss use the --color-navredesign prefix, I can see why you'd want to stick to that convention, @chad1008, but when there's no difference between --color-sidebar-submenu-selected-hover-text and --color-navredesign-sidebar-submenu-selected-hover-text, that does add some confusion.

@chad1008, what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

cc @nightnei here as well in case you have any insight from reviewing the other PRs

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 little difficult to tell if adding those new variables was necessary or convenient

I had the same thoughts

but when there's no difference between --color-sidebar-submenu-selected-hover-text and --color-navredesign-sidebar-submenu-selected-hover-text, that does add some confusion.

I had the same concern, but after thinking about it more - I made a decision that it's indeed very good idea to use an extra variable. I will try to express my thoughts: as you mentioned above - there are two different prefixes to distinguish styles, and if we reuse some variable - we would start mixing them, what is not good in case if we do some clean up or refactoring. Also it's potential issue for regression. I don't know, whether I managed to be clear... 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

@okmttdhr 👋 We're looking for some background on why you added new CSS variables with the --color-navredesign prefix in #90193. We're wondering whether we should continue adding more variables like that, and, if so, how to decide which ones are nav redesign variables and which ones are not.

Copy link
Member

@okmttdhr okmttdhr Jul 9, 2024

Choose a reason for hiding this comment

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

I used navredesign prefix since it was part of Nav Redesign project: pfsHM7-Ao-p2.
However, the naming was not ideal badge. The more context is available in this issue: https://github.com/Automattic/dotcom-forge/issues/7766 along with the related links. Does this make sense?

Copy link
Contributor

Choose a reason for hiding this comment

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

So, basically to clarify which changes were introduced as part of Nav Redesign?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can see why you'd want to stick to that convention, @chad1008, but when there's no difference between --color-sidebar-submenu-selected-hover-text and --color-navredesign-sidebar-submenu-selected-hover-text, that does add some confusion.

Oh, it's definitely confusing! 😅

My rationale for using the navredesign variables is that those appear to be the ones that impact the Hosting/My Home view we're updating, while the "normal" variables without that prefix target the rest of Calypso, at least in practice for the items I've been working on.

This is part of what made this a more confusing process to update (and test, thanks again @nightnei!). The "Hosting/My Home" menu is basically a "Calypso in wp-admin" menu, because it's the one set of Calypso screens we still serve when a site owner has wp-admin set as their preferred interface. That separate menu, it turns out, has its own separate variables! yay!

I really like the issue @okmttdhr shared above. It would be great to standardize and simplify these variables across the different places they're being used.

Copy link
Member

@okmttdhr okmttdhr Jul 10, 2024

Choose a reason for hiding this comment

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

My rationale for using the navredesign variables is that those appear to be the ones that impact the Hosting/My Home view we're updating, while the "normal" variables without that prefix target the rest of Calypso, at least in practice for the items I've been working on.

This makes sense to me!

Because all the CSS vars in the L632-L655 block in client/my-sites/sidebar/style.scss use the --color-navredesign prefix, I can see why you'd want to stick to that convention, @chad1008, but when there's no difference between --color-sidebar-submenu-selected-hover-text and --color-navredesign-sidebar-submenu-selected-hover-text, that does add some confusion.

Something to consider is that if a value is used in a totally different UI, it will get more difficult to update it later.
The idea behind having a new prefix is for safety reasons; Nav Unification and Nav Redesign have different ideas about the color schema.
I agree that these things might increase complexity, so I think it would be ideal to redesign the naming conventions, taking into account where they are used and so on.
As stated in the Issue: https://github.com/Automattic/dotcom-forge/issues/7766, I believe that many "prefixed variables" could be retired by introducing Core color schemes as possible to their original specifications.

CCing: @fushar just in case... 🙏

Copy link
Contributor

Choose a reason for hiding this comment

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

My rationale for using the navredesign variables is that those appear to be the ones that impact the Hosting/My Home view we're updating

Thanks for the clarification 👍

For reference, https://github.com/Automattic/dotcom-forge/issues/7884 has more details on the Hosting/My Home definition.

I still don't fully understand why we need separate variables to style those elements, but it makes sense to me to follow the existing convention and potentially address this in the future.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi all! Thanks @okmttdhr for the ping. Yeah, we add the new navredesign variables specifically for the "Hosting" Calypso pages. We did that because the rest of Calypso (nav-unification) pages don't seem to match Core for some reason, and we don't want to break them in the context of Untangling project.

What is the goal of the PRs? Are we just fixing the "Hosting" pages or also the rest of Calypso pages, to match with the wp-admin scheme? Or also "fixing" all Calypso pages?

@@ -166,6 +166,7 @@ Uses custom theme highlight monochromatic palette for primary + accent
--color-sidebar-menu-hover-text: var(--theme-text-color);

/* Sidebar Hover - Nav unification */
--color-sidebar-submenu-selected-hover-text: var(--color-sidebar-submenu-hover-text);
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's move this below --color-sidebar-submenu-hover-text

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea. I'm applying this change to other schemes that will benefit of it as well.

@fredrikekelund
Copy link
Contributor

@chad1008, WDYT about the background color for the WordPress icon in the master bar? See my previous comment for details

@chad1008
Copy link
Contributor Author

Ironically @fredrikekelund, i typed this message earlier and apparently neglected to hit send. I'd just noticed that when I saw your more recent question.

I also noticed that the WordPress icon in the master bar doesn't have the same background color as the sidebar and the master bar. That's seems like something we should fix while we're at it.

This question got lost in the shuffle at first, sorry @fredrikekelund.

I did a bit of digging and it looks like this is outside of the color schemes themselves. That button is getting an is-active class that is changing the background color. The class is coming from two checks that appear to be consistently both returning true on desktop.

I need to explore a little further to see if that's expected, but I'm thinking this might be better fixed in a separate PR, since it's outside of the actual color schemes. Thoughts?

Either way, @alshakero I know it was a couple of years back that you worked on this section of the codebase, but do you have any recollection/insight as to what the desired styling/active state is for the WordPress logo/"My Sites" button on desktop browsers? It looks/feels to me like it's "active" more than it should be, but I'm curious about what you might recall 😄

@fredrikekelund
Copy link
Contributor

I need to explore a little further to see if that's expected, but I'm thinking this might be better fixed in a separate PR, since it's outside of the actual color schemes

If that's the case, then I agree. Let's land these 👍

@chad1008
Copy link
Contributor Author

Merged and deployed with #92397

@chad1008 chad1008 closed this Jul 12, 2024
@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 Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants