fix(sql): scroll long scripts inside the SQL editor (#1480)#1481
Open
shaishab316 wants to merge 1 commit intoprisma:mainfrom
Open
fix(sql): scroll long scripts inside the SQL editor (#1480)#1481shaishab316 wants to merge 1 commit intoprisma:mainfrom
shaishab316 wants to merge 1 commit intoprisma:mainfrom
Conversation
Constrain the SQL panel with flex + overflow so CodeMirror scrolls internally instead of growing the view. Fixes prisma#1480.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR fixes the SQL Console layout issue where very long queries caused the CodeMirror editor to expand vertically, pushing the header (including Run SQL) out of easy reach.
Changes:
- Constrained the SQL view layout using flex +
min-h-0/flex-1/overflow-hiddenso the editor pane height is bounded. - Configured CodeMirror to fill available height (
height="100%") so long content scrolls inside the editor. - Adjusted result grid container flex behavior so the empty result area doesn’t consume space when there’s no result.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ui/studio/views/sql/SqlView.tsx | Introduces bounded flex layout and makes CodeMirror scroll internally; adjusts result container flexing based on presence of results. |
| ui/studio/views/sql/SqlView.test.tsx | Adds a regression test asserting the presence of the new bounded/overflow-hidden editor container. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Fixes prisma/studio#1480: the SQL console editor could grow with very long queries, stretching the layout so Run SQL (and the rest of the header) was hard to reach without zooming or resizing.
What changed
min-h-0/flex-1) so the editor panel has a bounded height.height="100%") so content scrolls inside the editor instead of expanding the whole view.flex-none), so the editor can use the full pane.How to test
pnpm test -- ui/studio/views/sql/SqlView.test.tsxpnpm demo:ppg), open SQL Console, paste a large script, and confirm the editor scrolls internally while Run SQL stays visible in the header.Before
After