fix: keep query editor toolbar visible with large queries (#173)#176
Conversation
The QueryEditor root had no height constraint, so a tall query grew the editor past its fixed-height parent. Focusing the textarea near the bottom then scrolled the overflow:hidden parent to reveal the caret, dragging the Run/Explain/Format toolbar out of view. Constrain the root with `flex: 1; min-height: 0` so the editor fills its parent and the textarea scrolls internally (via its existing overflowY:auto) while the toolbar stays pinned. Sync the line-number gutter's scrollTop to the textarea so line numbers stay aligned now that the textarea scrolls on its own instead of the whole editor moving as a unit. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@claude review this PR |
|
Claude finished @eugene-mobile's task in 1m 13s —— View job PR Review
Overall: This is a clean, correct, minimal fix. The root cause analysis is accurate and the solution is idiomatic. Root Fix —
|
Problem
Closes #173.
When a query is tall, the editor toolbar (Run / Explain / Format buttons) scrolls out of view, so users can't trigger actions while at the bottom of a large query.
Root cause
QueryEditor's root container is a flex column but had no height constraint. Its parent inApp.tsxis a fixedflex: 0 0 240pxbox withoverflow: hidden. Because the root defaulted toflex: 0 1 auto(and flex items havemin-height: auto, which prevents shrinking below content), a tall query grew the whole editor past 240px. Focusing the textarea near the bottom then made the browser scroll theoverflow:hiddenparent to reveal the caret — dragging the pinned toolbar off the top of the viewport. The textarea's ownoverflowY: autonever engaged because the textarea was never height-bounded.Fix
flex: 1; min-height: 0to the editor root so it fills its fixed-height parent. The boundededitorWrapnow constrains the textarea, whose existingoverflowY: autoscrolls the query internally while the toolbar (flex-shrink: 0) stays pinned and always reachable.scrollTopto the textarea on scroll. Previously the gutter and text scrolled together as one unit via the parent; now that the textarea scrolls on its own, this keeps line numbers aligned with the text.Testing
tsc --noEmitpasses; no new lint errors in the edited file; all 76 unit tests pass.🤖 Generated with Claude Code