Skip to content

Comments

Posts: Navigate max pages notice to /sites#101849

Merged
tyxla merged 1 commit intotrunkfrom
update/post-type-list-max-pages-sites
Mar 31, 2025
Merged

Posts: Navigate max pages notice to /sites#101849
tyxla merged 1 commit intotrunkfrom
update/post-type-list-max-pages-sites

Conversation

@tyxla
Copy link
Member

@tyxla tyxla commented Mar 25, 2025

Proposed Changes

Updates PostTypeListMaxPagesNotice to no longer set layout focus to sites, but to rather navigate to the new sites selector on /sites.

I'm also using the opportunity to refactor the component to a functional one.

Why are these changes being made?

To remove one of the last instances where we're setting layout focus to sites, which unblocks us from removing the old site picker which we're not using almost anywhere anymore.

We're unifying site selection code as part of improving the multisite dashboard experience.

We're removing the old site picker in #101844 and we removed a few unused related pieces in #101835 and #101837.

Testing Instructions

  • Make sure your remove_duplicate_views_experiment_assignment_160125 preference is set to control.
  • Go to /posts
  • If you don't have enough posts in that list, in React DevTools set PostTypeList's totalPageCount prop to 99 as shown on the screenshot:

Screenshot 2025-03-25 at 17 37 37

  • Verify that clicking the "switch to a specific site" link leads to /sites.

@tyxla tyxla added Enhancement Changes to an existing feature — removing, adding, or changing parts of it Posts Sites [Feature] Multi-site Management Features related to managing multiple sites from a single WordPress.com account. labels Mar 25, 2025
@tyxla tyxla requested a review from a team March 25, 2025 15:48
@tyxla tyxla self-assigned this Mar 25, 2025
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Mar 25, 2025
@github-actions
Copy link

github-actions bot commented Mar 25, 2025

@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

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug update/post-type-list-max-pages-sites on your sandbox.

@matticbot
Copy link
Contributor

matticbot commented Mar 25, 2025

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

Sections (~13 bytes removed 📉 [gzipped])

Details
name          parsed_size           gzip_size
posts-custom       -166 B  (-0.0%)      -13 B  (-0.0%)
posts              -166 B  (-0.0%)      -13 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.

@ciampo ciampo requested a review from okmttdhr March 28, 2025 11:11
Copy link
Contributor

@ciampo ciampo left a comment

Choose a reason for hiding this comment

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

Code changes LGTM and test well as per instructions 🚀

On trunk, the site selector opens in the sidebar, while on this PR the page navigates to /sites.

Comment on lines -46 to -51
/* eslint-disable jsx-a11y/anchor-is-valid,jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */
<a
className="post-type-list__max-pages-notice-link"
onClick={ this.focusSiteSelector }
/>
/* eslint-enable jsx-a11y/anchor-is-valid,jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */
Copy link
Contributor

Choose a reason for hiding this comment

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

Glad we moved away from this

@tyxla tyxla force-pushed the update/post-type-list-max-pages-sites branch from ac9ac1d to d855e47 Compare March 31, 2025 06:28
@tyxla tyxla merged commit daf8e51 into trunk Mar 31, 2025
13 checks passed
@tyxla tyxla deleted the update/post-type-list-max-pages-sites branch March 31, 2025 06: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 Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Feature] Multi-site Management Features related to managing multiple sites from a single WordPress.com account. Posts Sites

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants