Skip to content

Conversation

CGastrell
Copy link
Contributor

@CGastrell CGastrell commented Oct 2, 2025

Proposed changes:

This PR adds action buttons on inbox response view while also improving the response view behavior:

  • response view actions act upon only the response, not the entire selection
  • added read/unread toggle (it's handler is a noop until the new action from Forms: add read/unread state to the UI #45350 is merged)
  • added mark as spam/not spam
  • added trash/recover
  • added navigation arrows to move through the list (this inevitably clears the list selection)
  • added close button, also clearing the selection
  • added sticky behavior to the response view, so scrolling the list doesn't get the response out of view

There's still room for improvement, as the selection vs checkbox is still not perfect UX.

Showcase:

Screen.Recording.2025-10-06.at.00.08.51.mov

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

p1HpG7-xga-p2
13siIQaeu2Q587EzImrUwk-fi-5020_26486

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

No

Testing instructions:

Load the dashboard inbox. Check the behaviors described on the description.

@CGastrell CGastrell self-assigned this Oct 2, 2025
@CGastrell CGastrell added [Status] Needs Review This PR is ready for review. [Status] Needs Design [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Package] Forms Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR labels Oct 2, 2025
Copy link
Contributor

github-actions bot commented Oct 2, 2025

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 add/forms-response-view-actions branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/forms-response-view-actions

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

Copy link
Contributor

github-actions bot commented Oct 2, 2025

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 a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ 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!


Jetpack plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions bot added [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Status] Design Input Requested and removed [Status] Needs Review This PR is ready for review. labels Oct 2, 2025
Copy link

jp-launch-control bot commented Oct 2, 2025

Code Coverage Summary

Coverage changed in 2 files.

File Coverage Δ% Δ Uncovered
projects/packages/forms/src/dashboard/inbox/response.js 0/121 (0.00%) 0.00% 38 💔
projects/packages/forms/src/dashboard/inbox/dataviews/index.js 0/150 (0.00%) 0.00% 24 💔

Full summary · PHP report · JS report

Coverage check overridden by Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR .

@CGastrell CGastrell added [Type] Task and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Oct 4, 2025
@enejb enejb changed the title Add/forms response view actions Forms: Add response view actions Oct 7, 2025
@ilonagl
Copy link

ilonagl commented Oct 7, 2025

This is 🔥! 👏

@ilonagl
Copy link

ilonagl commented Oct 7, 2025

img

Very minor note: could we make the spacing the same in the top as the bottom one?

@ilonagl
Copy link

ilonagl commented Oct 7, 2025

I can't test the read/unread, I suppose due to other PR being open, but I suspect it works well. 🙌

@simison simison force-pushed the add/forms-response-view-actions branch from be7d29e to ec994e0 Compare October 8, 2025 07:36
const unread = (
<SVG xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none">
<Path d="M20.991 9.263c0-.644-.333-1.208-.846-1.52L12 3 3.855 7.742A1.78 1.78 0 0 0 3 9.263v8.947A1.8 1.8 0 0 0 4.8 20h14.4a1.8 1.8 0 0 0 1.8-1.79l-.009-8.947Zm-1.8 0v.01L12 13.736 4.8 9.263 12 5.076l7.191 4.187ZM4.8 18.21v-6.853l7.2 4.491 7.191-4.464.009 6.826H4.8Z" />
</SVG>
Copy link
Member

Choose a reason for hiding this comment

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

Let's use @wordpress/icons instead of shipping our own SVGs.

@simison
Copy link
Member

simison commented Oct 8, 2025

I pushed improvements:

  • Show "loading" state for buttons while actions are progressing
  • Don't show "close" button on mobile; we had two of them at the same time visible
  • Tweak mobile styles not look so broken
  • Use components like HStack and button correctly (tertiary style instead of secondary) so that we don't rely so much on custom CSS; change got rid of stray border on disabled "prev/next" buttons too.
  • Removed "mark as read / unread" since those are not ready to merge yet; I'm not sure we should even have those as quick actions in the view header
  • Tweaked header spacing
  • Show tooltips for next/prev even when they are disabled
  • Updated modal copy from "View response" to "Response"
  • Unrelated but fixed gravatar not shrinking on narrow screen with long email

Modal version will still need more work, we can inject actions in the modal header component directly using headerActions prop.

Screenshot 2025-10-08 at 12 04 01 image image image

@simison simison added the [Status] Needs Review This PR is ready for review. label Oct 8, 2025
simison
simison previously approved these changes Oct 8, 2025
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.

  • Tested previous and new behaviour for sticky/non sticky response sidebar on scrolling long and short messages 👍
  • Tested actions mobile/modal/desktop
  • Tested last/first items
  • Deleting, markign as spam, all correct actions

I fixed several issues (listed in comment above) and there's more work to do on mobile version, but this is good to go now to release.

@ilonagl
Copy link

ilonagl commented Oct 8, 2025

Group 1000007644

This is very minor, but I wonder if we still need this x icon in the bulk actions area? I know we had it, because there were no easy way to close the preview, but since we have it in actions, I don't think it's needed anymore.

@simison simison merged commit 6f18d1e into trunk Oct 8, 2025
67 checks passed
@simison simison deleted the add/forms-response-view-actions branch October 8, 2025 11:06
@simison
Copy link
Member

simison commented Oct 8, 2025

@ilonagl I think the X comes from upstream DataViews component so would need to be upstream change to remove it.

@ilonagl
Copy link

ilonagl commented Oct 8, 2025

Gotcha! Can we change the icon and use the bigger x to keep it consistent with the one on the preview then?

const handleMoveToTrash = useCallback( async () => {
setIsMovingToTrash( true );
await moveToTrashAction.callback( [ response ], { registry } );
setIsMovingToTrash( true );
Copy link
Member

Choose a reason for hiding this comment

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

This needed to be false, fixed in follow-up.

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

Labels

Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR [Feature] Contact Form [Package] Forms [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Type] Task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants