Skip to content

Conversation

@arthur791004
Copy link
Contributor

@arthur791004 arthur791004 commented Jan 30, 2026

Part of DOTMSD-1067, DOTMSD-1068

Proposed Changes

  • Introduce the DataViewsEmptyStateLayout component so we don't need to build the empty state from scratch for each view
  • Apply the DataViewsEmptyStateLayout to DataViews on both sites and domains screen
Sites Domains
Screenshot 2026-02-03 at 11 43 01 AM image

Why are these changes being made?

  • Improve the experience of the empty search state

Testing Instructions

Sites

  • Go to /sites
  • Search any keyword until there is no result
  • Ensure the empty search state is correct

Domains

  • Go to /domains
  • Search any keyword until there is no result
  • Ensure the empty search state is correct

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests 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 and Using memoizing selectors and Our Approach to Data
  • 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)?

@arthur791004 arthur791004 self-assigned this Jan 30, 2026
@matticbot
Copy link
Contributor

matticbot commented Jan 30, 2026

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • agents-manager
  • help-center
  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug feat/dataviews-empty-state-v2 on your sandbox.

@arthur791004 arthur791004 force-pushed the feat/dataviews-empty-state-v2 branch from 64e00f5 to cd634fe Compare January 30, 2026 12:20
@StevenDufresne
Copy link
Contributor

Yeah, I think this is the right approach. I reached a similar conclusion after putting up #108433. There's more redundancy than needed, since we're swapping actions and conditionally rendering the OfferCard on search views.

Worth mentioning, I would prefer not call anything V2.

@arthur791004
Copy link
Contributor Author

arthur791004 commented Feb 2, 2026

Worth mentioning, I would prefer not call anything V2.

This is just a temporary name like CustomSelectControlV2 😅 Will rename it when we're able to remove the V1

@arthur791004
Copy link
Contributor Author

This one seems better as we have different requirements of domain empty state for CIAB. See #108424.

@arthur791004 arthur791004 force-pushed the feat/dataviews-empty-state-v2 branch from cd634fe to 24c9075 Compare February 2, 2026 08:14
@arthur791004 arthur791004 marked this pull request as ready for review February 2, 2026 08:16
@arthur791004 arthur791004 requested a review from a team as a code owner February 2, 2026 08:16
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Feb 2, 2026
@arthur791004 arthur791004 force-pushed the feat/dataviews-empty-state-v2 branch from 24c9075 to 545ae8b Compare February 2, 2026 08:53
isLoading={ isLoadingSites || ( isPlaceholderData && hasNoData ) }
isPlaceholderData={ isPlaceholderData }
empty={ emptyState }
empty={
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to do the same thing to sites-ciab? Wondering because we are modifying domains-ciab in this PR 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm maybe we can do it later; I don't know if the current actions are applicable to CIAB...

Copy link
Contributor

Choose a reason for hiding this comment

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

Good question. We don't know what it should look like yet, I agree we can do it later.

Copy link
Contributor

@fushar fushar left a comment

Choose a reason for hiding this comment

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

I'm seeing a flashing content when I searched in the Domains page for the first time:

B9fn7O.mp4

To reproduce, you need to Disable cache in your console, then hard reload the Domains page. Then start searching with bogus term to get to the empty search state.

I suspect it has something to do with this suspense boundary since it covers the PageLayout. 🤔

const trackEmptyStateActionClick = ( action: string ) => {
recordTracksEvent( 'calypso_domains_dashboard_empty_state_action_click', {
action,
dashboard: 'ciab',
Copy link
Contributor

Choose a reason for hiding this comment

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

I know we just copy-paste this from existing code. But just wanted to note so that we don't forget. We might not need this param as we will have other environment value for CIAB when we ship it, which will be present in all Track events automatically:

Image

<EmptyState.ActionItem
title={ __( 'Use a domain name you already own' ) }
description={ __(
'Bring your domain to WordPress.com and manage everything in one place.'
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a question for CIAB team (for later), do we really want to mention wordpress.com here 😄

@StevenDufresne
Copy link
Contributor

I suspect it has something to do with #108424 (comment) since it covers the PageLayout. 🤔

Nice catch, yes. We can't wrap the PageLayout with <Suspense>, ever.

@StevenDufresne StevenDufresne force-pushed the feat/dataviews-empty-state-v2 branch from 55d64ef to 70713e1 Compare February 3, 2026 05:00
@StevenDufresne
Copy link
Contributor

I've moved the <Suspense> boundary to wrap around AddDomainButton, that should sort out the flash.

@StevenDufresne StevenDufresne requested a review from fushar February 3, 2026 05:12
@StevenDufresne StevenDufresne force-pushed the feat/dataviews-empty-state-v2 branch from 25c1b84 to 9387458 Compare February 3, 2026 11:16
<Suspense fallback={ null }>
<EmptyDomainsStateActions />
</Suspense>
<EmptyDomainsStateUpsell />
Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't tested it but I believe we should put this one in the above suspense as well together, to avoid layout shift during the JS load 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

To be honest, I don't like the lazy-load approach here. It kind of defeats the purpose of ensuring the data exists before rendering the view. I'll have to take a look at the context to understand why we need to lazy load this in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants