Forms: Add rename and trash actions to single form dropdown#47589
Forms: Add rename and trash actions to single form dropdown#47589
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
|
@claude review this PR. |
|
Claude finished @enejb's task in 1m 19s —— View job PR Review
Overall this is a clean, well-structured addition that reuses the existing Observations1. Trash action fires immediately without confirmation The
{
title: __( 'Trash', 'jetpack-forms' ),
onClick: () => trashForm( formItem ),
},Consider adding an undo action to the success snackbar (similar to how 2.
3. After a successful save ( You should ensure that 4. When Trashing an already-trashed form would either be a no-op or an error. You should guard against showing "Trash" (and possibly "Rename", "Publish") when 5. The file already imports 6. After calling 7. Changelog entry mentions "duplicate" — but duplicate was already present
Duplicate was already present before this PR (it's in the existing SummaryThe implementation is solid and follows the existing patterns well. The main items worth addressing before merge are:
|
Code Coverage SummaryCoverage changed in 1 file.
|
|
@claude review the code one more time. |
|
Claude finished @enejb's task in 1m 46s —— View job PR Review (Re-review)
Good news: all three main issues from the previous review have been addressed. Here's a full status rundown. Previously Raised — Now Resolved ✅1. Trash action now has an undo snackbar action ( The undo correctly captures 2. Trashed form guards are in place ( When 3. I read 4. Changelog entry — Now reads "Add rename and trash actions to the single form dashboard dropdown menu, and reorder menu items." — accurate. New Observations1. In } catch {
// Error handling is left to the caller via onSave
// Modal stays open on error ← ❌ WRONG
}The 2. Still a minor nit from the previous review — the file imports 3. Undo restore navigates back to forms list — no re-navigation to single form After a successful Undo, 4. Test gap: The test at line 522–556 calls SummaryThe implementation is solid and the critical issues are fixed. The remaining items above are all minor/non-blocking. This is ready to merge. |
vianasw
left a comment
There was a problem hiding this comment.
looking good, testing well
Add a "Rename" option to the dropdown menu on the single form responses page, reusing the existing FormNameModal component and the same rename pattern from the forms list view. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a "Move to trash" option to the dropdown menu on the single form responses page. After trashing, the user is navigated back to the forms list since the form no longer exists. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reorder the dropdown menu items to match the design: Preview, Copy embed, Copy shortcode, Publish/Unpublish, Rename, Duplicate, Trash. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add undo action to the trash snackbar that restores the form to its previous status. - Hide Rename, Duplicate, Trash, and Publish/Unpublish actions when viewing a trashed form. - Fix changelog to not mention duplicate (already existed). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add tests covering return shape, ariaLabel, breadcrumbs, subtitle, formItemControls ordering, trashed form guard, badges, trash action (success + error), and rename action. Also fix a declaration order issue where formRecord was referenced in trashForm's dependency array before being declared. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When viewing a trashed form's responses, the dropdown menu now shows only "Restore" and "Delete permanently" actions instead of the normal actions. Restore sets the form status back to publish, and Delete permanently removes it with force: true. Both navigate to /forms after. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove navigation to /forms after restore so the user stays on the single form responses page. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…orm button - Add an "Are you sure" ConfirmDialog before permanently deleting a form, matching the pattern used in the forms list view. - Remove the Edit Form button from the single form header actions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Import and render EditFormButton on single-form screens when a sourceIdNumber exists and the form is not trashed. Refactor the useSelect call that fetches the form record into an explicit callback that guards against missing sourceIdNumber (returning undefined), improving readability and avoiding unnecessary calls. Also include formStatus in the returned dependencies so actions update correctly when the form status changes.
Remove misleading comment in FormNameModal and use coreDataStore instead of string 'core' in useDispatch for consistency. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3a2170e to
3ae7f0c
Compare
…data exports Add createReduxStore, register, and getConfig to the mock so transitive ESM imports from the dashboard and config stores resolve correctly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Before:
After:

Proposed changes
FormNameModalcomponent and the same rename pattern from the forms list view.Other information
Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
/wp-admin/admin.php?page=jetpack-forms-responses)