Skip to content

Fix query results column resize auto-scroll#22061

Merged
aasimkhan30 merged 1 commit into
mainfrom
aasim/fix/21365v2
May 7, 2026
Merged

Fix query results column resize auto-scroll#22061
aasimkhan30 merged 1 commit into
mainfrom
aasim/fix/21365v2

Conversation

@aasimkhan30
Copy link
Copy Markdown
Contributor

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 onColumnsResized flow 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

  • New or updated unit tests added
  • All existing tests pass (npm run test)
  • Code follows contributing guidelines
  • Telemetry/logging updated if relevant
  • No regressions or UX breakage

Reviewers: Please read our reviewer guidelines

- 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.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ColumnResizeAutoScroll SlickGrid plugin to manage pointer/mouse resize interactions, auto-scroll, and width clamping while preserving the existing onColumnsResized persistence 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;
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

PR Changes

Category Target Branch PR Branch Difference
vscode-mssql VSIX 78061 KB 78062 KB ⚪ 1 KB ( 0% )
sql-database-projects VSIX 6309 KB 6309 KB ⚪ 0 KB ( 0% )
data-workspace VSIX 535 KB 535 KB ⚪ 0 KB ( 0% )
keymap VSIX 7 KB 7 KB ⚪ 0 KB ( 0% )

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 6, 2026

Codecov Report

❌ Patch coverage is 19.88473% with 278 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.79%. Comparing base (b4542ac) to head (7da3062).

Files with missing lines Patch % Lines
...ult/table/plugins/columnResizeAutoScroll.plugin.ts 19.88% 278 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
data-workspace 77.10% <ø> (ø)
mssql 74.47% <19.88%> (-0.18%) ⬇️
sqlproj 77.36% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ult/table/plugins/columnResizeAutoScroll.plugin.ts 19.88% <19.88%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aasimkhan30 aasimkhan30 merged commit 922d907 into main May 7, 2026
7 checks passed
@aasimkhan30 aasimkhan30 deleted the aasim/fix/21365v2 branch May 7, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Last column on results grid cannot be resized correctly.

4 participants