Skip to content

Redesign query result summary and settings#21467

Open
aasimkhan30 wants to merge 28 commits into
mainfrom
aasim/fix/redesignedSummary
Open

Redesign query result summary and settings#21467
aasimkhan30 wants to merge 28 commits into
mainfrom
aasim/fix/redesignedSummary

Conversation

@aasimkhan30
Copy link
Copy Markdown
Contributor

@aasimkhan30 aasimkhan30 commented Mar 5, 2026

Description

  1. Moves out the row count, execution time and summary from the status bar to query result's own status bar. This makes the items more readable
    Before:
image Now: image

Before: (with cell selection)
image
Now: (With cell selection)
image

  1. Adds a new menu for important setting as it requested by many users to switch to panel view but the vscode config is not discoverable.
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 review requested due to automatic review settings March 5, 2026 19:02
@aasimkhan30 aasimkhan30 marked this pull request as draft March 5, 2026 19:03
@aasimkhan30 aasimkhan30 changed the title Aasim/fix/redesigned summary Redesign query result summary and settings (WIP) (Not for march) Mar 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 5, 2026

PR Changes

Category Target Branch PR Branch Difference
vscode-mssql VSIX 78794 KB 78798 KB ⚪ 4 KB ( 0% )
sql-database-projects VSIX 6309 KB 6309 KB ⚪ 0 KB ( 0% )
data-workspace VSIX 535 KB 535 KB ⚪ 0 KB ( 0% )
keymap VSIX 7 KB 7 KB ⚪ 0 KB ( 0% )

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 5, 2026

Codecov Report

❌ Patch coverage is 52.70541% with 236 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.45%. Comparing base (fa77eb0) to head (5733d57).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...sions/mssql/src/models/sqlOutputContentProvider.ts 6.86% 95 Missing ⚠️
...tensions/mssql/src/webviews/common/locConstants.ts 44.08% 52 Missing ⚠️
...ql/src/queryResult/queryResultWebViewController.ts 59.84% 51 Missing ⚠️
extensions/mssql/src/controllers/queryRunner.ts 50.00% 29 Missing ⚠️
extensions/mssql/src/queryResult/utils.ts 52.94% 8 Missing ⚠️
...c/queryResult/queryResultWebviewPanelController.ts 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #21467      +/-   ##
==========================================
+ Coverage   74.37%   74.45%   +0.07%     
==========================================
  Files         408      409       +1     
  Lines      128344   128517     +173     
  Branches     7773     7804      +31     
==========================================
+ Hits        95460    95684     +224     
+ Misses      32884    32833      -51     
Flag Coverage Δ
data-workspace 77.10% <ø> (ø)
mssql 74.09% <52.70%> (+0.08%) ⬆️
sqlproj 77.56% <ø> (ø)

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

Files with missing lines Coverage Δ
extensions/mssql/src/constants/locConstants.ts 78.36% <100.00%> (+1.43%) ⬆️
extensions/mssql/src/models/interfaces.ts 98.52% <100.00%> (+<0.01%) ⬆️
...tensions/mssql/src/sharedInterfaces/queryResult.ts 100.00% <100.00%> (ø)
extensions/mssql/src/sharedInterfaces/telemetry.ts 100.00% <100.00%> (ø)
extensions/mssql/src/views/statusView.ts 53.61% <ø> (+6.81%) ⬆️
...src/webviews/pages/QueryResult/queryResultUtils.ts 68.80% <100.00%> (ø)
...c/queryResult/queryResultWebviewPanelController.ts 33.33% <0.00%> (+0.31%) ⬆️
extensions/mssql/src/queryResult/utils.ts 49.56% <52.94%> (+0.82%) ⬆️
extensions/mssql/src/controllers/queryRunner.ts 68.81% <50.00%> (+0.40%) ⬆️
...ql/src/queryResult/queryResultWebViewController.ts 51.40% <59.84%> (+8.72%) ⬆️
... and 2 more

... and 1 file 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.

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

…n configuration changes and add unit tests for the new behavior
@aasimkhan30 aasimkhan30 marked this pull request as ready for review March 9, 2026 20:23
Copilot AI review requested due to automatic review settings March 9, 2026 20:23
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

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


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

Comment thread extensions/mssql/src/webviews/pages/QueryResult/queryResultSettingsControl.tsx Outdated
Comment thread localization/xliff/vscode-mssql.xlf
@aasimkhan30 aasimkhan30 changed the title Redesign query result summary and settings (WIP) (Not for march) Redesign query result summary and settings Mar 9, 2026
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

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


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

Comment thread localization/xliff/vscode-mssql.xlf
Aasim Khan added 2 commits March 10, 2026 15:44
…ummary

# Conflicts:
#	extensions/mssql/src/controllers/mainController.ts
#	extensions/mssql/src/webviews/pages/QueryResult/queryResultSettingsControl.tsx
#	extensions/mssql/src/webviews/pages/QueryResult/queryResultSummaryFooter.tsx
#	localization/xliff/vscode-mssql.xlf
Copilot AI review requested due to automatic review settings April 11, 2026 05:50
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

Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

extensions/mssql/src/views/statusView.ts:37

  • FileStatusBar no longer defines rowCount/executionTime, but there are still references to bar.rowCount and bar.executionTime later in this file (e.g., in the ownership-change handler). That will be a TypeScript compile error; remove/update those remaining showStatusBarItem calls (or reintroduce the status bar items if still needed).
    public statusQuery: vscode.StatusBarItem;
    // Item for language service status
    public statusLanguageService: vscode.StatusBarItem;
    // Item for SQLCMD Mode
    public sqlCmdMode: vscode.StatusBarItem;

    // Timer used for displaying a progress indicator on queries
    public progressTimerId: NodeJS.Timeout;
    public currentLanguageServiceStatus: string;
    public queryTimer: NodeJS.Timeout;

Comment thread extensions/mssql/src/webviews/media/slickgrid.css Outdated
Comment thread extensions/mssql/src/queryResult/queryResultWebViewController.ts
Comment thread extensions/mssql/test/unit/queryResultWebViewController.test.ts Outdated
Comment thread extensions/mssql/test/unit/queryResultWebViewController.test.ts
Copilot AI review requested due to automatic review settings April 13, 2026 04:55
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

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

Comments suppressed due to low confidence (1)

extensions/mssql/src/webviews/pages/QueryResult/queryResultPane.tsx:207

  • The keyboard shortcut handler effect captures keyBindings and isExecutionPlan but they are missing from the dependency array. If keybindings are refreshed (or execution plan availability changes), the handler can use stale values and shortcuts may stop working as expected. Update the dependency list to include all referenced reactive values (and remove unrelated ones).
    useEffect(() => {
        const handler = (event: KeyboardEvent) => {
            let handled = false;
            if (
                eventMatchesShortcut(
                    event,
                    keyBindings[WebviewAction.QueryResultSwitchToResultsTab]?.keyCombination,
                )
            ) {
                if (Object.keys(resultSetSummaries ?? {}).length > 0) {
                    context.setResultTab(qr.QueryResultPaneTabs.Results);
                    handled = true;
                }
            } else if (
                eventMatchesShortcut(
                    event,
                    keyBindings[WebviewAction.QueryResultSwitchToMessagesTab]?.keyCombination,
                )
            ) {
                context.setResultTab(qr.QueryResultPaneTabs.Messages);
                handled = true;
            } else if (
                eventMatchesShortcut(
                    event,
                    keyBindings[WebviewAction.QueryResultSwitchToQueryPlanTab]?.keyCombination,
                )
            ) {
                if (isExecutionPlan) {
                    context.setResultTab(qr.QueryResultPaneTabs.ExecutionPlan);
                    handled = true;
                }
            }
            if (handled) {
                event.preventDefault();
                event.stopPropagation();
            }
        };

        document.addEventListener("keydown", handler, true);
        return () => {
            document.removeEventListener("keydown", handler, true);
        };
    }, [tabStates?.resultPaneTab, getGridCount, context, resultSetSummaries]);

Comment on lines 799 to +803
// Handle cancellation from the progress dialog (user clicked cancel)
token?.onCancellationRequested(async () => {
await this._client.sendNotification(CancelCopy2Notification.type);
vscode.window.showInformationMessage("Copying results cancelled");
resolve();
resolve(false);
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

This user-facing message is not localized (hard-coded English). Please move it into the appropriate localization constants and use the localized string here.

Copilot generated this review using guidance from repository custom instructions.
Comment thread extensions/mssql/src/controllers/queryRunner.ts
Copilot AI review requested due to automatic review settings May 13, 2026 17:52
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

Copilot reviewed 21 out of 21 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (3)

extensions/mssql/src/webviews/pages/QueryResult/queryResultSummaryFooter.tsx:443

  • This builds a user-facing status by concatenating localized fragments with a hard-coded separator. That makes word order and punctuation untranslatable; use a parameterized localized string for the cancelled-with-time message instead.
    const executionText = cancelled
        ? executionTimeText
            ? `${locConstants.queryResult.executionCancelled} - ${executionTimeText}`
            : locConstants.queryResult.executionCancelled
        : (executionTimeText ?? locConstants.queryResult.executionTimeUnavailable);

extensions/mssql/src/webviews/pages/QueryResult/queryResultSummaryFooter.tsx:457

  • This tooltip text concatenates localized text with a hard-coded colon. Use a parameterized localized string so languages that need a different order or punctuation can translate the full message.
    const executionTooltipText =
        liveExecutionMilliseconds !== undefined
            ? compactExecutionText === locConstants.queryResult.runningLabel
                ? locConstants.queryResult.runningLabel
                : `${locConstants.queryResult.runningLabel}: ${compactExecutionText}`
            : executionText;

extensions/mssql/src/webviews/pages/QueryResult/queryResultSummaryFooter.tsx:151

  • This scans arbitrary user-facing message text to infer cancellation, so localized messages or user output containing words like "cancelled" can change the execution status shown in the footer. Track cancellation as structured state from the runner instead of parsing display strings.
function hasCancellationMessage(messages: qr.IMessage[]): boolean {
    return messages.some((message) => /cancel(?:ed|led|ing)?/i.test(message?.message ?? ""));
}

Comment on lines +93 to +104
function getRowsAffectedFromMessages(messages: qr.IMessage[]): number | undefined {
const rowsAffectedRegex = /\(?\s*(\d+)\s+rows?\s+affected\s*\)?/i;
for (let i = messages.length - 1; i >= 0; i--) {
const text = messages[i]?.message;
if (!text) {
continue;
}
const match = text.match(rowsAffectedRegex);
if (match && match[1] !== undefined) {
const parsed = Number(match[1]);
if (!Number.isNaN(parsed)) {
return parsed;
Comment on lines +431 to +434
? rowsAffectedCount > 0
? locConstants.queryResult.rowsAffected(rowsAffectedCount)
: locConstants.queryResult.noRowsAffected
: locConstants.queryResult.noRowsAffected;
Comment on lines +654 to +668
await configuration.update(
Constants.configOpenQueryResultsInTabByDefault,
enabled,
vscode.ConfigurationTarget.Global,
);

const state = this._queryResultStateMap.get(activeUri);
// Skip the one-time prompt after users explicitly choose their preferred result location.
await configuration.update(
Constants.configOpenQueryResultsInTabByDefaultDoNotShowPrompt,
true,
vscode.ConfigurationTarget.Global,
);

if (state?.selectionSummary) {
this._selectionSummaryStatusBarItem.text = state.selectionSummary.text;
this._selectionSummaryStatusBarItem.tooltip = state.selectionSummary.tooltip;
this._selectionSummaryStatusBarItem.command = state.selectionSummary.command;
this._selectionSummaryStatusBarItem.show();
} else {
this._selectionSummaryStatusBarItem.hide();
if (enabled) {
await this.moveCurrentPanelResultToDocumentTab();
border: "1px solid var(--vscode-widget-border)",
backgroundColor: "var(--vscode-editorWidget-background)",
color: "var(--vscode-foreground)",
boxShadow: "0 10px 28px rgba(0, 0, 0, 0.35)",
Comment on lines +135 to +143
function getLatestExecutionTimeMessage(messages: qr.IMessage[]): string | undefined {
const prefix = locConstants.queryResult.totalExecutionTimePrefix;
for (let i = messages.length - 1; i >= 0; i--) {
const text = messages[i]?.message;
if (!text) {
continue;
}
if (text.startsWith(prefix) || /execution\s+time/i.test(text)) {
return text;
Copilot AI review requested due to automatic review settings May 13, 2026 20:22
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

Copilot reviewed 23 out of 23 changed files in this pull request and generated 9 comments.

Comments suppressed due to low confidence (3)

extensions/mssql/src/webviews/common/locConstants.ts:779

  • This localization constant is unused in the source tree, which adds dead code and an unnecessary generated localization entry. Remove it unless it is wired into UI in this PR.
            executionLabel: l10n.t("Execution"),

extensions/mssql/src/webviews/pages/QueryResult/queryResultSummaryFooter.tsx:457

  • This tooltip text is assembled from a localized label plus a hard-coded colon. Use a parameterized localized string for the full message so punctuation/order can be translated correctly.
    const executionTooltipText =
        liveExecutionMilliseconds !== undefined
            ? compactExecutionText === locConstants.queryResult.runningLabel
                ? locConstants.queryResult.runningLabel
                : `${locConstants.queryResult.runningLabel}: ${compactExecutionText}`
            : executionText;

extensions/mssql/src/webviews/pages/QueryResult/queryResultSummaryFooter.tsx:247

  • The running-time formatter also emits hard-coded English unit suffixes (s, m, h) in user-facing text. These should be localized or formatted through a shared duration helper.
function formatRunningTimeCompact(milliseconds: number): string {
    if (milliseconds < 1000) {
        return locConstants.queryResult.runningLabel;
    }

    if (milliseconds < 60000) {
        return `${Math.floor(milliseconds / 1000)}s`;
    }

    if (milliseconds < 3600000) {
        const minutes = Math.floor(milliseconds / 60000);
        const seconds = Math.floor((milliseconds % 60000) / 1000);
        return seconds > 0 ? `${minutes}m ${seconds}s` : `${minutes}m`;
    }

    const hours = Math.floor(milliseconds / 3600000);
    const minutes = Math.floor((milliseconds % 3600000) / 60000);
    return minutes > 0 ? `${hours}h ${minutes}m` : `${hours}h`;

Comment thread extensions/mssql/src/webviews/pages/QueryResult/queryResultUtils.ts Outdated
Comment thread extensions/mssql/src/queryResult/queryResultWebViewController.ts Outdated
Comment thread extensions/mssql/src/webviews/pages/QueryResult/queryResultSummaryFooter.tsx Outdated
Comment thread extensions/mssql/src/webviews/pages/QueryResult/queryResultSettingsControl.tsx Outdated
Comment thread extensions/mssql/src/webviews/common/locConstants.ts Outdated
Comment thread extensions/mssql/src/webviews/pages/QueryResult/queryResultSummaryFooter.tsx Outdated
Aasim Khan added 2 commits May 13, 2026 14:34
- Added localization for row counts and execution times in the MSSQL extension.
- Updated interfaces and models to include rows affected and elapsed execution time.
- Improved the handling of query result messages to reflect the number of rows returned and affected.
- Refactored utility functions to streamline row count retrieval.
- Enhanced the query result summary footer to display accurate execution metrics.
- Updated tests to ensure proper functionality with the new row count handling.
Copilot AI review requested due to automatic review settings May 13, 2026 22:34
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

Copilot reviewed 25 out of 25 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (2)

extensions/mssql/src/webviews/pages/QueryResult/queryResultSummaryFooter.tsx:163

  • When an elapsed time is just under one hour, rounding can make seconds === 60 and this returns compactMinutes(minutes + 1), which becomes 60m for 59m59.5s instead of rolling over to 1h. Handle the hour rollover as well so the compact time does not show a 60-minute value.
    if (milliseconds < 3600000) {
        const minutes = Math.floor(milliseconds / 60000);
        const seconds = Math.round((milliseconds % 60000) / 1000);
        if (seconds === 0) {
            return locConstants.queryResult.compactMinutes(minutes);
        }
        if (seconds === 60) {
            return locConstants.queryResult.compactMinutes(minutes + 1);
        }
        return locConstants.queryResult.compactMinutesSeconds(minutes, seconds);

extensions/mssql/src/webviews/pages/QueryResult/queryResultSummaryFooter.tsx:461

  • This visual divider is inside the footer status area and will be announced by screen readers as punctuation. Render it with CSS or add aria-hidden so the live region only announces the selection summary content.
                <span className={classes.divider}>|</span>

resultId: e.resultId,
};
this._queryResultWebviewController.updateSelectionSummary();
this.updateWebviewState(e.uri, state);
Comment on lines +97 to +110
useEffect(() => {
if (!context) {
return;
}

context.extensionRpc
.sendRequest(qr.GetOpenQueryResultsInTabByDefaultRequest.type)
.then((isEnabled) => {
setOpenResultsInEditorTabByDefault(isEnabled);
})
.catch((e) => {
console.error(e);
});
}, [context]);
Comment on lines +149 to +151
return locConstants.queryResult.compactSeconds(
seconds < 10 ? seconds.toFixed(1) : Math.round(seconds),
);
Comment on lines +135 to +140
function normalizeStatusText(text?: string): string {
if (!text) {
return "";
}
return text.replace(/\$\([^)]+\)\s*/g, "").trim();
}
</span>
</Tooltip>
</div>
<span className={classes.divider}>|</span>
Comment on lines +586 to +589
resultWebviewState.isExecuting = true;
resultWebviewState.executionStartTime = Date.now();
resultWebviewState.executionElapsedMilliseconds = undefined;
resultWebviewState.rowsAffected = undefined;
…ummary

# Conflicts:
#	extensions/mssql/l10n/bundle.l10n.json
#	localization/xliff/vscode-mssql.xlf
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.

3 participants