Skip to content

feat: Add reusable BottomSheet component - #1653

Open
KhushamBansal wants to merge 10 commits into
layer5io:masterfrom
KhushamBansal:feat/bottomsheet
Open

feat: Add reusable BottomSheet component#1653
KhushamBansal wants to merge 10 commits into
layer5io:masterfrom
KhushamBansal:feat/bottomsheet

Conversation

@KhushamBansal

@KhushamBansal KhushamBansal commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Notes for Reviewers

This PR fixes #

Dark mode:

Screen.Recording.2026-07-16.at.8.30.14.PM.mov

Light mode:

Screen.Recording.2026-07-16.at.8.31.07.PM.mov

Signed commits

  • Yes, I signed my commits.

Summary by CodeRabbit

  • New Features
    • Added a bottom-docked sheet component that slides up from the bottom of the screen.
    • Supports controlled opening and closing, configurable height, scrollable content, and optional titles.
    • Added an accessible close button with customizable labeling and styling options.
    • Exposed the component for use throughout the application.

Signed-off-by: KhushamBansal <kbkhushambansal@gmail.com>

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces a new mobile-friendly BottomSheet component that slides up from the bottom of the screen. The feedback recommends exposing the close button's aria-label as a configurable prop (closeButtonAriaLabel) instead of hardcoding the string 'Close' to support internationalization (i18n) and localization.

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.

Comment thread src/custom/BottomSheet/BottomSheet.tsx Outdated
Comment thread src/custom/BottomSheet/BottomSheet.tsx Outdated
Signed-off-by: KhushamBansal <kbkhushambansal@gmail.com>
Signed-off-by: KhushamBansal <kbkhushambansal@gmail.com>

@leecalcote leecalcote left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Goooooood work here. 🥇 Let's reinforce this work and make it super solid, defined once, reused everywhere by ensuring:

  1. no deviances in its use should be necessary; no maintenance need in BottomSheet or in the components that use it. This should be a one-time effort. For example, given its use in the display of mui-datatable column checkboxes or mui-datatable filter choices, the instances of those mui-datatables should not need to wire up to the BottomSheet - this shall be dynamic; neither component should require no consideration on an ongoing basis in either BottomSheet or in mui-datatables.
  2. How does this compare to what we have in meshery-cloud on the /catalog page?
  3. Is there an open issue to migrate that implementation to a centralized component?
  4. What learnings are being taken from the component in meshery-cloud?
  5. In what ways is this the best possible version of a "BottomSheet" component? Were are our examples of mui-datatables using this component to display filters?
  6. Is there an open issue to centrally and pervasively incorporate this BottomSheet component into use of each and every mui-dtatatable and to have code written once-only that defines when to activate and deactivate the BottomSheet (so the mobile experience is simply implicit)?

Answer here and/or link to each of the GH issues that you open in response to these items. Don't merge this unless my requirements above are being met.

@KhushamBansal

KhushamBansal commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@leecalcote @aabidsofi19
Some points I want to highlight. Please correct me if I am wrong.

  • (answer 1) I hadn't considered mui-datatables/meshery-cloud earlier, as I considered the fix only for Registry (both meshery-ui and Kanvas).
  • After going through the codebase now, I found that the mui-datatable filters work perfectly fine on mobile viewports (though the UI can be improved), as they use popover.js for their internal filter/column menus (screenshot attached).
Screenshot 2026-06-24 at 12 46 10 PM
  • (answer 2,4) I have only read access to meshery-cloud. Could you provide me with access to clone the repository? It will make it easier for me to explore the codebase as we can search only specific files using github search and not components/keywords.

Conclusion

  • (answer 1, 5,6) We need to add mobile viewport support in MeshModelComponent.tsx, as it uses MesheryTreeView. We also need a BottomSheet in MeshModelDetails for mobile view. So, mui-datatable is not used here.
  • (answer 3) No
  • mui-datatables already handles mobile viewports. So, no need to open new issue for this.
  • BottomSheet was designed to display component details in a popup instead of Panel-2, as layout was broken on mobile viewports.
Screenshot 2026-06-24 at 12 49 02 PM

@leecalcote

Copy link
Copy Markdown
Member

Consider using the same approach used for other components.

@KhushamBansal

Copy link
Copy Markdown
Contributor Author

Thanks @leecalcote for your suggestion. I found that we can also use the <Modal> component to display the registry component details, as it's already used in Meshery UI. I've attached a demo video.
Please let me know which approach you prefer: BottomSheet (demo in the PR description) or Modal (demo attached).

If you think we should go ahead with <Modal>, I'll close this PR.

Screen.Recording.2026-06-25.at.12.23.30.PM.mov

@Bhumikagarggg

Copy link
Copy Markdown
Contributor

@KhushamBansal Thank you for your contribution! Let's discuss this during the website call tomorrow at 5:30 PM IST | 7 AM CST Add it as an agenda item to the meeting minutes, if you would 🙂

@KhushamBansal

Copy link
Copy Markdown
Contributor Author

Thanks @leecalcote for your suggestion. I found that we can also use the <Modal> component to display the registry component details, as it's already used in Meshery UI. I've attached a demo video. Please let me know which approach you prefer: BottomSheet (demo in the PR description) or Modal (demo attached).

If you think we should go ahead with <Modal>, I'll close this PR.

Screen.Recording.2026-06-25.at.12.23.30.PM.mov

@leecalcote Which approach would you recommend?

Signed-off-by: Khusham Bansal <142911972+KhushamBansal@users.noreply.github.com>
@KhushamBansal
KhushamBansal requested a review from leecalcote July 6, 2026 07:36
@PARTH-TUSSLE

PARTH-TUSSLE commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@KhushamBansal I'd prefer sticking with the Modal component as it is already being used in Meshery UI . If you cannot find other usecases where we can use the BottomSheet component, Modal component should be it.

@KhushamBansal

Copy link
Copy Markdown
Contributor Author

@PARTH-TUSSLE We don't currently have a BottomSheet(or similar) component in Sistent. It was discussed in the meeting that we should add one, as it can be reused across multiple components.

@PARTH-TUSSLE

PARTH-TUSSLE commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@PARTH-TUSSLE We don't currently have a BottomSheet(or similar) component in Sistent. It was discussed in the meeting that we should add one, as it can be reused across multiple components.

Then it might make sense to add another component and I took a look at meshery/meshery#20188 this PR which ig already solves this issue. So would you then replace the current fix to use the BottomSheet component?

KhushamBansal and others added 2 commits July 16, 2026 20:24
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 795dc597-ad84-4595-9fe3-b645eb8c59e0

📥 Commits

Reviewing files that changed from the base of the PR and between 4fbbba6 and 117ce36.

📒 Files selected for processing (2)
  • src/custom/BottomSheet/BottomSheet.tsx
  • src/custom/index.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/custom/index.tsx
  • src/custom/BottomSheet/BottomSheet.tsx

📝 Walkthrough

Walkthrough

Adds a controlled MUI-based BottomSheet with bottom-up animation, optional titled header and close control, configurable styling, scrollable content, and public barrel exports.

Changes

Bottom sheet component

Layer / File(s) Summary
BottomSheet component and public exports
src/custom/BottomSheet/BottomSheet.tsx, src/custom/BottomSheet/index.ts, src/custom/index.tsx
Defines the BottomSheetProps API, bottom-up dialog transition, bottom-docked layout, optional header and close button, accessible labeling, scrollable children, and package-level exports.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Consumer
  participant BottomSheet
  participant Dialog
  participant SlideUp
  participant IconButton
  Consumer->>BottomSheet: Set open and provide content
  BottomSheet->>Dialog: Render dialog with open and onClose
  Dialog->>SlideUp: Animate from bottom
  Dialog-->>Consumer: Display header and scrollable content
  Consumer->>IconButton: Activate close control
  IconButton->>BottomSheet: Invoke onClose
  BottomSheet-->>Consumer: Report close event
Loading

Suggested reviewers: aabidsofi19, leecalcote, saurabhraghuvanshii, bhumikagarggg

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: adding a reusable BottomSheet component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/custom/index.tsx (1)

186-194: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Duplicate export * from './LiquidGlass'; line.

Line 186 already re-exports ./LiquidGlass; line 193 duplicates it verbatim before the new ./BottomSheet export on line 194. This looks like a leftover from a bad merge/copy when adding the BottomSheet export.

🧹 Proposed fix
 export * from './Workspaces';
-export * from './LiquidGlass';
 export * from './BottomSheet';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/custom/index.tsx` around lines 186 - 194, Remove the duplicate `export *
from './LiquidGlass';` entry from the module export list, keeping the existing
`LiquidGlass` re-export and the new `BottomSheet` export intact.
src/custom/Modal/index.tsx (1)

161-172: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Stale comment contradicts the new omit(props, ['fullWidth']) call.

The comment states that stripping fullWidth is unnecessary because the explicit fullWidth={!fullScreen} prop applied later (line 189) always wins ("that explicit prop is applied after {...restProps}... intentionally overridden without needing to strip it here"), yet the code right below now explicitly strips it via omit. Either the comment is outdated and should explain why omitting was still added (e.g., to keep restProps's inferred type from carrying a fullWidth key), or the omit call is redundant given the later override and can be dropped. Leaving both as-is will confuse future readers about the actual rationale.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/custom/Modal/index.tsx` around lines 161 - 172, Resolve the contradiction
between the comment and the destructuring in the Modal component: either remove
the redundant fullWidth omission from omit(props, ['fullWidth']) or update the
comment to accurately document why fullWidth is intentionally omitted, such as
preserving the inferred restProps type. Keep the StyledDialog fullWidth override
behavior unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/custom/BottomSheet/BottomSheet.tsx`:
- Around line 64-101: Update the BottomSheet header styling to use semantic
Sistent theme palette tokens for both the default header text color and the
close icon fill. Replace the raw `#eee` fallback in the header Box and hardcoded
`#fff` SVG fill in the IconButton styles, while preserving the existing explicit
headerTextColor override and theme-based background behavior.
- Line 8: Remove the unused Divider import from BottomSheet.tsx while leaving
the rest of the BottomSheet implementation unchanged.

---

Outside diff comments:
In `@src/custom/index.tsx`:
- Around line 186-194: Remove the duplicate `export * from './LiquidGlass';`
entry from the module export list, keeping the existing `LiquidGlass` re-export
and the new `BottomSheet` export intact.

In `@src/custom/Modal/index.tsx`:
- Around line 161-172: Resolve the contradiction between the comment and the
destructuring in the Modal component: either remove the redundant fullWidth
omission from omit(props, ['fullWidth']) or update the comment to accurately
document why fullWidth is intentionally omitted, such as preserving the inferred
restProps type. Keep the StyledDialog fullWidth override behavior unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: cee10d6c-62c7-4975-85a4-97abb10d101f

📥 Commits

Reviewing files that changed from the base of the PR and between 846866a and 235fa51.

📒 Files selected for processing (4)
  • src/custom/BottomSheet/BottomSheet.tsx
  • src/custom/BottomSheet/index.ts
  • src/custom/Modal/index.tsx
  • src/custom/index.tsx

Comment thread src/custom/BottomSheet/BottomSheet.tsx Outdated
Comment thread src/custom/BottomSheet/BottomSheet.tsx
KhushamBansal and others added 2 commits July 25, 2026 13:13
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Khusham Bansal <142911972+KhushamBansal@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Khusham Bansal <142911972+KhushamBansal@users.noreply.github.com>
@Bhumikagarggg
Bhumikagarggg self-requested a review July 27, 2026 12:17
@Bharath314

Copy link
Copy Markdown
Contributor

Can you merge master again? This version of sistent is not compatible with latest meshery.

@Bharath314 Bharath314 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.

Please run prettier on the newly added files.

Apart from that, animations don't work on Firefox for some reason, but I think that the issue might be somewhere else. If the fix isn't within the current files, it might be a good idea to raise an issue for this once this is merged.

2026-07-28.16-10-44.mp4

Comment thread src/custom/index.tsx Outdated
Comment thread src/custom/index.tsx Outdated
Comment thread src/custom/Modal/index.tsx
@Bharath314

Bharath314 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

For other reviewers wanting to preview this component, feel free to clone this branch. It implements BottomSheet.

Signed-off-by: KhushamBansal <kbkhushambansal@gmail.com>
@KhushamBansal

Copy link
Copy Markdown
Contributor Author

@Bharath314 I have made all the suggested changes. Thanks for reviewing.

@Bharath314 Bharath314 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.

LGTM! 🚀

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.

7 participants