microsoft / microsoft/Kusto-Explorer-VsCode
Results grid: show Count/Sum/Avg/Min/Max for selected numeric cells in a status bar
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6
- Forks
- 7
- Avg merge
- 6d 10h
- Merged PRs (30d)
- 3
Description
Ported from discussion #140 (@nanovak).
Request
When multiple numeric cells are selected in the results grid, show aggregate statistics — Count / Sum / Avg / Min / Max — in a status bar, matching the behavior of Kusto Explorer desktop and the web UI.
Why this is well-scoped now
The prerequisite already shipped in v0.4.0: the grid supports cell/row/column range selection. The webview already maintains authoritative selection state and already notifies the extension host on every selection change, so this feature is additive rather than foundational.
Relevant existing pieces:
src/Client/features/dataTableProvider.ts— the webview script owns selection state inselectedCells(a set of"row:col"display-coordinate keys) plusselAnchor.postSelectionChange()(~line 1263) already posts asetSelectionmessage to the host on every change.currentSelectionIndices()(~line 1223) summarizes the selection as original-data{ rows, cols }index arrays.ResultColumn { name, type }(src/Client/features/server.ts) carries the Kusto scalar type per column, which is what drives numeric detection.- The data table view is deliberately container-agnostic (relative DOM queries via
document.currentScript.parentElement+ a per-view token), so any status bar must be rendered by the view into its own container rather than assume a page-level element.
Open design questions
- Where the aggregation runs. The webview owns the exact selected-cell set; the extension host owns the full typed table and is the testable half.
currentSelectionIndices()currently reports only the selection's bounding box, which is lossless only while selections stay rectangular. - Count semantics — all selected cells, or only the numeric/non-null ones. Nulls and non-numeric cells inside a mixed selection need a defined rule.
- Mixed / non-numeric selections — hide the bar, show
Countalone, or aggregate per numeric column. - Which types count as numeric —
int/long/real/decimalare clear;timespananddatetimeare aggregatable in principle but need their own formatting and may be out of scope for a first cut. - Formatting and precision for
Sum/Avgoverreal/decimal, and whether values are copyable from the bar.
Notes
- Follow the existing webview house style: HTML string + inline
<script>,acquireVsCodeApi(), document-level click delegation. No framework. - Per repo convention, the aggregation itself should live in a unit-testable module rather than only inside the inline webview script.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read src/Client/features/dataTableProvider.ts, especially currentSelectionIndices() and postSelectionChange(), then inspect ResultColumn in src/Client/features/server.ts. Decide the selection, numeric-type, null, mixed-selection, and formatting rules before choosing the host/webview boundary. Done means the per-view status bar reflects selected numeric cells and the aggregation logic has unit-test coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- frontend, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100