Add Schema Designer Integration to Edit Data#21652
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds an entry point from Table Explorer “Edit Data” to Schema Designer via a new “View Table Diagram” toolbar action, and supports opening Schema Designer pre-filtered to the current table.
Changes:
- Add a “View Table Diagram” toolbar button in the Table Explorer webview that triggers a new reducer and telemetry action.
- Register a new extension command (
mssql.schemaDesignerForTable) that opens Schema Designer and sets an initial table filter. - Extend Schema Designer webview state/UI to consume an
initialFilterTablesvalue and apply it after initialization.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| localization/xliff/vscode-mssql.xlf | Adds new localizable strings for the button label and error message. |
| extensions/mssql/l10n/bundle.l10n.json | Updates the compiled localization bundle with the new strings. |
| extensions/mssql/src/reactviews/common/locConstants.ts | Adds React/webview loc constant for “View Table Diagram”. |
| extensions/mssql/src/constants/locConstants.ts | Adds backend loc constant for “Failed to open Schema Designer: {0}”. |
| extensions/mssql/src/sharedInterfaces/telemetry.ts | Adds TelemetryActions.ViewTableDiagram. |
| extensions/mssql/src/constants/constants.ts | Adds new command id constant cmdDesignSchemaForTable. |
| extensions/mssql/src/sharedInterfaces/tableExplorer.ts | Extends Table Explorer context + reducer typings to include viewTableDiagram. |
| extensions/mssql/src/reactviews/pages/TableExplorer/TableExplorerStateProvider.tsx | Wires viewTableDiagram action to the extension RPC. |
| extensions/mssql/src/reactviews/pages/TableExplorer/TableExplorerToolbar.tsx | Adds the “View Table Diagram” toolbar button with icon + aria-label/title. |
| extensions/mssql/src/tableExplorer/tableExplorerWebViewController.ts | Implements the viewTableDiagram reducer (telemetry + command execution + error handling). |
| extensions/mssql/src/controllers/mainController.ts | Registers mssql.schemaDesignerForTable command to open Schema Designer with an initial filter. |
| extensions/mssql/src/sharedInterfaces/schemaDesigner.ts | Adds optional initialFilterTables to Schema Designer webview state. |
| extensions/mssql/src/schemaDesigner/schemaDesignerWebviewController.ts | Adds setInitialFilterTables() to update webview state from extension host. |
| extensions/mssql/src/reactviews/pages/SchemaDesigner/toolbar/filterTablesButton.tsx | Consumes initialFilterTables and applies it after initialization using RAF polling. |
| extensions/mssql/test/unit/tableExplorerWebViewController.test.ts | Adds unit tests for the new viewTableDiagram reducer behavior. |
| extensions/mssql/test/unit/schemaDesignerWebviewController.test.ts | Adds unit tests for setInitialFilterTables(). |
You can also share your feedback on Copilot code review. Take the survey.
extensions/mssql/test/unit/tableExplorerWebViewController.test.ts
Outdated
Show resolved
Hide resolved
extensions/mssql/src/tableExplorer/tableExplorerWebViewController.ts
Outdated
Show resolved
Hide resolved
extensions/mssql/src/tableExplorer/tableExplorerWebViewController.ts
Outdated
Show resolved
Hide resolved
extensions/mssql/src/reactviews/pages/SchemaDesigner/toolbar/filterTablesButton.tsx
Show resolved
Hide resolved
extensions/mssql/test/unit/tableExplorerWebViewController.test.ts
Outdated
Show resolved
Hide resolved
extensions/mssql/test/unit/tableExplorerWebViewController.test.ts
Outdated
Show resolved
Hide resolved
PR Changes
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #21652 +/- ##
========================================
Coverage 72.91% 72.92%
========================================
Files 331 331
Lines 99095 99200 +105
Branches 5569 5575 +6
========================================
+ Hits 72260 72346 +86
- Misses 26835 26854 +19
🚀 New features to boost your workflow:
|
allancascante
left a comment
There was a problem hiding this comment.
I left an small comment on mutating state on controller
| * @param tables Array of fully qualified table names (e.g., ["dbo.Students"]) | ||
| */ | ||
| public setInitialFilterTables(tables: string[]): void { | ||
| this.updateState({ |
There was a problem hiding this comment.
I got comments about mutating the state from @Benjin the consensus is that in controllers it is safe to update the value no need to create a new instance every time we have to chnage the state.
Description
This PR integrates Schema Designer into Edit Data by adding a "View Table Diagram" button that opens schema designer with the table being edited and its related tables in the designer view.
Provide a clear, concise summary of the changes in this PR. What problem does it solve? Why is it needed? Link any related issues using issue closing keywords.
Code Changes Checklist
npm run test)Reviewers: Please read our reviewer guidelines