-
Notifications
You must be signed in to change notification settings - Fork 100
[ENHANCEMENT] Table supports legend variation of selection behavior #1261
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
- `Table` component now includes an optional `rowSelectionVariant` prop that can be used to change the row selection behavior. - The 'standard' `rowSelectionVariant` (default) behaves using standard checkbox behavior (clicking a checkbox toggles selection of the row). - The 'legend' `rowSelectionVariant` follows the legend behavior of "focusing" the selected row. When a modifier key (meta or shift) is pressed, it will behave like 'standard'. - The 'table' `mode` of `Legend` now uses the 'legend' `rowSelectionVariant`. Signed-off-by: Julie Pagano <julie.pagano@chronosphere.io>
@@ -260,7 +260,7 @@ export const SelectedItems: StoryObj<LegendProps> = { | |||
{legendModes.map((mode) => { | |||
return ( | |||
<StorySection key={mode} title={mode} level="h4"> | |||
<LegendWrapper | |||
<UncontrolledLegendWrapper |
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.
Swapping this to make it easier to see the selection working.
// Note that this behavior needs to be kept in sync with behavior in | ||
// the Legend component for list-based legends. |
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.
There really isn't a great way to use a single util for this because the table and legend list have some different interaction patterns and technical implementations.
* | ||
* @default 'standard' | ||
*/ | ||
rowSelectionVariant?: 'standard' | 'legend'; |
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 added a variant instead of just modifying the table behavior because the "legend" behavior is kind of weird for checkboxes and probably isn't want we want in non-legend table use cases.
Signed-off-by: Julie Pagano <julie.pagano@chronosphere.io>
Signed-off-by: Julie Pagano <julie.pagano@chronosphere.io>
I need to do some syncing with @foxbat07 on the behavior here. Please do not merge this until I follow-up on that late today or early tomorrow. |
Signed-off-by: Julie Pagano <julie.pagano@chronosphere.io>
I synced with @foxbat07, and we agreed this was a good incremental improvement. He'll sync up with some other designers, and we may iterate a bit in follow-ups, but this is good for now. I also adjusted the checkbox size a little bit based on his feedback while we were reviewing. |
Table
component now includes an optionalrowSelectionVariant
prop that can be used to change the row selection behavior.rowSelectionVariant
(default) behaves using standard checkbox behavior (clicking a checkbox toggles selection of the row).rowSelectionVariant
follows the legend behavior of "focusing" the selected row. When a modifier key (meta or shift) is pressed, it will behave like 'standard'.mode
ofLegend
now uses the 'legend'rowSelectionVariant
.Checklist
[<catalog_entry>] <commit message>
naming convention using one of the followingcatalog_entry
values:FEATURE
,ENHANCEMENT
,BUGFIX
,BREAKINGCHANGE
,IGNORE
.UI Changes
Screenshots
Showing list and table legend selecting behaving the same
Screen.Recording.2023-06-20.at.5.23.02.PM.mov
Showing two variants of selection for table
Screen.Recording.2023-06-20.at.5.24.40.PM.mov
Showing table legend with new behavior in a time series panel
Screen.Recording.2023-06-20.at.5.26.16.PM.mov