Skip to content
Merged
Show file tree
Hide file tree
Changes from 146 commits
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
c74e84c
Add slickgrid-react package
lewis-sanchez Sep 10, 2025
4dad82c
Adds table explorer contracts
lewis-sanchez Sep 10, 2025
5d7c9cf
Setup initial table explorer web view
lewis-sanchez Sep 11, 2025
38ca4d9
Updates TableExplorer to use context
lewis-sanchez Sep 11, 2025
f9ce199
Add preview label to context menu item
lewis-sanchez Sep 11, 2025
00b9df6
Add generated loc
lewis-sanchez Sep 11, 2025
d842fe7
Adds Table Explorer service
lewis-sanchez Sep 11, 2025
a8579de
Initializes Table Explorer session and gets result set
lewis-sanchez Sep 16, 2025
eb7c671
Revert this later
lewis-sanchez Sep 16, 2025
0dcef58
Show SlickGridReact component
lewis-sanchez Sep 16, 2025
cef9ea9
Sets up example SlickGrid component
lewis-sanchez Sep 16, 2025
c014357
Add missing default grid styles
lewis-sanchez Sep 16, 2025
dd0444e
Load table data into data grid
lewis-sanchez Sep 16, 2025
959fabb
Enables table explorer on double click
lewis-sanchez Sep 19, 2025
dd31dcf
Disposes table explorer resources on close
lewis-sanchez Sep 25, 2025
21e6aaa
Get column names from resultSet endpoint
lewis-sanchez Sep 25, 2025
2079e34
Use local tools service
lewis-sanchez Sep 25, 2025
f9cc830
Render grid column names correctly
lewis-sanchez Sep 25, 2025
ee892eb
Show row numbers in data grid
lewis-sanchez Sep 25, 2025
5cb9c78
Minor clean up.
lewis-sanchez Sep 26, 2025
023d7bd
Add exclusions to row number column
lewis-sanchez Sep 26, 2025
14a6ba9
Make grid cells editable on double click
lewis-sanchez Sep 26, 2025
03803f4
Track row and col indices for changed cells
lewis-sanchez Sep 26, 2025
919022d
Enables cell editing and tracks changed cells
lewis-sanchez Sep 30, 2025
347da92
Show 100 rows initially by default
lewis-sanchez Sep 30, 2025
ed0b77c
Adds Table Explorer toolbar
lewis-sanchez Sep 30, 2025
a83bfb5
Remove placeholder text
lewis-sanchez Sep 30, 2025
926173f
Add commitChanges reducer
lewis-sanchez Sep 30, 2025
1ba61c5
Adds data subset loading functionality
lewis-sanchez Sep 30, 2025
7b664a8
Adds tooltips
lewis-sanchez Oct 1, 2025
28d83da
Fix tooltip appearance
lewis-sanchez Oct 1, 2025
57498d0
Adjust grid options affecting grid behavior
lewis-sanchez Oct 1, 2025
54cb11e
Fixes grid row number column alignment
lewis-sanchez Oct 1, 2025
0311b7b
Adds row deletion functionality
lewis-sanchez Oct 2, 2025
45f2064
Enables row creation in table explorer
lewis-sanchez Oct 2, 2025
4933b90
Delete row entry from grid
lewis-sanchez Oct 2, 2025
1e1e959
Enable row deletion from the data grid
lewis-sanchez Oct 2, 2025
18e4217
Add the cell updating reducer
lewis-sanchez Oct 3, 2025
e373f0f
Enables updating cells from the data grid
lewis-sanchez Oct 3, 2025
f736aa8
Adjusts how grid change tracking is cleared
lewis-sanchez Oct 4, 2025
203f459
Adds revert cell functionality
lewis-sanchez Oct 6, 2025
98ac24a
Enables reverting individual cell edits
lewis-sanchez Oct 6, 2025
ba9085c
Cleans up revert cell logic
lewis-sanchez Oct 6, 2025
6aa4316
Updates state after data modifications
lewis-sanchez Oct 6, 2025
8c7773c
Register revert row reducer in controller
lewis-sanchez Oct 7, 2025
1b8c41d
Updates row data after revert operation
lewis-sanchez Oct 7, 2025
1da2f04
Add row revert functionality to data grid
lewis-sanchez Oct 8, 2025
d43419b
Remove default grid context menu commands
lewis-sanchez Oct 8, 2025
0c3f9e0
Add create row functionality in the webview
lewis-sanchez Oct 8, 2025
6d1bd41
Generated loc
lewis-sanchez Oct 8, 2025
a3d3c11
Additional generated loc change
lewis-sanchez Oct 8, 2025
edb7af8
Add interface for Table Explorer Service
lewis-sanchez Oct 9, 2025
6670271
Add unit tests for TableExplorerService
lewis-sanchez Oct 9, 2025
e2978f7
Localize pop up messages
lewis-sanchez Oct 10, 2025
f676556
Generated loc's
lewis-sanchez Oct 10, 2025
95696b0
Show NULL in columns for newly added rows
lewis-sanchez Oct 10, 2025
953de4f
Enables editing only for editable columns
lewis-sanchez Oct 10, 2025
64fb2ed
Escapes angle brackets in new rows
lewis-sanchez Oct 10, 2025
8f28b92
Removes query result limit.
lewis-sanchez Oct 13, 2025
085e755
Enables pagination for Table Explorer data grid
lewis-sanchez Oct 13, 2025
0269169
Fixes row number calculation in data grid
lewis-sanchez Oct 13, 2025
e5e8335
Uses row ID for cell change tracking
lewis-sanchez Oct 14, 2025
5e68aa3
Enhances table grid styling
lewis-sanchez Oct 14, 2025
1f73458
Grid style fixes
lewis-sanchez Oct 14, 2025
d4e0f6f
Clean up grid styles
lewis-sanchez Oct 14, 2025
4440292
Replace Dropdown with Combobox for row count input
lewis-sanchez Oct 15, 2025
ce31abb
Fix grid cell highlighting
lewis-sanchez Oct 15, 2025
42ec332
Localize generate script messages
lewis-sanchez Oct 15, 2025
7056078
Generated loc's
lewis-sanchez Oct 15, 2025
b7a5747
Adds script generation to Table Explorer
lewis-sanchez Oct 15, 2025
1d2e8e6
Adds script pane to table explorer
lewis-sanchez Oct 15, 2025
3df0d5e
Merge branch 'main' into lewissanchez/feat/tableExplorer
lewis-sanchez Oct 15, 2025
7d49c7d
Fixes init logic after merging main
lewis-sanchez Oct 15, 2025
24f28e6
Toggles script pane visibility
lewis-sanchez Oct 16, 2025
ce2b90e
Generated loc's
lewis-sanchez Oct 23, 2025
19d22ef
Fix tests
lewis-sanchez Oct 23, 2025
274f509
Remove unused import
lewis-sanchez Oct 23, 2025
a102827
Improves Table Explorer grid responsiveness
lewis-sanchez Oct 23, 2025
024fe41
Adjust table grid padding
lewis-sanchez Oct 23, 2025
60a3ade
Adjusts script pane width
lewis-sanchez Oct 23, 2025
99c4a75
Localize text
lewis-sanchez Oct 23, 2025
96c1a77
Generated loc's
lewis-sanchez Oct 23, 2025
4810bb6
Localize text
lewis-sanchez Oct 23, 2025
bafac15
Generated loc's
lewis-sanchez Oct 23, 2025
59a4c85
Remove unnecessary close button and hide column picker
lewis-sanchez Oct 23, 2025
ecf5a40
Turn off extra menu
lewis-sanchez Oct 23, 2025
4597f05
Fix grid responsiveness
lewis-sanchez Oct 24, 2025
2ea48da
Fix context menu styling
lewis-sanchez Oct 24, 2025
adb056c
Regenerate script on data changes
lewis-sanchez Oct 27, 2025
e32e008
Track and restore grid pagination state
lewis-sanchez Oct 27, 2025
8e8532d
Persists pagination state across data updates
lewis-sanchez Oct 27, 2025
7ee2b9c
TableDataGrid backup - pre-refactor
lewis-sanchez Oct 27, 2025
fe285d7
Optimized data grid
lewis-sanchez Oct 27, 2025
6bcf4b4
Add custom pagination to data grid
lewis-sanchez Oct 27, 2025
e36fe06
Add unsaved changes prompt to Table Explorer
lewis-sanchez Oct 28, 2025
96ba011
Generated loc's
lewis-sanchez Oct 28, 2025
1d7f846
Additional generated loc file
lewis-sanchez Oct 28, 2025
784a642
Add unit tests for Table Explorer reducers
lewis-sanchez Oct 28, 2025
b1fe97a
Adjusts pager styling to match mocks
lewis-sanchez Oct 28, 2025
97a14a6
Adjust drop down widths in pager control
lewis-sanchez Oct 28, 2025
33193e1
Fix data grid pager control layout
lewis-sanchez Oct 28, 2025
001d38d
Make datagrid fill screen
lewis-sanchez Oct 28, 2025
3511c6e
Remove unneeded style
lewis-sanchez Oct 28, 2025
14e92b1
Fix theme handling in data grid
lewis-sanchez Oct 28, 2025
9b732a6
Localize pagination controls component
lewis-sanchez Oct 28, 2025
4494820
Generated loc's
lewis-sanchez Oct 28, 2025
df00d6c
Add failed cell highlighting to table explorer
lewis-sanchez Oct 28, 2025
eb68a3c
Shows unsaved changes count in toolbar
lewis-sanchez Oct 28, 2025
f6421e1
Clean up
lewis-sanchez Oct 29, 2025
cc54d4f
Add doc header
lewis-sanchez Oct 29, 2025
e48013b
Localize text
lewis-sanchez Oct 29, 2025
6d67958
Generated loc's
lewis-sanchez Oct 29, 2025
8c75545
Remove hardcoded STS development path
lewis-sanchez Oct 29, 2025
41caf90
Merge branch 'main' into lewissanchez/feat/tableExplorer
lewis-sanchez Oct 29, 2025
92e01cb
Generated loc
lewis-sanchez Oct 29, 2025
1b59887
Minor clean up
lewis-sanchez Oct 30, 2025
4555812
Changes row created message
lewis-sanchez Oct 30, 2025
d4d9c95
Generated loc's
lewis-sanchez Oct 30, 2025
e8d68e8
Localize initial script pane message
lewis-sanchez Oct 30, 2025
298a245
Generated loc's
lewis-sanchez Oct 30, 2025
30a38af
Clean up
lewis-sanchez Oct 30, 2025
e7d62e7
Clean up webview controller
lewis-sanchez Oct 30, 2025
8f4c5ed
Refactor table data grid
lewis-sanchez Oct 30, 2025
f205aeb
Switch to using VscodeWebviewProvider2
lewis-sanchez Oct 30, 2025
a5f8fba
Disable save button until edit is made
lewis-sanchez Oct 30, 2025
078400f
Clean up magic numbers
lewis-sanchez Oct 30, 2025
8e10789
Minor clean up
lewis-sanchez Oct 30, 2025
2a19403
Minor clean up
lewis-sanchez Oct 30, 2025
fec6665
More clean up
lewis-sanchez Oct 30, 2025
fb6cecd
More code cleanup
lewis-sanchez Oct 30, 2025
b45d93a
Use cell change count to calculate change count.
lewis-sanchez Oct 30, 2025
fc4a240
Prepend new rows to the top of result set
lewis-sanchez Oct 30, 2025
d8a8b99
Stop grid from rerendering with new rows
lewis-sanchez Oct 30, 2025
4a58424
Minor clean up
lewis-sanchez Oct 30, 2025
3c56430
Merge branch 'main' into lewissanchez/feat/tableExplorer
lewis-sanchez Oct 30, 2025
80ac110
Add enable rich experiences flag
lewis-sanchez Oct 30, 2025
d77e76a
Generated loc
lewis-sanchez Oct 30, 2025
b74a5d9
Remove bad import
lewis-sanchez Oct 30, 2025
f403798
Add close button to script pane
lewis-sanchez Oct 31, 2025
b1ea417
Generated locs
lewis-sanchez Oct 31, 2025
8f160ab
Improve script pane resize functionality
lewis-sanchez Oct 31, 2025
709ad58
Script pane takes full web view when maximized
lewis-sanchez Oct 31, 2025
9a3d20d
Improve data grid stylings
lewis-sanchez Oct 31, 2025
bc7c6db
Fix dropdown stylings in pagination control
lewis-sanchez Oct 31, 2025
6c5751c
Remove unneeded !important declarations
lewis-sanchez Oct 31, 2025
4d27324
Pre-select valid option in combobox.
lewis-sanchez Oct 31, 2025
bd793a4
Adjusts data grid row sizes
lewis-sanchez Oct 31, 2025
63e44db
Fix column header name appearance
lewis-sanchez Oct 31, 2025
c23e45e
Use generic definition pane
lewis-sanchez Oct 31, 2025
466f973
Remove unneeded table explorer script pane
lewis-sanchez Oct 31, 2025
ec0020f
Add telemetry for table explorer
lewis-sanchez Oct 31, 2025
56b895d
Add additional telemetry
lewis-sanchez Oct 31, 2025
8431c7d
Merge branch 'main' into lewissanchez/feat/tableExplorer
lewis-sanchez Oct 31, 2025
822b09d
Include schema name in tab title
lewis-sanchez Oct 31, 2025
949baba
Remove unused params to fix build
lewis-sanchez Oct 31, 2025
3bc7b22
Updates tab icon for edit data
lewis-sanchez Oct 31, 2025
e9866e7
Reword context menu for edit data
lewis-sanchez Nov 3, 2025
0ba27af
Generated loc's
lewis-sanchez Nov 3, 2025
7ed4f72
Fix data grid duplicates on reload data
lewis-sanchez Nov 4, 2025
e0dadbc
Fix datagrid responsiveness
lewis-sanchez Nov 4, 2025
2a89050
Merge branch 'main' into lewissanchez/feat/tableExplorer
lewis-sanchez Nov 4, 2025
6639338
Fix test
lewis-sanchez Nov 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions localization/l10n/bundle.l10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,31 @@
"Show Confirm Password": "Show Confirm Password",
"Hide Confirm Password": "Hide Confirm Password",
"Passwords do not match": "Passwords do not match",
"Save Changes": "Save Changes",
"Add Row": "Add Row",
"Show Script": "Show Script",
"Hide Script": "Hide Script",
"Open in SQL Editor": "Open in SQL Editor",
"Copy Script": "Copy Script",
"Copy Script to Clipboard": "Copy Script to Clipboard",
"Maximize Panel Size": "Maximize Panel Size",
"Restore Panel Size": "Restore Panel Size",
"Update Script": "Update Script",
"Commands": "Commands",
"Delete Row": "Delete Row",
"Revert Cell": "Revert Cell",
"Revert Row": "Revert Row",
"Total rows to fetch:": "Total rows to fetch:",
"Rows per page": "Rows per page",
"Fetch rows": "Fetch rows",
"First Page": "First Page",
"Previous Page": "Previous Page",
"Next Page": "Next Page",
"Last Page": "Last Page",
"Loading table data...": "Loading table data...",
"No data available": "No data available",
"No pending changes. Make edits to generate a script.": "No pending changes. Make edits to generate a script.",
"Close Script Pane": "Close Script Pane",
"Object Explorer Filter": "Object Explorer Filter",
"Azure MFA": "Azure MFA",
"Windows Authentication": "Windows Authentication",
Expand Down Expand Up @@ -1827,6 +1852,61 @@
"message": "Edit Connection Group - {0}",
"comment": ["{0} is the connection group name"]
},
"Unable to open Table Explorer: No target node provided.": "Unable to open Table Explorer: No target node provided.",
"Changes saved successfully.": "Changes saved successfully.",
"Row created.": "Row created.",
"Row removed.": "Row removed.",
"Table Explorer: {0} (Preview)/{0} is the table name": {
"message": "Table Explorer: {0} (Preview)",
"comment": ["{0} is the table name"]
},
"Failed to save changes: {0}/{0} is the error message": {
"message": "Failed to save changes: {0}",
"comment": ["{0} is the error message"]
},
"Failed to load data: {0}/{0} is the error message": {
"message": "Failed to load data: {0}",
"comment": ["{0} is the error message"]
},
"Failed to create a new row: {0}/{0} is the error message": {
"message": "Failed to create a new row: {0}",
"comment": ["{0} is the error message"]
},
"Failed to remove row: {0}/{0} is the error message": {
"message": "Failed to remove row: {0}",
"comment": ["{0} is the error message"]
},
"Failed to update cell: {0}/{0} is the error message": {
"message": "Failed to update cell: {0}",
"comment": ["{0} is the error message"]
},
"Failed to revert cell: {0}/{0} is the error message": {
"message": "Failed to revert cell: {0}",
"comment": ["{0} is the error message"]
},
"Failed to revert row: {0}/{0} is the error message": {
"message": "Failed to revert row: {0}",
"comment": ["{0} is the error message"]
},
"Failed to generate script: {0}/{0} is the error message": {
"message": "Failed to generate script: {0}",
"comment": ["{0} is the error message"]
},
"No script available. Make changes to the table data and generate a script first.": "No script available. Make changes to the table data and generate a script first.",
"Failed to open script: {0}/{0} is the error message": {
"message": "Failed to open script: {0}",
"comment": ["{0} is the error message"]
},
"Script copied to clipboard.": "Script copied to clipboard.",
"Failed to copy script: {0}/{0} is the error message": {
"message": "Failed to copy script: {0}",
"comment": ["{0} is the error message"]
},
"Table Explorer for '{0}' has unsaved changes. Do you want to save or discard them?/{0} is the table name": {
"message": "Table Explorer for '{0}' has unsaved changes. Do you want to save or discard them?",
"comment": ["{0} is the table name"]
},
"Discard": "Discard",
"Azure sign in failed.": "Azure sign in failed.",
"Select subscriptions": "Select subscriptions",
"Error loading Azure subscriptions.": "Error loading Azure subscriptions.",
Expand Down
9,199 changes: 4,673 additions & 4,526 deletions localization/xliff/vscode-mssql.xlf

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
"pretty-data": "^0.40.0",
"semver": "https://registry.npmjs.org/semver/-/semver-5.0.3.tgz",
"shallow-equal": "^3.1.0",
"slickgrid-react": "^9.8.0",
"tar": "^7.4.3",
"tmp": "^0.2.4",
"tunnel": "0.0.6",
Expand Down Expand Up @@ -582,6 +583,11 @@
"when": "view == objectExplorer && viewItem =~ /\\btype=(Table)\\b/",
"group": "4_MSSQL_object@1"
},
{
"command": "mssql.tableExplorer",
"when": "view == objectExplorer && viewItem =~ /\\btype=(Table)\\b/ && config.mssql.enableRichExperiences",
"group": "4_MSSQL_object@2"
},
{
"command": "mssql.filterNode",
"when": "view == objectExplorer && viewItem =~ /\\bfilterable=true\\b.*\\bhasFilters=false\\b/",
Expand Down Expand Up @@ -904,6 +910,11 @@
"title": "%mssql.schemaCompare%",
"category": "MS SQL"
},
{
"command": "mssql.tableExplorer",
"title": "%mssql.tableExplorer%",
"category": "MS SQL"
},
{
"command": "mssql.rebuildIntelliSenseCache",
"title": "%mssql.rebuildIntelliSenseCache%",
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"mssql.copilot.rewriteQuery": "Rewrite Query (Preview)",
"mssql.copilot.newQueryWithConnection": "Open New Query and Connect (Preview)",
"mssql.schemaCompare": "Schema Compare",
"mssql.tableExplorer": "View Data (Preview)",
"mssql.toggleSqlCmd": "Toggle SQLCMD Mode",
"mssql.copyObjectName": "Copy Object Name",
"mssql.addAadAccount": "Add Microsoft Entra Account",
Expand Down
1 change: 1 addition & 0 deletions scripts/bundle-reactviews.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const config = {
schemaCompare: "src/reactviews/pages/SchemaCompare/index.tsx",
changePassword: "src/reactviews/pages/ChangePassword/index.tsx",
publishProject: "src/reactviews/pages/PublishProject/index.tsx",
tableExplorer: "src/reactviews/pages/TableExplorer/index.tsx",
},
bundle: true,
outdir: "dist/views",
Expand Down
2 changes: 2 additions & 0 deletions src/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export const cmdCommandPaletteQueryHistory = "mssql.commandPaletteQueryHistory";
export const cmdNewQuery = "mssql.newQuery";
export const cmdCopilotNewQueryWithConnection = "mssql.copilot.newQueryWithConnection";
export const cmdSchemaCompare = "mssql.schemaCompare";
export const cmdTableExplorer = "mssql.tableExplorer";
export const cmdTableNodeAction = "mssql.tableNodeAction";
export const cmdSchemaCompareOpenFromCommandPalette = "mssql.schemaCompareOpenFromCommandPalette";
export const cmdPublishDatabaseProject = "mssql.publishDatabaseProject";
export const cmdManageConnectionProfiles = "mssql.manageProfiles";
Expand Down
108 changes: 108 additions & 0 deletions src/constants/locConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2070,3 +2070,111 @@ export class ConnectionGroup {
});
};
}

export class TableExplorer {
public static unableToOpenTableExplorer = l10n.t(
"Unable to open Table Explorer: No target node provided.",
);
public static changesSavedSuccessfully = l10n.t("Changes saved successfully.");
public static rowCreatedSuccessfully = l10n.t("Row created.");
public static rowRemoved = l10n.t("Row removed.");

public static title = (tableName: string) =>
l10n.t({
message: "Table Explorer: {0} (Preview)",
args: [tableName],
comment: ["{0} is the table name"],
});

public static failedToSaveChanges = (errorMessage: string) =>
l10n.t({
message: "Failed to save changes: {0}",
args: [errorMessage],
comment: ["{0} is the error message"],
});

public static failedToLoadData = (errorMessage: string) =>
l10n.t({
message: "Failed to load data: {0}",
args: [errorMessage],
comment: ["{0} is the error message"],
});

public static failedToCreateNewRow = (errorMessage: string) =>
l10n.t({
message: "Failed to create a new row: {0}",
args: [errorMessage],
comment: ["{0} is the error message"],
});

public static failedToRemoveRow = (errorMessage: string) =>
l10n.t({
message: "Failed to remove row: {0}",
args: [errorMessage],
comment: ["{0} is the error message"],
});

public static failedToUpdateCell = (errorMessage: string) =>
l10n.t({
message: "Failed to update cell: {0}",
args: [errorMessage],
comment: ["{0} is the error message"],
});

public static failedToRevertCell = (errorMessage: string) =>
l10n.t({
message: "Failed to revert cell: {0}",
args: [errorMessage],
comment: ["{0} is the error message"],
});

public static failedToRevertRow = (errorMessage: string) =>
l10n.t({
message: "Failed to revert row: {0}",
args: [errorMessage],
comment: ["{0} is the error message"],
});

public static failedToGenerateScript = (errorMessage: string) =>
l10n.t({
message: "Failed to generate script: {0}",
args: [errorMessage],
comment: ["{0} is the error message"],
});

public static noScriptToOpen = l10n.t(
"No script available. Make changes to the table data and generate a script first.",
);

public static failedToOpenScript = (errorMessage: string) =>
l10n.t({
message: "Failed to open script: {0}",
args: [errorMessage],
comment: ["{0} is the error message"],
});

public static scriptCopiedToClipboard = l10n.t("Script copied to clipboard.");

public static noScriptToCopy = l10n.t(
"No script available. Make changes to the table data and generate a script first.",
);

public static failedToCopyScript = (errorMessage: string) =>
l10n.t({
message: "Failed to copy script: {0}",
args: [errorMessage],
comment: ["{0} is the error message"],
});

public static unsavedChangesPrompt = (tableName: string) =>
l10n.t({
message:
"Table Explorer for '{0}' has unsaved changes. Do you want to save or discard them?",
args: [tableName],
comment: ["{0} is the table name"],
});

public static Save = l10n.t("Save");
public static Discard = l10n.t("Discard");
public static Cancel = l10n.t("Cancel");
}
49 changes: 49 additions & 0 deletions src/controllers/mainController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ import {
import { ScriptOperation } from "../models/contracts/scripting/scriptingRequest";
import { getCloudId } from "../azure/providerSettings";
import { openExecutionPlanWebview } from "./sharedExecutionPlanUtils";
import { ITableExplorerService, TableExplorerService } from "../services/tableExplorerService";
import { TableExplorerWebViewController } from "../tableExplorer/tableExplorerWebViewController";

/**
* The main controller class that initializes the extension
Expand All @@ -115,6 +117,7 @@ export default class MainController implements vscode.Disposable {
public sqlTasksService: SqlTasksService;
public dacFxService: DacFxService;
public schemaCompareService: SchemaCompareService;
public tableExplorerService: ITableExplorerService;
public sqlProjectsService: SqlProjectsService;
public azureAccountService: AzureAccountService;
public azureResourceService: AzureResourceService;
Expand Down Expand Up @@ -547,6 +550,7 @@ export default class MainController implements vscode.Disposable {
this.dacFxService = new DacFxService(SqlToolsServerClient.instance);
this.sqlProjectsService = new SqlProjectsService(SqlToolsServerClient.instance);
this.schemaCompareService = new SchemaCompareService(SqlToolsServerClient.instance);
this.tableExplorerService = new TableExplorerService(SqlToolsServerClient.instance);
const azureResourceController = new AzureResourceController();
this.azureAccountService = new AzureAccountService(
this._connectionMgr.azureController,
Expand Down Expand Up @@ -1373,6 +1377,33 @@ export default class MainController implements vscode.Disposable {
});
this._context.subscriptions.push(this.objectExplorerTree);

// Register command for table node double-click action
let lastTableClickTime = 0;
let lastTableNode: TreeNodeInfo | undefined;
const doubleClickThreshold = 500; // milliseconds

this._context.subscriptions.push(
vscode.commands.registerCommand(Constants.cmdTableNodeAction, (node: TreeNodeInfo) => {
const currentTime = Date.now();

// Check if this is a double-click on the same node
if (
lastTableNode === node &&
currentTime - lastTableClickTime < doubleClickThreshold
) {
// Double-click detected - open Table Explorer
void this.onTableExplorer(node);
// Reset to prevent triple-click
lastTableNode = undefined;
lastTableClickTime = 0;
} else {
// Single click - just track it
lastTableNode = node;
lastTableClickTime = currentTime;
}
}),
);

// Old style Add connection when experimental features are not enabled

// Add Object Explorer Node
Expand Down Expand Up @@ -1599,6 +1630,12 @@ export default class MainController implements vscode.Disposable {
),
);

this._context.subscriptions.push(
vscode.commands.registerCommand(Constants.cmdTableExplorer, async (node: any) =>
this.onTableExplorer(node),
),
);

this._context.subscriptions.push(
vscode.commands.registerCommand(
Constants.cmdSchemaCompareOpenFromCommandPalette,
Expand Down Expand Up @@ -2654,6 +2691,18 @@ export default class MainController implements vscode.Disposable {
schemaCompareWebView.revealToForeground();
}

public async onTableExplorer(node?: any): Promise<void> {
const tableExplorerWebView = new TableExplorerWebViewController(
this._context,
this._vscodeWrapper,
this.tableExplorerService,
this._connectionMgr,
node,
);

tableExplorerWebView.revealToForeground();
}

/**
* Handler for the Publish Database Project command.
* Accepts the project file path as an argument.
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/reactWebviewPanelController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class ReactWebviewPanelController<
this._panel.reveal(viewColumn, true);
}

private async showRestorePrompt(): Promise<{
protected async showRestorePrompt(): Promise<{
title: string;
run: () => Promise<void>;
}> {
Expand Down
Loading
Loading