Skip to content

feat(ViewSwitch): add reusable ViewSwitch component#1666

Open
iyush05 wants to merge 1 commit into
layer5io:masterfrom
iyush05:feat/add-view-switch-component
Open

feat(ViewSwitch): add reusable ViewSwitch component#1666
iyush05 wants to merge 1 commit into
layer5io:masterfrom
iyush05:feat/add-view-switch-component

Conversation

@iyush05

@iyush05 iyush05 commented Jun 30, 2026

Copy link
Copy Markdown

Notes for Reviewers

This PR fixes #1663

Description

Add a reusable ViewSwitch component to Sistent

Changes:

  • Created src/custom/ViewSwitch/ViewSwitch.tsx - the component with ViewMode type and ViewSwitchProps interface
  • Created src/custom/ViewSwitch/index.ts - barrel export
  • Updated src/custom/index.tsx - registered ViewSwitch, ViewSwitchProps, and ViewMode exports

Screenshot & Demo

2026-06-30.19-12-35.mov
 PASS  src/__testing__/useWindowDimensions.test.tsx
 PASS  src/__testing__/hideRootObjectTitle.test.tsx
 PASS  src/__testing__/RJSFFormWrapper.test.tsx
 PASS  src/__testing__/Icons.test.tsx

Test Suites: 14 passed, 14 total
Tests:       303 passed, 303 total
Snapshots:   0 total
Time:        2.664 s, estimated 3 s
Ran all test suites.

Signed commits

  • Yes, I signed my commits.

@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 ViewSwitch component to toggle between grid and table view modes. The review feedback highlights a UX bug where the tooltips are inverted relative to the active view mode, an accessibility anti-pattern where the tooltip wraps the inner icon instead of the interactive IconButton, and hardcoded UI strings that should be exposed as props to support internationalization.

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/ViewSwitch/ViewSwitch.tsx
Signed-off-by: Ayush Kannaujiya <ayushkannaujiya@gmail.com>
@iyush05 iyush05 force-pushed the feat/add-view-switch-component branch from 72853e2 to 64fea16 Compare June 30, 2026 11:00

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

@iyush05 Have you tested it locally? If so, can you please attach a demo video?

@iyush05

iyush05 commented Jun 30, 2026

Copy link
Copy Markdown
Author

hi @KhushamBansal i have added the demo video in the pr description please review it.

@iyush05

iyush05 commented Jun 30, 2026

Copy link
Copy Markdown
Author

hi @KhushamBansal i have updated the demo video please review it

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.

ViewSwitch: A standard component to replace meshery-ui ViewSwitch

2 participants