Skip to content

Progress toast for database rename#21510

Merged
Benjin merged 5 commits into
mainfrom
dev/benjin/renameProgress
Mar 7, 2026
Merged

Progress toast for database rename#21510
Benjin merged 5 commits into
mainfrom
dev/benjin/renameProgress

Conversation

@Benjin
Copy link
Copy Markdown
Contributor

@Benjin Benjin commented Mar 6, 2026

Description

Fixes #21354

At least the first part by displaying a progress toast while it attempts to rename a database. Full fix would entail prompting the user to switch to single-user mode for the rename to force the issue (only when initial rename errors)

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
Copy Markdown
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 a progress notification toast when renaming a database in Object Explorer, addressing the first part of issue #21354 (no visual indicator during rename). The rename operation is now wrapped in vscode.window.withProgress to show a notification while the backend processes the rename.

Changes:

  • Wrapped the objectManagementService.rename call in vscode.window.withProgress to display a progress notification during database rename
  • Added a new localized string renamingDatabase with parameterized message "Renaming database '{0}' to '{1}'..."
  • Updated localization files (XLIFF and l10n bundle) with the new string

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
extensions/mssql/src/controllers/mainController.ts Wraps the rename database call in vscode.window.withProgress to show a notification toast
extensions/mssql/src/constants/locConstants.ts Adds renamingDatabase function for the localized progress message
extensions/mssql/l10n/bundle.l10n.json Adds the l10n bundle entry for the new string
localization/xliff/vscode-mssql.xlf Adds the XLIFF trans-unit for the new localized string

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +4838 to +4842
<trans-unit id="++CODE++3426e6a23fe6e9ab8ec4d59a46f5e26596e94b9712da61c7a323e0cb0a6ecd25">
<source xml:lang="en">Renaming database &apos;{0}&apos; to &apos;{1}&apos;...</source>
<note>{0} is the current database name
{1} is the new database name</note>
</trans-unit>
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

The new trans-unit for "Renaming database '{0}' to '{1}'..." was added to the base vscode-mssql.xlf but is missing from all localized XLIFF files (vscode-mssql.de.xlf, vscode-mssql.es.xlf, vscode-mssql.fr.xlf, vscode-mssql.it.xlf, vscode-mssql.ja.xlf, vscode-mssql.ko.xlf, vscode-mssql.pt-BR.xlf, vscode-mssql.ru.xlf, vscode-mssql.zh-Hans.xlf, vscode-mssql.zh-Hant.xlf). Each localized file should have a corresponding trans-unit added with <target state="new"> and the English source text as a placeholder, following the established convention (e.g., see vscode-mssql.de.xlf line 542 for an example of a state="new" entry).

Copilot uses AI. Check for mistakes.
@Benjin Benjin changed the title Dev/benjin/rename progress Progress toast for database rename Mar 6, 2026
@Benjin Benjin added this to the March 2026 Release milestone Mar 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 6, 2026

PR Changes

Category Target Branch PR Branch Difference
vscode-mssql VSIX 6402 KB 6402 KB ⚪ 0 KB ( 0% )
sql-database-projects VSIX 7060 KB 7060 KB ⚪ 0 KB ( 0% )
data-workspace VSIX 535 KB 535 KB ⚪ 0 KB ( 0% )

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.52%. Comparing base (f8ddd74) to head (ee5599e).

Files with missing lines Patch % Lines
extensions/mssql/src/controllers/mainController.ts 0.00% 13 Missing ⚠️
extensions/mssql/src/constants/locConstants.ts 0.00% 7 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #21510      +/-   ##
==========================================
- Coverage   72.53%   72.52%   -0.02%     
==========================================
  Files         330      330              
  Lines       98173    98188      +15     
  Branches     5430     5430              
==========================================
  Hits        71206    71206              
- Misses      26967    26982      +15     
Files with missing lines Coverage Δ
extensions/mssql/src/constants/locConstants.ts 75.70% <0.00%> (-0.17%) ⬇️
extensions/mssql/src/controllers/mainController.ts 30.44% <0.00%> (-0.08%) ⬇️
🚀 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.

@Benjin Benjin merged commit d32ffac into main Mar 7, 2026
7 checks passed
@Benjin Benjin deleted the dev/benjin/renameProgress branch March 7, 2026 02:10
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.

[Bug]: Rename database fails if other connections are open, should prompt to terminate other connections

5 participants