Adding a filter from the column-header-menu should open the filter panel#64683
Adding a filter from the column-header-menu should open the filter panel#64683imrraaj wants to merge 1 commit intoWordPress:trunkfrom
Conversation
…with column header filters
|
Do we think that having two places to add filters is a good idea? Why can't we just remove the filters from the table headers (no other view outside table allows this inline filtering) |
|
I think it's quite handy, as are the other actions in that menu (re-ordering, hiding). Other actions like pinning (#64679) could be contained here in the future. Thinking about custom fields you might also be able to rename, or go and edit other field properties from this menu. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @raj.patel@rtcamp.com. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Hey @jameskoster, Can you please review the PR? |
|
@imrraaj this one needs a code review from someone like @youknowriad or @jorgefilipecosta. |
|
Interestingly, it works in the storybook (where DataViews is a standalone component), so I wonder if there's some Gravacao.do.ecra.2024-09-02.as.12.29.04.mov |
|
@jameskoster, would the change I described above be something we are ok with? Or is it something we want to avoid? |
|
@jorgefilipecosta Ideally the bundled views all behave the same in this respect.
As we can see Templates are the odd one out. But this is an issue on trunk, so we don't necessarily have to fix it here. What do you think? |
|
Thanks for the PR! I'm closing though since this has been resolved for a while and I closed the linked issue too. |

What?
The fix shows the filter component when selected via column headers
Why?
Fixes #64612
How?
The initial state for
isShowingFilteris set to true, so when the filter option is selected in column header the filter component renders just like when we select it using dropdown menu icongutenberg/packages/dataviews/src/components/dataviews/index.tsx
Lines 96 to 98 in 5e77997
to
Testing Instructions
npm installandnpm run storybook:devcategoriescolumn headerAdd filteroptionScreenshots or screencast
Before
Screen.Recording.2024-08-21.at.7.32.56.PM.mov
After
Screen.Recording.2024-08-21.at.7.30.31.PM.mov