Skip to content

Redesign query result summary and settings#21467

Open
aasimkhan30 wants to merge 22 commits intomainfrom
aasim/fix/redesignedSummary
Open

Redesign query result summary and settings#21467
aasimkhan30 wants to merge 22 commits intomainfrom
aasim/fix/redesignedSummary

Conversation

@aasimkhan30
Copy link
Copy Markdown
Contributor

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 78033 KB 78036 KB ⚪ 3 KB ( 0% )
sql-database-projects VSIX 6201 KB 6201 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 61.49733% with 144 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.21%. Comparing base (07b8831) to head (2752a59).

Files with missing lines Patch % Lines
...sions/mssql/src/models/sqlOutputContentProvider.ts 7.52% 86 Missing ⚠️
extensions/mssql/src/controllers/queryRunner.ts 39.02% 25 Missing ⚠️
...ql/src/queryResult/queryResultWebViewController.ts 72.82% 25 Missing ⚠️
extensions/mssql/src/queryResult/utils.ts 69.23% 4 Missing ⚠️
...src/webviews/pages/QueryResult/queryResultUtils.ts 95.71% 3 Missing ⚠️
...c/queryResult/queryResultWebviewPanelController.ts 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (61.49%) 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   #21467      +/-   ##
==========================================
+ Coverage   74.06%   74.21%   +0.14%     
==========================================
  Files         339      340       +1     
  Lines      102844   102895      +51     
  Branches     6029     6059      +30     
==========================================
+ Hits        76173    76364     +191     
+ Misses      26671    26531     -140     
Files with missing lines Coverage Δ
extensions/mssql/src/constants/locConstants.ts 77.81% <ø> (+1.66%) ⬆️
...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%) ⬆️
...tensions/mssql/src/webviews/common/locConstants.ts 29.96% <100.00%> (+0.67%) ⬆️
...c/queryResult/queryResultWebviewPanelController.ts 33.33% <0.00%> (+0.31%) ⬆️
...src/webviews/pages/QueryResult/queryResultUtils.ts 70.86% <95.71%> (ø)
extensions/mssql/src/queryResult/utils.ts 49.91% <69.23%> (+1.17%) ⬆️
extensions/mssql/src/controllers/queryRunner.ts 69.03% <39.02%> (+0.26%) ⬆️
...ql/src/queryResult/queryResultWebViewController.ts 52.64% <72.82%> (+9.97%) ⬆️
... and 1 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 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
Copilot AI review requested due to automatic review settings March 10, 2026 22:30
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 on lines +4955 to +4957
<trans-unit id="++CODE++2ada9c77ff43c3a64eb670413987d527359f366fe2ddc314dfdfd6102df8ba07">
<source xml:lang="en">Results Settings</source>
</trans-unit>
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

New trans-units were added/removed in the source vscode-mssql.xlf, but the corresponding localized XLIFF files (e.g. localization/xliff/vscode-mssql.de.xlf, etc.) still contain removed entries (like “Average: {0}”) and don’t include the new ones (like “Results Settings”). Please run yarn localization and commit the updated localization/xliff/*.xlf outputs so the repo’s localization files stay in sync.

Suggested change
<trans-unit id="++CODE++2ada9c77ff43c3a64eb670413987d527359f366fe2ddc314dfdfd6102df8ba07">
<source xml:lang="en">Results Settings</source>
</trans-unit>

Copilot uses AI. Check for mistakes.
Comment on lines +184 to +189
<Switch
checked={openResultsInEditorTabByDefault}
onChange={(_event, data) => {
void setDefaultResultLocation(data.checked);
}}
/>
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The Switch control has no accessible label. In other React views (e.g. SchemaDesigner) the Switch uses the label prop so screen readers announce what the toggle does. Please add a label (or an equivalent aria-label association) describing the setting being toggled.

Copilot uses AI. Check for mistakes.
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 on lines +92 to +98
}

.slick-row.even {
background-color: var(--vscode-editor-background);
}

.slick-row.odd {
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

The new .slick-row.even / .slick-row.odd background rules apply unconditionally, which makes row striping always-on and effectively ignores the mssql.resultsGrid.alternatingRowColors setting (the .results-grid--alternating ... rules can’t turn striping off). Scope these rules under .results-grid--alternating (and set a single default background for rows when alternating is disabled).

Suggested change
}
.slick-row.even {
background-color: var(--vscode-editor-background);
}
.slick-row.odd {
background-color: var(--vscode-editor-background);
}
.results-grid--alternating .slick-row.even {
background-color: var(--vscode-editor-background);
}
.results-grid--alternating .slick-row.odd {

Copilot uses AI. Check for mistakes.
}
if (
e.affectsConfiguration(Constants.configOpenQueryResultsInTabByDefault) &&
this.isOpenQueryResultsInTabByDefaultEnabled
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

isOpenQueryResultsInTabByDefaultEnabled reads the setting without a default value, so it can be undefined and rely on truthiness in callers. Use get<boolean>(..., false) (and ideally keep the return type strictly boolean) to avoid inconsistent behavior when the setting isn’t set.

Suggested change
this.isOpenQueryResultsInTabByDefaultEnabled
this.isOpenQueryResultsInTabByDefaultEnabled === true

Copilot uses AI. Check for mistakes.
Comment thread extensions/mssql/test/unit/queryResultWebViewController.test.ts
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 on lines 707 to +742
public async copyHeaders(
batchId: number,
resultId: number,
selection: ISlickRange[],
): Promise<void> {
): Promise<boolean> {
let copyString = "";
let firstCol: number;
let lastCol: number;
for (let range of selection) {
if (firstCol === undefined || range.fromCell < firstCol) {
firstCol = range.fromCell;
}
if (lastCol === undefined || range.toCell > lastCol) {
lastCol = range.toCell;
}
}
let columnRange: ISlickRange = {
fromCell: firstCol,
toCell: lastCol,
fromRow: undefined,
toRow: undefined,
};
let columnHeaders = this.getColumnHeaders(batchId, resultId, columnRange);
copyString += columnHeaders.join("\t");

let oldLang: string;
if (process.platform === "darwin") {
oldLang = process.env["LANG"];
process.env["LANG"] = "en_US.UTF-8";
}
await this._vscodeWrapper.clipboardWriteText(copyString);
if (process.platform === "darwin") {
process.env["LANG"] = oldLang;
}

return true;
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.

copyHeaders always returns true and will write an empty string to the clipboard if the selection produces an invalid column range (e.g., empty grid / no columns, or toCell < fromCell). Since callers use the return value to show a "Copied" indicator, this can produce false positives. Validate the computed range and headers before copying, and return false when there’s nothing to copy.

Copilot uses AI. Check for mistakes.
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