Repository navigation
Forms: update DataViews header and filters - #46732
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! 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. |
There was a problem hiding this comment.
Pull request overview
This PR refactors the DataViews header and filters for the Forms feature to accommodate Centralized Form Management (CFM). The changes reorganize the UI to place search and filter components at the same level as the main page tabs, and replace fixed status filter pills with a flexible DataViews "Folder" filter.
Changes:
- Creates a new shared
DataViewsHeaderRowcomponent to consolidate duplicate header/filter markup - When CFM is enabled, adds a "Folder" DataViews filter (Inbox/Spam/Trash) that syncs with the URL
statusparameter - Maintains backward compatibility by showing legacy
InboxStatusTogglewhen CFM is disabled - Fixes a state mutation bug in the
resetPagecallback
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| projects/plugins/jetpack/changelog/update-centralized-forms-header-filters | Adds changelog entry for the plugin |
| projects/packages/forms/changelog/update-centralized-forms-header-filters | Adds changelog entry for the package (has capitalization issue) |
| projects/packages/forms/src/dashboard/components/dataviews-header-row/index.tsx | New shared component for DataViews header row with tabs and controls |
| projects/packages/forms/src/dashboard/components/dataviews-header-row/style.scss | Styles for the new header component, migrated from inbox styles |
| projects/packages/forms/src/dashboard/inbox/stage/index.js | Integrates DataViewsHeaderRow, adds folder filter logic with URL sync |
| projects/packages/forms/src/dashboard/forms/index.tsx | Replaces duplicate header markup with DataViewsHeaderRow component |
| projects/packages/forms/src/dashboard/components/inbox-status-toggle/index.tsx | Makes onChange callback optional for reusability |
| projects/packages/forms/src/dashboard/hooks/use-inbox-data.ts | Updates comment to clarify new filter behavior |
| projects/packages/forms/src/dashboard/inbox/style.scss | Removes styles migrated to DataViewsHeaderRow |
| projects/packages/forms/src/dashboard/forms/style.scss | Removes unused breakpoints import |
Code Coverage SummaryCoverage changed in 2 files.
1 file is newly checked for coverage.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
a90bf5c to
d4d0f1c
Compare
enejb
left a comment
There was a problem hiding this comment.
This works really well for me.
It's great to see the refactor the header component into its own.
99b0cf1 to
8e3bdbc
Compare
|
Rebased and addressed small merge conflict. |
c933324 to
78b7fbc
Compare
|
Just addressed a couple more legit Copilot comments, and rebased again. Will merge when tests pass. |
The .jp-forms-filters-bar block (and its __chips / __status-chips modifiers) styled the inbox/spam/trash pill row that was replaced with native DataViews filters in #46732. The SCSS was missed at the time. No JSX consumer exists anywhere in the repo. Drops the dead rules from src/dashboard/inbox/style.scss and removes the now-empty src/dashboard/forms/style.scss along with its sole import in src/dashboard/forms/index.tsx. Refs #48160.
The .jp-forms-filters-bar block (and its __chips / __status-chips modifiers) styled the inbox/spam/trash pill row that was replaced with native DataViews filters in #46732. The SCSS was missed at the time. No JSX consumer exists anywhere in the repo. Drops the dead rules from src/dashboard/inbox/style.scss and removes the now-empty src/dashboard/forms/style.scss along with its sole import in src/dashboard/forms/index.tsx. Refs #48160.
Proposed changes:
This PR adjusts our DataViews header and filter to accommodate the needs of Centralized Form Management. Changes:
All behavior should be the same when the 'centralzed form management' flag is off.

When the centralized form management flag is ON....
Inbox before

Inbox after

Forms list before

Forms list after

Other information:
Jetpack product discussion
See #46580 (comment) from
See Figma designs here: 8TmDfrB54NU4Rzj19Qs9Tg-fi-6116_73070
See P2 here: p1HpG7-xwg-p2#comment-77460
Does this pull request change what data or activity we track or use?
Testing instructions:
Add this feature flag to your test site.
Test with Flag on:
Test with flag off to confirm no regressions: