Skip to content

Add Schema Designer Integration to Edit Data#21652

Merged
lewis-sanchez merged 8 commits intomainfrom
lewissanchez/editData/add-schema-designer-integration
Mar 17, 2026
Merged

Add Schema Designer Integration to Edit Data#21652
lewis-sanchez merged 8 commits intomainfrom
lewissanchez/editData/add-schema-designer-integration

Conversation

@lewis-sanchez
Copy link
Contributor

@lewis-sanchez lewis-sanchez commented Mar 17, 2026

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.

Open Schema Designer from Edit Data

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

  • 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

Copy link
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 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 initialFilterTables value 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.

@github-actions
Copy link

github-actions bot commented Mar 17, 2026

PR Changes

Category Target Branch PR Branch Difference
vscode-mssql VSIX 6440 KB 6438 KB ⚪ -2 KB ( 0% )
sql-database-projects VSIX 7062 KB 7062 KB ⚪ 0 KB ( 0% )
data-workspace VSIX 535 KB 535 KB ⚪ 0 KB ( 0% )

@codecov-commenter
Copy link

codecov-commenter commented Mar 17, 2026

Codecov Report

❌ Patch coverage is 86.66667% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.92%. Comparing base (f2c00e0) to head (e338597).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
extensions/mssql/src/controllers/mainController.ts 38.09% 13 Missing ⚠️
...nsions/mssql/src/reactviews/common/locConstants.ts 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           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     
Files with missing lines Coverage Δ
extensions/mssql/src/constants/constants.ts 100.00% <100.00%> (ø)
extensions/mssql/src/constants/locConstants.ts 76.30% <100.00%> (+0.04%) ⬆️
.../schemaDesigner/schemaDesignerWebviewController.ts 85.77% <100.00%> (+0.24%) ⬆️
...sions/mssql/src/sharedInterfaces/schemaDesigner.ts 100.00% <100.00%> (ø)
...nsions/mssql/src/sharedInterfaces/tableExplorer.ts 100.00% <100.00%> (ø)
extensions/mssql/src/sharedInterfaces/telemetry.ts 100.00% <100.00%> (ø)
...rc/tableExplorer/tableExplorerWebViewController.ts 91.67% <100.00%> (-0.01%) ⬇️
...nsions/mssql/src/reactviews/common/locConstants.ts 25.70% <0.00%> (-0.02%) ⬇️
extensions/mssql/src/controllers/mainController.ts 33.97% <38.09%> (+0.02%) ⬆️
🚀 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.

Copy link
Contributor

@allancascante allancascante left a comment

Choose a reason for hiding this comment

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

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({
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

@lewis-sanchez lewis-sanchez merged commit 2a99b95 into main Mar 17, 2026
3 checks passed
@lewis-sanchez lewis-sanchez deleted the lewissanchez/editData/add-schema-designer-integration branch March 17, 2026 23:24
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.

5 participants