Skip to content

Enhancement/11889 server pagination#12242

Merged
tofumatt merged 29 commits intodevelopfrom
enhancement/11889-server-pagination
Mar 5, 2026
Merged

Enhancement/11889 server pagination#12242
tofumatt merged 29 commits intodevelopfrom
enhancement/11889-server-pagination

Conversation

@zutigrm
Copy link
Collaborator

@zutigrm zutigrm commented Feb 26, 2026

Summary

Addresses issue:

Relevant technical choices

PR Author Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 5.2 and PHP 7.4.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

Do not alter or remove anything below. The following sections will be managed by moderators only.

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.
  • Ensure there are no unexpected significant changes to file sizes.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

Base automatically changed from enhancement/11857-invite-component to develop March 2, 2026 14:01
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

Storybook is ready:

@github-actions
Copy link

github-actions bot commented Mar 2, 2026

Build files for 5da33fd have been deleted.

@github-actions
Copy link

github-actions bot commented Mar 2, 2026

Size Change: +367 B (+0.02%)

Total Size: 2.3 MB

ℹ️ View Unchanged
Filename Size Change
./dist/assets/blocks/reader-revenue-manager/block-editor-plugin/editor-styles.css 124 B 0 B
./dist/assets/blocks/reader-revenue-manager/block-editor-plugin/editor-styles.js 20 B 0 B
./dist/assets/blocks/reader-revenue-manager/block-editor-plugin/index.js 42.7 kB 0 B
./dist/assets/blocks/reader-revenue-manager/common/editor-styles.css 307 B 0 B
./dist/assets/blocks/reader-revenue-manager/common/editor-styles.js 20 B 0 B
./dist/assets/blocks/reader-revenue-manager/contribute-with-google/index.js 5.88 kB 0 B
./dist/assets/blocks/reader-revenue-manager/contribute-with-google/non-site-kit-user.js 5.07 kB 0 B
./dist/assets/blocks/reader-revenue-manager/subscribe-with-google/index.js 5.88 kB 0 B
./dist/assets/blocks/reader-revenue-manager/subscribe-with-google/non-site-kit-user.js 5.07 kB 0 B
./dist/assets/blocks/sign-in-with-google/editor-styles.css 84 B 0 B
./dist/assets/blocks/sign-in-with-google/editor-styles.js 20 B 0 B
./dist/assets/blocks/sign-in-with-google/index.js 18.6 kB 0 B
./dist/assets/css/googlesitekit-admin-css-********************.min.css 67 kB 0 B
./dist/assets/css/googlesitekit-adminbar-css-********************.min.css 12.3 kB 0 B
./dist/assets/css/googlesitekit-authorize-application-css-********************.min.css 846 B 0 B
./dist/assets/css/googlesitekit-wp-dashboard-css-********************.min.css 8.89 kB 0 B
./dist/assets/js/146-********************.js 963 B 0 B
./dist/assets/js/201-********************.js 2.85 kB 0 B
./dist/assets/js/314-********************.js 100 kB 0 B
./dist/assets/js/315-********************.js 3.08 kB 0 B
./dist/assets/js/379-********************.js 3.7 kB 0 B
./dist/assets/js/590-********************.js 1.89 kB 0 B
./dist/assets/js/640-********************.js 2.36 kB 0 B
./dist/assets/js/909-********************.js 1.01 kB 0 B
./dist/assets/js/analytics-advanced-tracking-********************.js 475 B 0 B
./dist/assets/js/googlesitekit-activation-********************.js 25 kB 0 B
./dist/assets/js/googlesitekit-ad-blocking-recovery-********************.js 59.4 kB 0 B
./dist/assets/js/googlesitekit-admin-pointers-tracking-********************.js 5.35 kB 0 B
./dist/assets/js/googlesitekit-adminbar-********************.js 35.8 kB 0 B
./dist/assets/js/googlesitekit-api-********************.js 7.99 kB 0 B
./dist/assets/js/googlesitekit-block-tracking-********************.js 5.55 kB 0 B
./dist/assets/js/googlesitekit-components-********************.js 5.81 kB 0 B
./dist/assets/js/googlesitekit-consent-mode-********************.js 25.5 kB 0 B
./dist/assets/js/googlesitekit-data-********************.js 1.73 kB 0 B
./dist/assets/js/googlesitekit-datastore-forms-********************.js 7.01 kB 0 B
./dist/assets/js/googlesitekit-datastore-location-********************.js 1.51 kB 0 B
./dist/assets/js/googlesitekit-datastore-site-********************.js 18.5 kB +380 B (+2.1%)
./dist/assets/js/googlesitekit-datastore-ui-********************.js 7.16 kB 0 B
./dist/assets/js/googlesitekit-datastore-user-********************.js 23 kB 0 B
./dist/assets/js/googlesitekit-entity-dashboard-********************.js 71.8 kB -5 B (-0.01%)
./dist/assets/js/googlesitekit-events-provider-contact-form-7-********************.js 1.27 kB 0 B
./dist/assets/js/googlesitekit-events-provider-easy-digital-downloads-********************.js 655 B 0 B
./dist/assets/js/googlesitekit-events-provider-mailchimp-********************.js 1.27 kB 0 B
./dist/assets/js/googlesitekit-events-provider-ninja-forms-********************.js 1.26 kB 0 B
./dist/assets/js/googlesitekit-events-provider-optin-monster-********************.js 1.29 kB 0 B
./dist/assets/js/googlesitekit-events-provider-popup-maker-********************.js 1.34 kB 0 B
./dist/assets/js/googlesitekit-events-provider-woocommerce-********************.js 990 B 0 B
./dist/assets/js/googlesitekit-events-provider-wpforms-********************.js 1.29 kB 0 B
./dist/assets/js/googlesitekit-i18n-********************.js 6.16 kB 0 B
./dist/assets/js/googlesitekit-key-metrics-setup-********************.js 53.1 kB 0 B
./dist/assets/js/googlesitekit-main-dashboard-********************.js 149 kB -7 B (0%)
./dist/assets/js/googlesitekit-metric-selection-********************.js 57.9 kB 0 B
./dist/assets/js/googlesitekit-modules-********************.js 26.3 kB 0 B
./dist/assets/js/googlesitekit-modules-ads-********************.js 48.4 kB 0 B
./dist/assets/js/googlesitekit-modules-adsense-********************.js 137 kB 0 B
./dist/assets/js/googlesitekit-modules-analytics-4-********************.js 190 kB 0 B
./dist/assets/js/googlesitekit-modules-pagespeed-insights-********************.js 23.4 kB 0 B
./dist/assets/js/googlesitekit-modules-reader-revenue-manager-********************.js 52.6 kB 0 B
./dist/assets/js/googlesitekit-modules-search-console-********************.js 66.5 kB 0 B
./dist/assets/js/googlesitekit-modules-sign-in-with-google-********************.js 33.9 kB 0 B
./dist/assets/js/googlesitekit-modules-tagmanager-********************.js 30.4 kB 0 B
./dist/assets/js/googlesitekit-notifications-********************.js 68.4 kB 0 B
./dist/assets/js/googlesitekit-polyfills-********************.js 230 B 0 B
./dist/assets/js/googlesitekit-settings-********************.js 134 kB -1 B (0%)
./dist/assets/js/googlesitekit-splash-********************.js 78.3 kB 0 B
./dist/assets/js/googlesitekit-user-input-********************.js 51.2 kB 0 B
./dist/assets/js/googlesitekit-vendor-********************.js 328 kB 0 B
./dist/assets/js/googlesitekit-widgets-********************.js 104 kB 0 B
./dist/assets/js/googlesitekit-wp-dashboard-********************.js 61.8 kB 0 B
./dist/assets/js/runtime-********************.js 1.92 kB 0 B

compressed-size-action

/**
* Internal dependencies
*/
import { useDebounce } from '@/js/hooks/useDebounce';
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Debounce and usage are not needed here, as it is handled in parent component

onInviteResult,
isLoading = false,
} ) {
const filteredUsers = useMemo( () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Filtering is handled server side now

expect( getByText( 'AuthorUser' ) ).toBeInTheDocument();
} );

it( 'filters users by name match', () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Filter related tests are redundant now, as filtering is handled server side

Comment on lines -44 to -46
useEffect( () => {
setInputValue( value );
}, [ value ] );
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No longer needed, because the component is fully controlled (value comes directly from parent, no local inputValue state).

Copy link
Collaborator

@tofumatt tofumatt 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 simplify the selector handling and add another test for it here, but otherwise looks good 👍🏻

Comment on lines +94 to +97
// Reuse the current selector result when search is empty to avoid duplicate requests.
if ( debouncedSearchTerm === '' ) {
return undefined;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This says it's re-using a selector result, but it's just returning undefined here. 🤔

Shouldn't we always be returning the eligible subscribers from below? 🤔

Comment on lines +90 to +92
if ( ! hasOpenedSelectionPanel ) {
return undefined;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here re: undefined vs null.

Comment on lines +164 to +167
const eligibleSubscribersForSearchThreshold =
debouncedSearchTerm === ''
? eligibleSubscribers
: allEligibleSubscribers;
Copy link
Collaborator

Choose a reason for hiding this comment

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

If debouncedSearchTerm === '' then the same selector will be used twice and shouldn't actually trigger another request while it's resolving.

I think you can remove the logic here that tries to be "clever" about not using the same selector in multiple places and let WP Data handle it—I think it should prevent duplicate requests 🤔

Copy link
Collaborator

@tofumatt tofumatt left a comment

Choose a reason for hiding this comment

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

Awesome, looks great, thanks for adding that test 👍🏻

Copy link
Collaborator

@tofumatt tofumatt left a comment

Choose a reason for hiding this comment

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

Looks like there's a few merge conflicts to resolve, but after that this is good-to-go 👍🏻

@zutigrm
Copy link
Collaborator Author

zutigrm commented Mar 5, 2026

Thanks, conflicts resolved

@tofumatt tofumatt merged commit 256d280 into develop Mar 5, 2026
31 of 33 checks passed
@tofumatt tofumatt deleted the enhancement/11889-server-pagination branch March 5, 2026 15:22
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.

2 participants