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

Force no site selection on /theme and /themes #87463

Merged
merged 5 commits into from
Feb 21, 2024

Conversation

xavier-lc
Copy link
Contributor

@xavier-lc xavier-lc commented Feb 14, 2024

After deploying #87000, I noticed that the left side navigation appeared different on production (showing a selected site) than it did on local/PR preview (showing "All sites"), as you can see on the screenshot:

Screenshot from 2024-02-15 10-51-53

Proposed Changes

On prod, CurrentSite has a selectedSite object, whereas on local it's null, and the selectedSite prop comes from state.ui.selectedSiteId, so this PR attempts to fix that by setting the selected site to null with the noSite middleware.

Testing Instructions

  1. Using an account that has more than one site, go to the PR preview link, and then to /themes?flags=-layout/dotcom-nav-redesign
  2. Check that you see "All sites" at the top of the left side navigation:

image

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • https://wpcalypso.wordpress.com/devdocs/docs/testing/index.md 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)?

Copy link

github-actions bot commented Feb 14, 2024

@matticbot
Copy link
Contributor

matticbot commented Feb 14, 2024

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.

@xavier-lc xavier-lc changed the title Force no site selection on /theme and /themes [WiP] Force no site selection on /theme and /themes Feb 15, 2024
@xavier-lc xavier-lc force-pushed the fix/make-sure-no-site-is-selected-on-the-themes-page branch from 71d8f7e to c0ff92f Compare February 15, 2024 11:22
@xavier-lc xavier-lc changed the title [WiP] Force no site selection on /theme and /themes Force no site selection on /theme and /themes Feb 15, 2024
@xavier-lc xavier-lc requested a review from a team February 15, 2024 12:47
@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 Feb 15, 2024
@xavier-lc xavier-lc self-assigned this Feb 15, 2024
@mmtr
Copy link
Member

mmtr commented Feb 19, 2024

I noticed that the left side navigation appeared different on production (showing a selected site) than it did on local/PR preview (showing "All sites")

@xavier-lc I cannot reproduce this. Am I missing anything?

Screenshot 2024-02-19 at 13 49 48

@Copons
Copy link
Contributor

Copons commented Feb 19, 2024

I noticed that the left side navigation appeared different on production (showing a selected site) than it did on local/PR preview (showing "All sites")

@xavier-lc I cannot reproduce this. Am I missing anything?

@mmtr I can repro with a clean cache (wiping the indexedDB should be enough).
Otherwise, Calypso automagically selects whatever theme I had selected before (AFAICS).

This seems to happen in every environment except dev (of course). 😭

@xavier-lc
Copy link
Contributor Author

@mmtr could you try with different accounts? It happens to me with random testing accounts, but not the main one.

@mmtr
Copy link
Member

mmtr commented Feb 21, 2024

@xavier-lc I've been able to reproduce it on a incognito window. But I'm unable to reproduce it locally or in Calypso Live as @Copons noted, which makes hard to verify if these changes actually solve the issue.

@xavier-lc have you managed to reproduce the issue locally? How have you determined that these changes effectively fix it?

Copy link
Member

@mmtr mmtr left a comment

Choose a reason for hiding this comment

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

I think we can try this anyway and see what happens in prod. Code changes make sense, and they don't introduce any regression for me when I test locally

@xavier-lc
Copy link
Contributor Author

@xavier-lc have you managed to reproduce the issue locally? How have you determined that these changes effectively fix it?

No, I haven't seen it happen locally. I just thought that the change makes sense 😅

I think we can try this anyway and see what happens in prod. Code changes make sense, and they don't introduce any regression for me when I test locally

👍

@xavier-lc xavier-lc force-pushed the fix/make-sure-no-site-is-selected-on-the-themes-page branch from 7bb1758 to caef01c Compare February 21, 2024 09:55
@xavier-lc xavier-lc merged commit 80d1fcb into trunk Feb 21, 2024
11 checks passed
@xavier-lc xavier-lc deleted the fix/make-sure-no-site-is-selected-on-the-themes-page branch February 21, 2024 11:29
@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 Feb 21, 2024
@xavier-lc
Copy link
Contributor Author

It's working on incognito 🕵️‍♂️

image

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