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

[WooCommerce] Fix unable to review Installed Themes in MyTheme tab #86944

Merged
merged 5 commits into from
Jan 31, 2024

Conversation

chihsuan
Copy link
Member

@chihsuan chihsuan commented Jan 29, 2024

Related to #86935

Fix unable to review Installed Themes in MyTheme tab

Please note that it's still not possible to search for themes that are not in .org or wpcom. It seems that the WPCOM's themes API doesn't support it.

Proposed Changes

  • Remove the hidden Store filter for My Themes query
  • Do not increment page on mount when isRequesting or isLastPage. This 'incrementPage' will cause an issue where if you directly visit the 'my themes' page through the URL, 'my themes' won't display correctly because 'page' is set to 2.
  • Disable the filter tab active state if the selected key is not found. Since Woo Express doesn't have an 'ALL' filter, when searching for themes, the active tab filters should be disabled.

Testing Instructions

  1. Create a Woo Express site (Paid plan)
  2. Go to Appearance > Themes > Install Themes and upload a non-WP.com theme
  3. Navigate away from the themes area and then go back to Appearance > Themes
  4. Click on "My Theme"
  5. Observe that you can see the installed theme
  6. Searching for any theme
  7. Observe that none of the filters are active.

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

@chihsuan chihsuan self-assigned this Jan 29, 2024
Copy link

github-actions bot commented Jan 29, 2024

() =>
Math.max(
items.findIndex( ( { key } ) => key === selectedKey ),
0
Copy link
Member Author

Choose a reason for hiding this comment

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

When the filter tab doesn't have a match, it should not display any active tab, instead of defaulting to an active index of 0.

@chihsuan chihsuan requested review from a team, adrianduffell and rjchow January 29, 2024 12:14
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Jan 29, 2024
Copy link
Contributor

@ilyasfoo ilyasfoo left a comment

Choose a reason for hiding this comment

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

Tested well, LGTM! 🚢

client/state/themes/selectors/get-theme-hidden-filters.js Outdated Show resolved Hide resolved
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
@matticbot
Copy link
Contributor

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

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

  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/woo-my-theme on your sandbox.

Copy link
Contributor

@rjchow rjchow left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@chihsuan chihsuan merged commit 8e3ea1b into trunk Jan 31, 2024
11 checks passed
@chihsuan chihsuan deleted the fix/woo-my-theme branch January 31, 2024 06:54
@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 Jan 31, 2024
@matticbot
Copy link
Contributor

matticbot commented Jan 31, 2024

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

Sections (~20 bytes added 📈 [gzipped])

name    parsed_size           gzip_size
themes       +100 B  (+0.0%)      +20 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.

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.

jjchrisdiehl pushed a commit that referenced this pull request Jan 31, 2024
…86944)

* Remove the hidden Store filter for My Themes query and do not increment the page if number is greater than 20

* Disable the active state when filter selected key is not found

* Reformat

* Do not incrementPage when isRequesting or isLastPage

* Update client/state/themes/selectors/get-theme-hidden-filters.js

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

---------

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
jjchrisdiehl pushed a commit that referenced this pull request Feb 5, 2024
…86944)

* Remove the hidden Store filter for My Themes query and do not increment the page if number is greater than 20

* Disable the active state when filter selected key is not found

* Reformat

* Do not incrementPage when isRequesting or isLastPage

* Update client/state/themes/selectors/get-theme-hidden-filters.js

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>

---------

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
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