Skip to content

Conversation

@dhasilva
Copy link
Contributor

Fixes FORMS-459

Proposed changes:

Uses the onClickItem prop to handle item selection, given that the current click behavior was removed on DataViews 11.2
This does not match exactly the current implementation, and that is deliberate to better match the UI. Clicking on an item will always set this item as the only selected item.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

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

Testing instructions:

To see this after the change in DataViews, checkout #46430 and apply this PR's changes on top of it, but this is optional.

  • Go to the responses dashboard
  • Click on an item's "From" text
  • Check that the item is selected
  • Also check the wp-build dashboard for the same behavior

This does not apply for the forms dashboard, as there is no "View" action there at this point.

@dhasilva dhasilva requested a review from a team January 23, 2026 23:25
@dhasilva dhasilva self-assigned this Jan 23, 2026
Copilot AI review requested due to automatic review settings January 23, 2026 23:25
@dhasilva dhasilva added [Status] Needs Review This PR is ready for review. [Type] Task labels Jan 23, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 23, 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 update/forms-click-item branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/forms-click-item

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
Copy link
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!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds onClickItem handlers to the Forms dashboards to restore item selection functionality that was removed in DataViews 11.2.0. The handlers ensure clicking on an item in the responses or inbox dashboards selects that item exclusively.

Changes:

  • Added onClickItem callback to both inbox and responses dashboards that sets the clicked item as the only selected item
  • Updated TypeScript casting in the responses stage component

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
projects/packages/forms/src/dashboard/inbox/stage/index.js Adds onClickItem handler to select items when clicked in inbox dashboard
projects/packages/forms/routes/responses/stage.tsx Adds onClickItem handler for responses dashboard and updates type casting
projects/packages/forms/changelog/update-forms-click-item Changelog entry for the new feature

Significance: patch
Type: added

Forms: Add item click handler for DataViews on dashboards
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

The changelog entry should end with a period according to the project's changelog guidelines. The entry should read: "Add item click handler for DataViews on dashboards."

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +556 to +561
const onClickItem = useCallback(
item => {
onChangeSelection( [ item.id.toString() ] );
},
[ onChangeSelection ]
);
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

The onClickItem callback is missing analytics tracking that exists in the desktopViewAction (lines 522-525). Since this new handler serves a similar purpose of selecting an item for viewing, consider adding analytics tracking using jetpackAnalytics.tracks.recordEvent to maintain consistency with the existing 'view-response' action tracking. This would help maintain visibility into how users interact with items in the dashboard.

Copilot uses AI. Check for mistakes.
const navigate = useNavigate();
const counts = useSelect(
select => ( select( dashboardStore ) as SelectActions ).getCounts(),
select => ( select( dashboardStore ) as unknown as SelectActions ).getCounts(),
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

This casting change from as SelectActions to as unknown as SelectActions appears unrelated to the PR's stated purpose of adding an item click handler for DataViews. If this change addresses a TypeScript error, it should be explained in the PR description or handled in a separate commit. If it's unrelated to the DataViews 11.2 update, consider removing it from this PR to maintain focus on the primary change.

Suggested change
select => ( select( dashboardStore ) as unknown as SelectActions ).getCounts(),
select => ( select( dashboardStore ) as SelectActions ).getCounts(),

Copilot uses AI. Check for mistakes.
@jp-launch-control
Copy link

jp-launch-control bot commented Jan 23, 2026

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/forms/src/dashboard/inbox/stage/index.js 0/180 (0.00%) 0.00% 2 ❤️‍🩹

Full summary · PHP report · JS report

@simison simison force-pushed the update/forms-click-item branch from 3a80b2b to eea6732 Compare January 26, 2026 09:38
@simison
Copy link
Member

simison commented Jan 26, 2026

I also removed the special underline styling on mobile, which was diverging from DataViews styles:

Before
image

After
Image

(three dots bug will be fixed with DataViews update)

Copy link
Member

@simison simison left a comment

Choose a reason for hiding this comment

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

Tests well; tested WP admin and CIAB admin versions, as well as mobile version.

@simison simison merged commit bb8e315 into trunk Jan 26, 2026
70 checks passed
@simison simison deleted the update/forms-click-item branch January 26, 2026 09:53
@github-actions github-actions bot removed the [Status] Needs Review This PR is ready for review. label Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants