-
Notifications
You must be signed in to change notification settings - Fork 4.6k
DataViews: Add groupByField support to grid layout #70752
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
Changes from 1 commit
5339afb
2ceb8b8
117f4c0
aeac8fc
fef3502
703aa6c
5b8663f
1a733ad
d97929e
e2235dc
8ac0e2c
4aef87a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Add groupByField property to ViewBase interface and implement grouping functionality in grid layout. When groupByField is specified, data is grouped by the field value and displayed with group headers. Each group maintains the same grid layout structure while being visually separated. Changes: - Add groupByField property to ViewBase type - Implement grouping logic in grid layout component - Add styling for group headers - Add GroupedGridLayout story to demonstrate the feature 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -419,6 +419,11 @@ interface ViewBase { | |
| * Whether to show the hierarchical levels. | ||
| */ | ||
| showLevels?: boolean; | ||
|
|
||
| /** | ||
| * The field to group by. | ||
| */ | ||
| groupByField?: string; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any thoughts on a UI to configure this? (not necessary for this PR) Also would be good to document this in the README.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done at d97929e
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The obvious way is to add a new select in the view config somewhere. Alternatively, we could explore making it part of the field list (similarly to what we have for the media field). |
||
| } | ||
|
|
||
| export interface ColumnStyle { | ||
|
|
||
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.
What if just the
datachanges? Don't we risk showing obsolete memoized data that way?I know this is in a story, but folks tend to copy code from stories, so we need to be mindful about it.
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.
In this case,
dataandfieldswon't change because they are static arrays.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.
Not sure I was clear enough - my worry is about people copying the code from stories and it potentially leading to the issues I mentioned.
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.
I understand that viewpoint, but I'm reluctant to add unnecessary code to cover misuse — that's not something I've seen us doing.