Moving query results to slickgrid-react#22329
Conversation
…date Observable Collection - Updated IObservableCollection interface to include an optional resetWindows parameter in setLength method. - Modified VirtualizedCollection class to adjust length change behavior based on resetWindows flag. - Expanded HeaderContextMenuProps to support custom actions and freeze action label. - Implemented conditional rendering of context menu items based on available actions, including new Freeze and Unfreeze options. - Added FreezeColumn and UnfreezeColumn actions to HeaderContextMenuAction enum. - Created a new markdown file to track missing features in SlickGrid, outlining completed and pending items.
…or converting displayed selections
… improve class management
# Conflicts: # extensions/mssql/l10n/bundle.l10n.json
…e row number cell backgrounds
…de-mssql into aasim/fix/newGrid
…nd related functionality
… aasim/fix/newGrid
…nd and keyboard handler
…grid functionality - Implemented FluentResultGrid component with accessibility features and customizable styles. - Created FluentResultGridProvider to manage shared state and overlays for grid components. - Added built-in command definitions and placements for grid interactions. - Defined types for grid data sources, commands, and overlays to improve type safety and clarity. - Established a centralized index for exporting grid-related components and types. - Introduced utility functions for managing grid overlays and command tooltips. - Enhanced grid state management with sorting, filtering, and scrolling capabilities. - Added theme support for light, dark, and high contrast modes.
… command resolution
- Introduced FluentResultGridKeyCombination interface to better handle key combinations. - Added rowHeight property to FluentResultGridBehaviorProps for customizable row heights. - Implemented FluentResultGridResizeDialogStrings for improved user experience in resizing columns. - Created QueryResultFluentResultGrid component to replace the previous grid implementation, providing a more robust and feature-rich grid experience. - Updated QueryResultsBetaGridView to utilize the new Fluent Result Grid. - Enhanced QueryResultsGridView to support external command bar visibility and improved row height calculations based on font settings and padding. - Modified ResultGridProps to include viewMode, canToggleMaximize, isMaximized, and onToggleMaximize for better grid state management.
… signature generation
…improved toolbar layout
… in FluentResultGrid
PR Changes
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #22329 +/- ##
==========================================
- Coverage 88.22% 87.65% -0.58%
==========================================
Files 397 316 -81
Lines 126840 112118 -14722
Branches 7959 558 -7401
==========================================
- Hits 111910 98278 -13632
+ Misses 14930 13840 -1090
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR introduces a new Fluent-themed SlickGrid React-based query results experience behind a preview feature flag, aiming to improve rendering performance and add richer column customization while maintaining visual parity with the existing results grid.
Changes:
- Adds a reusable
FluentResultGridwebview component (provider, commands, overlays, toolbar, data view) and wires it into Query Results behindmssql.preview.betaResultsGrid. - Extends query result state persistence (server-side singleton store + RPC) to include grid “view state” (hidden columns, frozen column, selection) in addition to widths/filters/scroll.
- Updates layout/keyboard-navigation behaviors in the query results grid view and adds unit tests for new selection/state logic.
Reviewed changes
Copilot reviewed 50 out of 50 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| localization/xliff/vscode-mssql.xlf | Localization entries for new preview/commands (auto-generated localization file). |
| extensions/mssql/test/unit/singletonStore.test.ts | Tests for deleting persisted gridViewStates with URI state. |
| extensions/mssql/test/unit/gridSelectionUtils.test.ts | Adds unit tests for displayed→actual selection row conversion. |
| extensions/mssql/src/webviews/pages/QueryResult/resultGrid.tsx | Expands ResultGrid props to support maximize/view-mode integration. |
| extensions/mssql/src/webviews/pages/QueryResult/queryResultsTab.tsx | Switches between old grid and Fluent grid based on feature flag. |
| extensions/mssql/src/webviews/pages/QueryResult/queryResultsGridView.tsx | Improves sizing/layout logic and supports injectable grid component + command bar behavior. |
| extensions/mssql/src/webviews/pages/QueryResult/queryResultPane.tsx | Uses “Results Preview” strings/tooltips when beta grid flag is enabled. |
| extensions/mssql/src/webviews/pages/QueryResult/queryResultFluentResultGrid.tsx | New Query Results wrapper for FluentResultGrid (provider, commands, strings, RPC wiring). |
| extensions/mssql/src/webviews/pages/QueryResult/commandBar.tsx | Adds capture handler/data attribute to support Shift+Tab focus behavior. |
| extensions/mssql/src/webviews/media/slickgrid.css | Minor header layout tweaks (min-width/margin) to prevent truncation issues. |
| extensions/mssql/src/webviews/common/useVscodeSelector.ts | Reworks selector subscription logic for webview state slices. |
| extensions/mssql/src/webviews/common/locConstants.ts | Adds localized strings for “Results Preview” and “Show all columns”. |
| extensions/mssql/src/webviews/common/FluentSlickGrid/FluentSlickGrid.tsx | Wraps SlickgridReact to work around customDataView initialization bug. |
| extensions/mssql/src/webviews/common/FluentResultGrid/index.ts | Barrel exports for the new reusable Fluent grid package. |
| extensions/mssql/src/webviews/common/FluentResultGrid/types/fluentResultGridTheme.ts | Theme metadata contract for the Fluent grid. |
| extensions/mssql/src/webviews/common/FluentResultGrid/types/fluentResultGridStrings.ts | Localizable string contracts + merge helper. |
| extensions/mssql/src/webviews/common/FluentResultGrid/types/fluentResultGridState.ts | Grid state types (filters/sort/scroll + view state). |
| extensions/mssql/src/webviews/common/FluentResultGrid/types/fluentResultGridProps.ts | Public props/handle contracts for the reusable grid. |
| extensions/mssql/src/webviews/common/FluentResultGrid/types/fluentResultGridPrimitives.ts | Shared primitive types for commands/selection/positioning. |
| extensions/mssql/src/webviews/common/FluentResultGrid/types/fluentResultGridDataSource.ts | Data source contract (in-memory vs windowed). |
| extensions/mssql/src/webviews/common/FluentResultGrid/types/fluentResultGridCommands.ts | Command contribution, placement, and keybinding types/utilities. |
| extensions/mssql/src/webviews/common/FluentResultGrid/types/fluentResultGridCommandIds.ts | Built-in command id definitions. |
| extensions/mssql/src/webviews/common/FluentResultGrid/internal/fluentResultGridTransforms.ts | In-memory filter/sort transforms and filter item building. |
| extensions/mssql/src/webviews/common/FluentResultGrid/internal/fluentResultGridSelection.ts | Selection conversions between SlickRange and data selections. |
| extensions/mssql/src/webviews/common/FluentResultGrid/internal/FluentResultGridResizeDialog.tsx | Fluent resize dialog overlay for column width changes. |
| extensions/mssql/src/webviews/common/FluentResultGrid/internal/fluentResultGridProviderTypes.ts | Provider/overlay typing. |
| extensions/mssql/src/webviews/common/FluentResultGrid/internal/fluentResultGridOverlays.ts | Overlay state models (menu/filter/resize). |
| extensions/mssql/src/webviews/common/FluentResultGrid/internal/FluentResultGridMenuOverlay.tsx | Fluent context menu overlay host and rendering. |
| extensions/mssql/src/webviews/common/FluentResultGrid/internal/fluentResultGridKeyboard.ts | Shortcut matching helpers (structured key combos). |
| extensions/mssql/src/webviews/common/FluentResultGrid/internal/fluentResultGridFormatters.ts | Cell/column formatting helpers for the Fluent grid. |
| extensions/mssql/src/webviews/common/FluentResultGrid/internal/FluentResultGridFilterOverlay.tsx | Fluent filter overlay with virtualization and keyboard handling. |
| extensions/mssql/src/webviews/common/FluentResultGrid/internal/fluentResultGridDataView.ts | CustomDataView implementation for windowed/in-memory row loading. |
| extensions/mssql/src/webviews/common/FluentResultGrid/internal/fluentResultGridConstants.ts | Shared constants for sizing, defaults, and behavior. |
| extensions/mssql/src/webviews/common/FluentResultGrid/internal/fluentResultGridCommandResolution.ts | Resolves contributions into runnable commands per placement/context. |
| extensions/mssql/src/webviews/common/FluentResultGrid/internal/fluentResultGridColumns.ts | Generates SlickGrid column definitions for result sets. |
| extensions/mssql/src/webviews/common/FluentResultGrid/internal/fluentResultGridBuiltInCommands.ts | Built-in command catalog + default placement maps. |
| extensions/mssql/src/webviews/common/FluentResultGrid/FluentResultGridToolbar.tsx | Fluent vertical toolbar with overflow menu and command wiring. |
| extensions/mssql/src/webviews/common/FluentResultGrid/FluentResultGridProvider.tsx | Provider for strings/theme/keybindings and overlay coordination. |
| extensions/mssql/src/webviews/common/FluentResultGrid/FluentResultGrid.vscode.css | VS Code token mappings for Fluent grid theming. |
| extensions/mssql/src/webviews/common/FluentResultGrid/FluentResultGrid.tsx | Main reusable grid component (SlickGrid + toolbar). |
| extensions/mssql/src/webviews/common/FluentResultGrid/FluentResultGrid.css | Base styling for the Fluent grid (cells, headers, focus, etc.). |
| extensions/mssql/src/sharedInterfaces/queryResult.ts | Adds shared GridViewState types and get/set RPC contracts; adds beta flag in webview state. |
| extensions/mssql/src/queryResult/utils.ts | Registers RPC handlers to persist/retrieve GridViewState. |
| extensions/mssql/src/queryResult/singletonStore.ts | Adds gridViewStates storage to singleton grid state. |
| extensions/mssql/src/queryResult/queryResultWebViewController.ts | Plumbs beta flag into initial state and configuration change handling. |
| extensions/mssql/src/previews/previewService.ts | Adds BetaResultsGrid preview feature enum entry. |
| extensions/mssql/package.nls.json | Adds localized description key for the new preview setting. |
| extensions/mssql/package.json | Adds mssql.preview.betaResultsGrid configuration setting. |
| extensions/mssql/l10n/bundle.l10n.json | Localization bundle updates for new strings (auto-generated localization file). |
- Implement tests for transforms, ensuring row IDs are preserved during filtering and sorting. - Validate sorting behavior for nulls, numbers, blanks, and strings. - Normalize selected filter values to handle no active filters. - Test state helper functions to clamp frozen column index within valid range. - Verify command handling to exclude local grid commands from host command forwarding. - Map keyboard shortcuts to command actions, including fallback shortcuts for select-all and focus traversal.
…ks and updating related localization
… aasim/fix/newGrid2
|
|
||
| /** | ||
| * Works around a bug in `slickgrid-react`'s `initialization()`: when a `customDataView` | ||
| * prop is supplied, the library skips assigning its internal `this.dataView` (it only does |
There was a problem hiding this comment.
if there's a bug in Slickgrid-React, feel free to open a PR in my project to fix it 😉
There was a problem hiding this comment.
Yeah, its a todo
|
@aasimkhan30 I left a few PR comments, it's nice to see that you guys are looking into switching all grids to Slickgrid-React and you also got a very close UI match to previous grid too 😃 I would suggest that you take a look at some of my demos which might give you some more ideas for this PR or future ones:
feel free to ping me if you have any questions or need clarifications, you can ping me here or open a new Discussion in my project. Cheers |
…e state management in FluentResultGrid components
…d-react for consistency
…stency across FluentResultGrid components
|
@aasimkhan30 I'm assuming this PR will probably fix issue #22213 even though it will be experimental at first. It's probably good to link the issue nonetheless |
Description
FluentResultGridcomponent with Fluent-styled context menus, filtering, resize dialog, toolbar, grid state handling, and support for contributing custom commands/actions.Follow-Up
Code Changes Checklist
npm run test)Reviewers: Please read our reviewer guidelines