Skip to content

Conversation

@jkguidaven
Copy link
Contributor

@jkguidaven jkguidaven commented Feb 2, 2026

Part of #A4A-168

## Proposed Changes

*   Added a `forceShowSearch` prop to the `SiteSelector` component to control the visibility of the search box.
*   Modified the `SiteSelector` to always display the search box when `forceShowSearch` is `true`, overriding the default behavior of hiding it for fewer than 6 sites.
*   Enabled the `forceShowSearch` prop in the `AtomicSitesSelector` (A4A site selector) to ensure the search box is always visible.
*   Fixed a typo (`clasName` to `className`) in `AtomicSitesSelector`.

## Why are these changes being made?
*   Large agencies often manage hundreds of sites, making it difficult to locate specific sites within the "Via WordPress.com" option of the Site Selector.
*   The existing `SiteSelector` component hides the search input box by default when there are 6 or fewer sites, which is not suitable for agencies needing constant search functionality.
*   These changes ensure the search box is always visible in the A4A site selector, allowing agencies to efficiently filter sites by name and address (URL/slug), as requested in the Linear issue.

## Testing Instructions

1.  Navigate to the A4A add sites section where the `AtomicSitesSelector` is used.
2.  Verify that the search input box is always visible, regardless of the number of sites displayed.
3.  Enter search terms into the box and confirm that the list of sites filters correctly based on site name and address/URL.

## Pre-merge Checklist

<!--
Complete applicable items on this checklist **before** merging into trunk. Inapplicable items can be left unchecked.

Both the PR author and reviewer are responsible for ensuring the checklist is completed.
-->

- [ ] Has the general commit checklist been followed? (PCYsg-hS-p2)
- [ ] [Have you written new tests](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 tested accessibility for your changes? Ensure the feature remains usable with various user agents (e.g., browsers), interfaces (e.g., keyboard navigation), and assistive technologies (e.g., screen readers) (PCYsg-S3g-p2).
- [ ] Have you used memoizing on expensive computations? More info in [Memoizing with create-selector](https://github.com/Automattic/wp-calypso/blob/trunk/packages/state-utils/src/create-selector/README.md) and [Using memoizing selectors](https://react-redux.js.org/api/hooks#using-memoizing-selectors) and [Our Approach to Data](https://github.com/Automattic/wp-calypso/blob/trunk/docs/our-approach-to-data.md)
- [ ] Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    - [ ] For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages. 
- [ ] 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)?

Open in Cursor Open in Web

- Add forceShowSearch prop to base SiteSelector component to allow
  always showing the search box regardless of site count
- Update AtomicSitesSelector to use forceShowSearch for A4A dashboard
- Fix typo in AtomicSitesSelector (clasName -> className)

This allows agencies with many sites to easily filter and find specific
sites by name or address in the 'Via WordPress.com' option.

Fixes: A4A-168

Co-authored-by: jkguidaven <[email protected]>
@cursor
Copy link

cursor bot commented Feb 2, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@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

  • agents-manager
  • notifications
  • odyssey-stats
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug cursor/A4A-168-site-selector-search-box-4f14 on your sandbox.

@jkguidaven jkguidaven closed this Feb 4, 2026
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