Fix query results column resize auto-scroll#22061
Merged
Merged
Conversation
- Implemented the ColumnResizeAutoScroll plugin to enhance column resizing functionality with auto-scrolling. - Integrated the plugin into the Table class. - Added unit tests for the getColumnResizeWidth function to ensure correct resizing behavior. - Updated SlickGrid typings to include getUID method for better integration.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes horizontal auto-scroll during column resizing in the Query Results SlickGrid by introducing a dedicated, non-React SlickGrid plugin that owns resize-handle interactions and keeps resize-driven scrolling working at the webview edges (addressing #21365).
Changes:
- Added a query-results-specific
ColumnResizeAutoScrollSlickGrid plugin to manage pointer/mouse resize interactions, auto-scroll, and width clamping while preserving the existingonColumnsResizedpersistence flow. - Registered the new plugin in the Query Results table initialization.
- Updated SlickGrid typings to include
Grid.getUID()and added unit tests for the resize-width computation helper.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| extensions/mssql/typings/slickgrid.d.ts | Adds getUID() typing needed by the new resize plugin to map header DOM IDs to column IDs. |
| extensions/mssql/test/unit/columnResizeAutoScroll.test.ts | Adds unit coverage for the resize-width/clamping helper used by the plugin. |
| extensions/mssql/src/webviews/pages/QueryResult/table/table.ts | Registers the new ColumnResizeAutoScroll plugin for query results grids. |
| extensions/mssql/src/webviews/pages/QueryResult/table/plugins/columnResizeAutoScroll.plugin.ts | Implements the resize-handle auto-scroll behavior and width clamping, and emits onColumnsResized when done. |
| ): number { | ||
| const unclampedWidth = startWidth + pointerDeltaX + autoScrollDeltaX; | ||
| const widthWithMin = Math.max(minWidth, unclampedWidth); | ||
| return maxWidth ? Math.min(maxWidth, widthWithMin) : widthWithMin; |
PR Changes
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #22061 +/- ##
==========================================
- Coverage 74.95% 74.79% -0.16%
==========================================
Files 393 394 +1
Lines 119869 120216 +347
Branches 7161 7163 +2
==========================================
+ Hits 89847 89916 +69
- Misses 30022 30300 +278
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
caohai
approved these changes
May 7, 2026
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.
Description
Fixes #21365.
Adds a focused non-React SlickGrid plugin for the query results grid that keeps horizontal column-resize auto-scroll working when the pointer reaches or leaves the VS Code webview edge. The plugin owns resize-handle interactions for query results, suppresses the legacy jQuery drag resize path for those handles, applies clamped column widths during resize, and notifies the existing
onColumnsResizedflow so persisted column widths continue to work.Thanks to @ghiscoding and the upstream SlickGrid Universal/SlickGrid React work in ghiscoding/slickgrid-universal#2538, which this query-results-specific implementation is based on.
Code Changes Checklist
npm run test)Reviewers: Please read our reviewer guidelines