feat(DataTableToolbar): add reusable toolbar component for Meshery UI migration#1664
feat(DataTableToolbar): add reusable toolbar component for Meshery UI migration#1664Uday9909 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the DataTableToolbar component, along with its corresponding TypeScript types and unit tests. The feedback highlights a few improvement opportunities: removing an ineffective zIndex property from the toolbar root styled component, adding responsive wrapping to the Section component to prevent horizontal overflow on mobile screens, and strengthening the unit test assertion for custom sx styles to verify they are actually applied.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| const Section = styled(Box)(({ theme }) => ({ | ||
| display: 'flex', | ||
| alignItems: 'center', | ||
| gap: theme.spacing(1) | ||
| })); |
There was a problem hiding this comment.
On mobile screens (down('sm')), the toolbar items inside Section (such as multiple action buttons or search/filter inputs) can overflow horizontally because Section does not wrap. Adding responsive wrapping to Section ensures a better mobile layout.
const Section = styled(Box)(({ theme }) => ({
display: 'flex',
alignItems: 'center',
gap: theme.spacing(1),
[theme.breakpoints.down('sm')]: {
flexWrap: 'wrap',
width: '100%'
}
}));
Add DataTableToolbar — a pure presentational layout shell that provisions
named slots for toolbar actions:
- Left section: primaryActions, secondaryActions
- Right section: filter, search, columnVisibility, viewSwitch
All slots are optional ReactNode render props. Key decisions:
- Uses Sistent theme tokens exclusively (no hardcoded px/rem)
- Responsive via theme.breakpoints.down('sm') — no useMediaQuery
- Accepts sx prop for consumer overrides
- Replaces ToolWrapper's fixed height with flexible minHeight
Part of meshery/meshery#18965 follow-up.
Signed-off-by: Udaybir Singh <writetoudaybir@gmail.com>
a301426 to
7a17104
Compare
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Udaybir Singh <writetoudaybir@gmail.com>
|
@KhushamBansal ready for PR review! |
KhushamBansal
left a comment
There was a problem hiding this comment.
@Uday9909 Have you tested this locally? If yes, please attach screen recording to the PR description.
Description
Adds a reusable
DataTableToolbarcomponent to replace Meshery UI'sToolWrapper. This is a pure presentational layout shell that provisions named slots for toolbar actions.Component API
primaryActionssecondaryActionsfiltersearchcolumnVisibilityviewSwitchsxKey Decisions
theme.breakpoints.down('sm')— nouseMediaQuery, nowindow.innerWidthminHeight— replaces ToolWrapper's fixed 4rem heightsxprop — allows consumer overrides without per-page CSSFixes
Files Changed
Verification