Skip to content

Search dashboard: surface inline customization links on the active Overlay row (RSM-2380)#48563

Draft
Copilot wants to merge 10 commits intotrunkfrom
copilot/add-inline-customization-links-overlay
Draft

Search dashboard: surface inline customization links on the active Overlay row (RSM-2380)#48563
Copilot wants to merge 10 commits intotrunkfrom
copilot/add-inline-customization-links-overlay

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 6, 2026

Fixes RSM-2380.

Why?

When the feature-selector replaced ModuleControl, the Customize search results and Edit sidebar widgets entry points that lived under the legacy "Enable instant search" toggle were dropped. Site owners running the Overlay experience still need a path back to those pages.

The first attempt rendered the links inline inside the active Overlay row, but the row is wrapped in a <label>, which intercepts clicks and toggles the radio — the links were dead. This PR moves them into a new detail panel above the option rows that switches content per selected experience.

Proposed changes

  • New experience-details.jsx rendered above the radio fieldset. Subscribes to getSelectedExperience, getActiveExperience, isUpdatingJetpackSettings, and supportsInstantSearch.
  • Panel content switches with the selected (radio-checked) experience so the user can preview each option as they tab through:
    • Overlay: title (Instant Search) + a richer description + a card with Overlay appearance → Customize and Sidebar widgets → Edit widgets actions. Customize is gated behind supportsInstantSearch (paid-plan check, mirroring legacy).
    • Embedded / Theme search / Off: title only — richer per-experience content is a follow-up.
  • Customization actions only appear when Overlay is also the active (saved) experience — links act on live overlay configuration and would mislead on a site that hasn't actually saved Overlay yet.
  • Both actions render as proper anchors (<a href>) via @wordpress/ui Button with the base-ui render prop. The library has no link variant; variant="minimal" tone="brand" gives the link-like appearance, and nativeButton={ false } lets the rendered <a> actually navigate (an href attribute on a <button> is ignored — that's the trap the first attempt fell into).
  • URL constants (SEARCH_CUSTOMIZE_URL, WIDGETS_EDITOR_URL) match the legacy values verbatim. The legacy sprintf( ..., encodeURIComponent( returnUrl ) ) was a no-op (the format strings have no %s), so we drop it.
  • Styling uses wpds design tokens consistent with the rest of the selector (--wpds-color-bg-surface-neutral, --wpds-color-stroke-surface-neutral, --wpds-border-radius-lg, etc.). Inset action card uses the strong surface to read as a secondary affordance.

Testing instructions

  1. On a site with a plan that supports Instant Search, open Jetpack → Search with the new dashboard enabled.
  2. Confirm the Instant Search detail panel sits above the radio rows and matches the design (title, description, two action items in an inset card).
  3. Click Customize → → lands on admin.php?page=jetpack-search-configure. Click Edit widgets → → lands on widgets.php.
  4. Select Theme search (or any non-Overlay row). The panel should update to show only the row label as a title — no description, no actions.
  5. With Overlay active, switch to another row but don't save: actions disappear immediately because the row is no longer "selected". Switch back to Overlay (still active): actions return.
  6. Hit Save while watching the action links — they should briefly become non-clickable (aria-disabled, no href).
  7. On a classic-only plan, only Edit widgets appears; Customize is hidden.

Test coverage

6 new Jest cases in experience-details.test.jsx: title + description for Overlay, links present with correct hrefs when Overlay is active, plan gate hides Customize, actions hidden when Overlay is selected-but-not-active, title-only for non-Overlay rows, aria-disabled + no href while saving. All 22 feature-selector tests pass.

Visual verification

Verified locally on pixelantics.jetpack.ngrok.app:

  • Panel renders above option rows with the design layout.
  • Overlay-row click navigates to admin.php?page=jetpack-search-configure (real navigation, not a dead click).
  • Selecting Theme search switches the panel to title-only.

Does this pull request change what data or activity we track or use?

No — UI navigation links only.

Copilot AI changed the title [WIP] Add inline customization links on active Overlay row Search dashboard: surface inline customization links on the active Overlay row (RSM-2380) May 6, 2026
Copilot AI requested a review from adamwoodnz May 6, 2026 09:20
@github-actions github-actions Bot added [Package] Search Contains core Search functionality for Jetpack and Search plugins [Status] In Progress [Tests] Includes Tests labels May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label May 6, 2026
…380)

Inline customization links inside an option <label> are dead clicks — the
label's click handler swallows the events and toggles the radio. Move them
into a new ExperienceDetails panel rendered above the radio rows. The
panel's content switches with the selected experience and shows the
"Customize" / "Edit widgets" actions only when Overlay is the *active*
(saved) experience, mirroring the legacy ModuleControl gate.

`@wordpress/ui` Button has no `link` variant, so the actions use
`variant="minimal" tone="brand"` and render as `<a>` via the base-ui
`render` prop — `href` on a `<button>` is ignored by browsers, which would
silently reproduce the dead-click bug.

Non-Overlay options render only the title for now; richer per-experience
content is a follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@adamwoodnz adamwoodnz removed the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the copilot/add-inline-customization-links-overlay branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack copilot/add-inline-customization-links-overlay

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@jp-launch-control
Copy link
Copy Markdown

jp-launch-control Bot commented May 6, 2026

Code Coverage Summary

1 file is newly checked for coverage.

File Coverage
projects/packages/search/src/dashboard/components/feature-selector/experience-details.jsx 10/10 (100.00%) 💚

Full summary · PHP report · JS report

adamwoodnz and others added 6 commits May 6, 2026 22:14
…sabled (RSM-2380)

Always render the Customize / Edit widgets actions when Overlay is the
selected experience, but only enable them once Overlay is the active
(saved) experience.

Active: render as <a href> via the @base-ui `render` prop so cmd/middle-
click open in a new tab and the URL is visible on hover. wp-admin's
global `a { color }` rule normally clobbers the library's variant colour
on a Button-rendered-as-<a>, but outline+brand happens to use the same
admin brand-blue, so there's no leak.

Disabled: fall back to the default <button> render. The library's
data-disabled rule only lands correctly on a real <button>, and AT users
aren't told a non-functional element is a link.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…r (RSM-2380)

Drop the nested-card framing on the panel — surrounding border, full
border-radius, and contained padding made it read as a card-within-a-
card. Reverse the form's padding via negative margins so the panel
extends to the form edges, keep the top corners following the form's
radius, and use a single bottom border to separate the panel from the
radio rows. Background tone unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bring the panel title in line with the radio row label ("Overlay search"
instead of "Instant Search"), tighten the Sidebar widgets blurb, and
restore the panel as a nested card. Bump the title and action-title
font sizes for hierarchy.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reapply the edge-to-edge layout: reverse the form's padding via negative
margins so the panel sits flush with the form edges, top corners follow
the form's radius, and a single bottom border separates it from the
radio rows.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…RSM-2380)

Pull the "Select a search experience for your visitors" h2 inside the
form so it sits between the detail panel and the radio rows. Drop the
fragment wrapper now that the form is the only top-level element. The
heading still labels the fieldset via aria-labelledby.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Search Contains core Search functionality for Jetpack and Search plugins [Status] In Progress [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants