Skip to content

Fixing database selection logic and adding state indicators - #22710

Merged
Benjin Dubishar (Benjin) merged 1 commit into
mainfrom
dev/benjin/deployDialogFixes
Aug 12, 2026
Merged

Fixing database selection logic and adding state indicators#22710
Benjin Dubishar (Benjin) merged 1 commit into
mainfrom
dev/benjin/deployDialogFixes

Conversation

@Benjin

@Benjin Benjin Dubishar (Benjin) commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Description

Addresses #22711

This PR addresses a smattering of inconsistent behaviors in the dacpac dialog

image

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 aims to make DACPAC dialog database selection more consistent when switching servers / launch points by using the selected connection’s database (instead of initial state) as the preferred/fallback database, and by adding UI loading indicators while databases are being fetched.

Changes:

  • Updated the list-databases request/handler contract to accept an optional connectionDatabaseName and use it as the preferred/fallback database.
  • Refactored DACPAC dialog form state to separate “new database name” vs “existing database name”, and added loading spinners/disabled states while loading databases.
  • Updated/added unit tests and introduced a localized “Loading databases…” string for the webview UI.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
localization/xliff/vscode-mssql.xlf Adds a new localized source string for “Loading databases…”.
extensions/mssql/test/unit/dacpacDialogWebviewController.test.ts Updates tests for new connectionDatabaseName behavior and adds a regression test for connection switching.
extensions/mssql/src/webviews/pages/DacpacDialog/TargetDatabaseSection.tsx Adds loading indicators and separates new vs existing target database selection state.
extensions/mssql/src/webviews/pages/DacpacDialog/SourceDatabaseSection.tsx Adds loading indicators and “database already exists” warning support for new database entry.
extensions/mssql/src/webviews/pages/DacpacDialog/ServerSelectionSection.tsx Updates layout to use horizontal Field orientation.
extensions/mssql/src/webviews/pages/DacpacDialog/FilePathSection.tsx Updates layout to use horizontal Field orientation.
extensions/mssql/src/webviews/pages/DacpacDialog/dacpacDialogStateProvider.tsx Extends RPC method signature to pass through connectionDatabaseName.
extensions/mssql/src/webviews/pages/DacpacDialog/dacpacDialogForm.tsx Refactors form state and database-loading logic; adds loading state + caching.
extensions/mssql/src/webviews/pages/DacpacDialog/ApplicationInfoSection.tsx Updates layout to use horizontal Field orientation.
extensions/mssql/src/webviews/common/locConstants.ts Adds a new loadingDatabases localized string for webviews.
extensions/mssql/src/sharedInterfaces/dacpacDialog.ts Updates ListDatabasesWebviewRequest params to include connectionDatabaseName?.
extensions/mssql/src/controllers/dacpacDialogWebviewController.ts Updates database listing logic to prefer/fallback to selected connection database (vs initial state).
extensions/mssql/l10n/bundle.l10n.json Adds the new “Loading databases…” string to the webview localization bundle.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

});
}
}
const cacheKey = ownerUri;
Comment on lines 611 to 615
if (
stateDatabaseName &&
!isSystemDatabase(stateDatabaseName) &&
!userDatabases.includes(stateDatabaseName)
connectionDatabaseName &&
!isSystemDatabase(connectionDatabaseName) &&
!userDatabases.includes(connectionDatabaseName)
) {
@github-actions

Copy link
Copy Markdown

PR Changes

Category Target Branch PR Branch Difference
vscode-mssql VSIX 80659 KB 80660 KB ⚪ 1 KB ( 0% )
sql-database-projects VSIX 2899 KB 2899 KB ⚪ 0 KB ( 0% )
data-workspace VSIX 202 KB 202 KB ⚪ 0 KB ( 0% )
keymap VSIX 7 KB 7 KB ⚪ 0 KB ( 0% )

@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.73%. Comparing base (ffbb33a) to head (99cc0c8).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #22710      +/-   ##
==========================================
- Coverage   88.87%   87.73%   -1.14%     
==========================================
  Files         340      340              
  Lines      119790   119790              
  Branches      552      552              
==========================================
- Hits       106461   105098    -1363     
- Misses      13329    14692    +1363     
Flag Coverage Δ
data-workspace 78.34% <ø> (ø)
mssql 88.72% <100.00%> (-1.28%) ⬇️
sqlproj 79.57% <ø> (ø)

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

Files with missing lines Coverage Δ
...l/src/controllers/dacpacDialogWebviewController.ts 97.85% <100.00%> (-0.01%) ⬇️
...tensions/mssql/src/webviews/common/locConstants.ts 86.61% <100.00%> (-0.33%) ⬇️

... and 25 files with indirect coverage changes

🚀 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.

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.

4 participants