Skip to content

Conversation

@andrewserong
Copy link
Contributor

What?

Part of #72336

This PR adds a With Modal storybook story for the DataViewsPicker component. It doesn't address any of the issues in #72336, but should hopefully make those issues easier to work on or debug.

Why?

With the media library modal experiment in place and more folks starting to use the DataViewsPicker for a variety of use cases, it should help development of the picker to add a storybook entry for its use within a modal. As other use cases are explored (e.g. in #71128), I expect there'll be more of a use to quickly check how the component is working within a modal.

How?

  • Update the DataViewsPicker story to add an additional story and share common components
  • In the additional story, use a Modal component and output the selected items outside of the modal, to demonstrate picking behaviour

Testing Instructions

Note when testing that there might be issues with the DataViewsPicker itself (i.e. the footer isn't sticky). The purpose of this PR isn't to fix those issues (they're raised in #72336), but make them easier to spot and test.

That said, if you find issues with the story itself, please let me know!

Screenshots or screencast

2025-11-03.14.21.14.mp4

@andrewserong andrewserong self-assigned this Nov 3, 2025
@andrewserong andrewserong added [Type] Enhancement A suggestion for improvement. [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond labels Nov 3, 2025
@github-actions
Copy link

github-actions bot commented Nov 3, 2025

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: andrewserong <[email protected]>
Co-authored-by: talldan <[email protected]>
Co-authored-by: tellthemachines <[email protected]>
Co-authored-by: ramonjd <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@tellthemachines
Copy link
Contributor

tellthemachines commented Nov 3, 2025

In testing the modal pops up when opening the docs section as well as the modal section: http://localhost:50240/?path=/docs/dataviews-dataviewspicker--docs
which i don't think is supposed to happen 😅
Not sure why though.

Edit: the docs page on trunk isn't showing any docs either, just the default view, so maybe it's an issue with how that page is set up:
Screenshot 2025-11-03 at 3 28 48 pm

@github-actions
Copy link

github-actions bot commented Nov 3, 2025

Flaky tests detected in 1f4f3a4.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/19023496198
📝 Reported issues:

@andrewserong
Copy link
Contributor Author

In testing the modal pops up when opening the docs section as well as the modal section: http://localhost:50240/?path=/docs/dataviews-dataviewspicker--docs
which i don't think is supposed to happen 😅

Good catch! I think because I'd set the state to default to open, so wherever it's rendered that would happen, including the Docs view. It's a little safer to default to it being closed, I reckon, so I've updated the default state of the modal in: 545fd83

Copy link
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

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

LGTM with those latest fixes 🎉

@ramonjd
Copy link
Member

ramonjd commented Nov 4, 2025

LGTM too. I'll merge 👍🏻

@ramonjd ramonjd merged commit 919a026 into trunk Nov 4, 2025
35 of 36 checks passed
@ramonjd ramonjd deleted the add/dataviews-picker-with-modal-storybook-story branch November 4, 2025 01:33
@github-actions github-actions bot added this to the Gutenberg 22.1 milestone Nov 4, 2025
@andrewserong
Copy link
Contributor Author

Thanks for reviewing and merging, folks!

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

Labels

[Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants