-
Notifications
You must be signed in to change notification settings - Fork 4.6k
DataViews: introduce activity layout #72780
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
|
Size Change: +4.25 kB (+0.17%) Total Size: 2.51 MB
ℹ️ View Unchanged
|
|
I haven't dug deeply into implementation but direction is good. Thanks for working on this, Mike! |
|
Do we want this to be core layout or something you register from a core package or third-party package? |
|
@oandregal My largest struggle with this right now is why we need to have things like You can do everything date related in existing list view by providing any date field and a group, while ensuring your data is pre-sorted by date. The only thing we're adding here essentially is a line down the left and icons. Thats why I'm struggling with direction. What do you think? |
|
@mikejolley Does this mockup help to clarify direction? The
That's how we start, but I expect us to iterate and have all of this working:
By having a separate timeline layout, we can easily customize all those details without impacting the list layout. Without that separation, the code will be hard to maintain. Of course, we don't have to have all of this working in the first PR, we should start small and iterate on them bit by bit. Does this help? |
@youknowriad There are example in core that would benefit from this (global styles revisions, etc.). |
Yeah, I think that's a good argument for making it in Core but I do wonder if it should be bundled in dataviews or a separate package (to also allow us to explore the custom layouts API). I don't think it's necessarily in this initial PR or if we should do it at all. But it feels like a good opportunity. One advantage is that if you consume dataviews as a module, you might not increase the bundle size of all the routes that use dataviews, only the ones that need this particular layout. |
d873c15 to
28ae73b
Compare
packages/dataviews/src/components/dataviews-view-config/index.tsx
Outdated
Show resolved
Hide resolved
|
Flaky tests detected in 778306f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/19464380570
|
238a3e2 to
2c50523
Compare
|
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 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. |
|
It'd be good to rebase and resolve conflicts for easier reviews (more accurate changeset). |
|
I'm having a hard time understanding the value of |
There is an example in storybook. The idea was that It could be removed but then you'd need to ensure every consumer adds the date to the item themselves and internally we wouldn't know what field is responsible for the date/time of the event. |
2b122bc to
9f84bad
Compare
4bee1bf to
e8bd2bf
Compare
|
Renamed the PR from: |
|
@mikejolley thanks for iterating on this one until the details were right! 👏 ❤️ |
|
Thanks for the reviews and direction @oandregal, and everyone else who provided feedback. Merging now 😎 |

Activity list
Timelinelayout for DataViews. Based on List but with some design changes.What?
This PR introduces an Activity layout to DataViews.
Why?
There are several use cases which require a view like this and while List layout can get us so far, it lacks some styles and is not completely suitable.
How?
Disables sortingAllowseventFieldto be defined. This shows up on each item and controls sorting.showGroupFieldLabelto hide the prefix before group names. Useful if you just want to display a date. The field itself is rendered using the render callback so you can control date format etc.groupByFieldDirectionto allow groups to be listed in asc or desc order. Important for dates.groupByto control sort directionI've included new fixtures for storybook to demonstrate a real world activity list.
Testing Instructions
default. In list or table view, change sorting option to title. Now switch to Activity. It should go back to a date based sort since this is the default layout.Screenshots or screencast