feat: add schematic sheet selector to switch between sheets#235
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
imrishabh18
approved these changes
Jun 30, 2026
seveibar
approved these changes
Jun 30, 2026
seveibar
left a comment
Contributor
There was a problem hiding this comment.
Not clickable on mobile!
|
Thank you for your contribution! 🎉 PR Rating: ⭐⭐⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the ability to view independent schematic sheets in the schematic viewer. Multi-sheet circuits (using
<schematicsheet />) previously rendered all sheets merged together with no way to switch between them.A "Sheet:" dropdown now appears in the top-left toolbar whenever a circuit has more than one schematic sheet. Selecting a sheet renders only that sheet, using
circuit-to-svg's built-inschematicSheetIdoption (no manual DOM filtering).Changes
SchematicSheetSelector(new) — a standalone RadixDropdownMenu(@radix-ui/react-dropdown-menu, same lib as the 3d-viewer) showing the active sheet with a check on the selection and an animated chevron. Only renders when there are 2+ sheets; width fits the longest name (with ellipsis + tooltip for very long names).SchematicViewer— derives the sheet list from the circuit JSON, tracks the active sheet, passesschematicSheetIdtoconvertCircuitJsonToSchematicSvg, and filters the clickable component/port overlays to the active sheet so they line up with what's drawn. Single/no-sheet circuits are unchanged. New optionalonSchematicSheetChangecallback.localStorageand restored on reload (falls back to the first sheet if it no longer exists). AddsgetStoredString/setStoredStringhelpers.ViewMenu— migrated the 3-dots menu to RadixDropdownMenufor proper dismiss/keyboard/positioning;ViewMenuIconis now the Radix trigger (<button>, ref-as-prop, noforwardRef).schematic-sheet.ts(new) — sharedSchematicSheetInfotype +getSchematicSheetLabelhelper (display_name ?? name ?? "Sheet N").example23-multiple-schematic-sheets.fixture.tsx(new) — LED driver on Sheet 1, RC filter on Sheet 2.