-
Notifications
You must be signed in to change notification settings - Fork 833
Forms: clear selection when switching tabs #45543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 fixes a bug where selected form responses remained active when switching between tabs (Inbox, Spam, Trash) in the Forms dashboard. The solution moves selection state to the URL for persistence across pages and properly clears selections when changing tabs.
Key Changes:
- Selection state is now derived from URL parameters instead of local component state
- Selection is cleared from the URL when switching tabs
- Selection logic updated to merge and deduplicate items across pages
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| projects/plugins/jetpack/changelog/fix-forms-clear-selection-when-switching-tabs | Changelog entry documenting the bugfix |
| projects/packages/forms/src/dashboard/inbox/dataviews/index.js | Refactored selection state to read from URL and updated selection merging logic |
| projects/packages/forms/src/dashboard/components/inbox-status-toggle/index.tsx | Added logic to clear selection when switching tabs |
| projects/packages/forms/changelog/fix-forms-clear-selection-when-switching-tabs | Changelog entry for the forms package |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
projects/packages/forms/changelog/fix-forms-clear-selection-when-switching-tabs
Outdated
Show resolved
Hide resolved
projects/packages/forms/src/dashboard/components/inbox-status-toggle/index.tsx
Outdated
Show resolved
Hide resolved
|
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! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
…en-switching-tabs Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…toggle/index.tsx Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Code Coverage SummaryCoverage changed in 2 files.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great! ![]()
This PR fixed the issue where when a user has selected responses and then switches tabs ( Inbox, Spam, Trash ).
and then navigates back to the previous tab that the selection is still active.
This is unexpected since the selection should be cleared.
Screen.Recording.2025-10-17.at.6.41.38.PM.mov
Proposed changes:
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
No
Testing instructions:
Go to the dashboard.
Select responses. Notice that the selection is updated in the URL.
Change tabs. ( Inbox, Spam, Trash ). Notice that the selection is cleared in the URL.
Notice that non of the checkboxes are selected.