feat: cell-detail right-hand drawer horizontal resize (#101)#112
Merged
Conversation
Adds a drag handle to the cell-detail/rows-viewer drawer's left edge, shared by openCellDetail and openRowsViewer via a new 'drawer' axis on splitters.js's dragValue/startDrag, clamped to 320px..92vw and persisted as cellDrawerPx. Fixes a click-through where finishing a drag with the mouse released over the backdrop would close the drawer (the post-mouseup click targets the nearest common ancestor of the mousedown/mouseup targets, bypassing the panel's stopPropagation). Code review surfaced a related gap: closing the drawer mid-drag (e.g. Escape while the mouse button is still down) left the drag's listeners attached after the panel was removed, so a later unrelated mouseup could persist a stale width and a later unrelated click could be silently swallowed. startDrag now returns a cancel() that both drawers' close() calls first. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
What & why
Closes #101. Adds a drag handle to the right-hand cell-detail / rows-viewer drawer's left edge (
.cd-panel,src/ui/results.js), shared byopenCellDetailandopenRowsViewer, so users can widen it to comfortably read long values/rows. Reusessplitters.js's drag controller (a new'drawer'axis alongsidecol/sideRow/row) rather than a third bespoke resize implementation, per the issue's guidance. Width is clamped to320px..92vwand persisted ascellDrawerPx— one shared value for both drawers.Fixes the issue's flagged correctness catch: finishing a resize drag with the mouse released over
.cd-backdrop(not.cd-panel) previously closed the drawer, since the browser's post-mouseupclicktargets the nearest common ancestor of the mousedown/mouseup targets, bypassing the panel's ownstopPropagation. A one-shot capturingclicklistener installed at drag-start swallows exactly that click.Code review (8-angle parallel pass) surfaced one additional, real gap beyond the issue's own scope: closing the drawer mid-drag (e.g. pressing Escape while the mouse button is still down, before the drag's own mouseup/click ever fires) left the drag's
mousemove/mouseup/click-swallow listeners attached after the panel was removed — a later, completely unrelated mouseup would still persist a stalecellDrawerPx, and a later unrelated click would be silently swallowed. Fixed:startDragnow returns acancel(), wired into both drawers'close(), which also reverts the width to its pre-drag value.A broader, pre-existing pattern was found and filed separately rather than fixed here (out of scope for a resize-handle issue):
.cd-backdrop'sonclick:closedoesn't check where the correspondingmousedownoriginated, so e.g. dragging a text selection past the panel edge has the same close-on-drag-release bug — see #110, deferred to the planned sharedDrawerprimitive (#60).Verified live against a real ClickHouse cluster (
npm run local+ Playwright): drag-resize, clamp bounds, persistence across reload, no-close-after-drag, and the Escape-mid-drag cancel path all confirmed working, including the zoom-scale compensation math (this app'shtml{zoom}factor was non-1 in the test viewport, and the handle tracked the cursor 1:1 regardless).Checklist
npm testpasses (the per-file coverage gate is non-negotiable)npm run buildsucceeds (single-filedist/sql.html)src/core/, network insrc/net/(injected fetch), DOM insrc/ui/CHANGELOG.md([Unreleased]) updatedTest plan
npm test— 1272 tests, 100% coverage gate greennpm run build—dist/sql.htmlbuildsnpm run test:e2e— 39 Playwright tests (chromium/firefox/webkit) greennpm run local+ Playwright (see PR description)🤖 Generated with Claude Code