Skip to content

[ResponsiveDataTable] Keep wide tables within their container - #1909

Open
shibadityadeb wants to merge 2 commits into
layer5io:masterfrom
shibadityadeb:fix/1861-table-overflow
Open

shibadityadeb wants to merge 2 commits into
layer5io:masterfrom
shibadityadeb:fix/1861-table-overflow

Conversation

@shibadityadeb

@shibadityadeb shibadityadeb commented Dec 2, 2026 •

Copy link
Copy Markdown

Notes for Reviewers

This PR fixes #1861

Problem: In the Kanvas catalog's list view, the table grew wider than its container and covered the filter sidebar.

Fix: ResponsiveDataTable now wraps the table in a container that wide columns cannot stretch, so the table scrolls sideways instead.

Testing: Reproduced the issue on kanvas.new, then checked the fix by running Meshery UI locally with this change and opening Kanvas.

After the fix:

fix-1861.mp4

Signed commits

  • Yes, I signed my commits.

Summary by CodeRabbit

  • Bug Fixes
    • Improved data table layout so it fills the available width and adapts more reliably to narrow screens, helping prevent content from forcing the table beyond its container.

Fixes layer5io#1861

Signed-off-by: Shibaditya Deb <shibadityadeb.official@gmail.com>
Copilot AI balanced review requested due to automatic review settings December 2, 2026 13:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

ResponsiveDataTable now wraps MUIDataTable in a full-width grid container with one minmax(0, 1fr) column. The table’s existing props and options remain unchanged. A rendering test checks the container’s display, column definition, and width.

Changes: Responsive table container

Layer / File(s) Summary
Define and apply the table container
src/custom/ResponsiveDataTable.tsx, src/__testing__/ResponsiveDataTable.test.tsx
The component defines a full-width grid container with one minmax(0, 1fr) column and uses it to wrap MUIDataTable. The test checks the container’s display, column definition, and width.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: khushambansal

Merge Risk: Minimal · up to 0f359

Wide tables should now stay inside their container and scroll horizontally instead of overlapping the sidebar. The change is small and easy to revert, and no actionable merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the ResponsiveDataTable component and the goal of keeping wide tables inside their container. The change wraps MUIDataTable in a full-width grid with a zero minimum-width column, so wi…
Linked Issues check Passed [#1861] requires that the Catalog list-view table stay inside its container when its content is wider, scroll inside its own box, and not cover the Owner / Class / Technology sidebar. This applies reg…
Out of Scope Changes check Passed The whole-PR change set contains two files. src/custom/ResponsiveDataTable.tsx adds the TableContainer wrapper, its #1861 comment, and the wrapping of the existing MUIDataTable element. Its props, opt…
Full details: Title check

Explanation

The title names the ResponsiveDataTable component and the goal of keeping wide tables inside their container. The change wraps MUIDataTable in a full-width grid with a zero minimum-width column, so wide tables stay within the container. The title matches the main change and the linked issue about overlap with the sidebar.

Full details: Linked Issues check

Explanation

[#1861] requires that the Catalog list-view table stay inside its container when its content is wider, scroll inside its own box, and not cover the Owner / Class / Technology sidebar. This applies regardless of visible columns or consumer layout. At the reviewed head, src/custom/ResponsiveDataTable.tsx wraps the existing MUIDataTable element in a TableContainer styled div with display 'grid', gridTemplateColumns 'minmax(0, 1fr)', and width '100%'. The zero-minimum track lets the table shrink to the container width, so overflow falls to MUIDataTable's own scroll area. The change sits in the shared component, so every consumer receives it. src/testing/ResponsiveDataTable.test.tsx now includes an automated test that asserts the parent of the mocked table has these three computed styles. That test checks the CSS contract, not rendered overflow in a real browser. The PR description also reports a manual before/after recording on Kanvas. The coding requirement is met. Residual uncertainty: the test runs under jsdom, so it does not prove the visual result.

Full details: Out of Scope Changes check

Explanation

The whole-PR change set contains two files. src/custom/ResponsiveDataTable.tsx adds the TableContainer wrapper, its #1861 comment, and the wrapping of the existing MUIDataTable element. Its props, options, and exported declarations are unchanged. src/testing/ResponsiveDataTable.test.tsx adds one test that verifies the new container styles. Both changes directly support the containment objective of #1861. No unrelated behavior is added. Note: the repository diff could not be read in this review, so the scope was checked from the file contents at head and the supplied summary.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b39d7ec9-8669-46af-9cb6-8afda3cca244
Commits

Reviewing files that changed from the base of the PR and between 05b6c1c and 0f35981.

Files selected for processing: 1

  • src/__testing__/ResponsiveDataTable.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@sarajkrishnasingh sarajkrishnasingh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice, focused fix for #1861. The issue is clear: in the Kanvas catalog list view the table grew wider than its container and covered the filter sidebar. Wrapping MUIDataTable in a grid container with minmax(0, 1fr) is the right minimal constraint, and the comment in the code explains the why. The video in the PR description shows the table staying inside its container after the fix.

Checks are green (DCO, triage, CodeRabbit).

One gap to name: no automated test ships with this change. The fix rests on your manual reproduction on kanvas.new and the local Meshery UI check, which is reasonable for a layout fix, but nothing in the repo would catch a regression if this wrapper is later removed or the table is restructured. The repo already has a Jest suite, so a test rendering ResponsiveDataTable with wide columns and asserting it stays within its container would be the durable place for it. No docs update is needed since this changes no public API.

@leecalcote
leecalcote removed the request for review from simihablo December 2, 2026 14:00
Signed-off-by: Shibaditya Deb <shibadityadeb.official@gmail.com>
@shibadityadeb

Copy link
Copy Markdown
Author

Thanks for the review! I've added a Jest test for the container. Since jsdom doesn't calculate layout, it checks the container's styles rather than the rendered width, so it will fail if the wrapper is removed or its styles change.

@sarajkrishnasingh sarajkrishnasingh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for adding the test. The new test covers the wrapper styles, so it will catch a regression if the container is removed or its styles change, and it closes the gap from my earlier comment. The fix itself stays focused: the minmax(0, 1fr) grid wrapper keeps wide tables inside their container, matching issue #1861 and the video in the PR description. DCO, triage, and CodeRabbit are green, and there are no unresolved threads. Approving.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Catalog]: wide table overflows its container and covers the filter sidebar

3 participants