Skip to content

Search Dashboard: restore visible space between "AI Answers" and "(Preview)" tab label - #48850

Merged
kangzj merged 1 commit into
trunkfrom
atlas/search-tab-preview-space
May 15, 2026
Merged

kangzj merged 1 commit into
trunkfrom
atlas/search-tab-preview-space

Conversation

@kangzj

@kangzj kangzj commented May 15, 2026

Copy link
Copy Markdown
Contributor

Fixes nothing — follow-up to #48846 review comment #48846 (comment).

Proposed changes

  • In dashboard-page.jsx, the "AI Answers (Preview)" tab label was rendering as AI Answers(Preview) after the migration to the unified Tabs.Tab (variant "minimal") chassis from @wordpress/components. The new flex-based tab layout collapses the JSX { ' ' } text node sitting between two sibling elements, so the visible separator disappeared.
  • Drop the now-useless { ' ' } and instead place a non-breaking space (&nbsp;) inside the .jp-search-dashboard-tabs__tab-preview-label <span> itself, right before the localized (Preview) string. A space inside the element's text content is not subject to flex sibling-whitespace collapsing, so the gap renders reliably.

Related product discussion/links

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

No.

Testing instructions

  1. Build the Search package: jp build search --deps.
  2. Open the Jetpack Search dashboard on a site with the AI Answers tab visible.
  3. Confirm the third tab reads "AI Answers (Preview)" with a clear space between the title and the parenthesized "(Preview)" qualifier — no longer "AI Answers(Preview)".
  4. Sanity-check the other two tabs ("Plan & Usage", "Settings") still render normally and the active-tab indicator is unaffected.

…eview)" tab label

The new flex-based `Tabs.Tab` from `@wordpress/components` collapses
JSX `{ ' ' }` whitespace between sibling nodes, so the "(Preview)"
suffix rendered flush against "AI Answers". Move a non-breaking
space inside the preview-label span so it survives the flex layout.

Follow-up to #48846 (review comment #3245711759).
@kangzj kangzj self-assigned this May 15, 2026
@github-actions

github-actions Bot commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

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 atlas/search-tab-preview-space branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack atlas/search-tab-preview-space

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

@github-actions github-actions Bot added the [Package] Search Contains core Search functionality for Jetpack and Search plugins label May 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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 15, 2026
@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

This PR did not change code coverage!

That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷

Full summary · PHP report · JS report

@kangzj
kangzj merged commit 08a2dee into trunk May 15, 2026
75 checks passed
@kangzj
kangzj deleted the atlas/search-tab-preview-space branch May 15, 2026 04:44
@github-actions github-actions Bot 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 15, 2026
kangzj added a commit that referenced this pull request May 15, 2026
…ipt (RSM-3319)

Replace the parenthesized inline label "(Preview)" sitting in a
plain <span> next to the AI Answers tab title with a semantic <sup>
superscript and drop the parens. Visually this leans on the UA's
own `vertical-align: super` baseline shift; we only override the
font-size (0.7em) and tint the text with the neutral-weak design
token so the qualifier reads as metadata instead of competing with
the tab title. The translation call moves to _x() with a context
note so translators see the badge intent.

Removes the `&nbsp;` workaround that #48850 had to add against the
new flex-based Tabs.Tab — putting the text inside <sup> means the
UA superscript handles its own spacing.
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant