Skip to content
18 changes: 16 additions & 2 deletions src/stats/stats-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,25 @@ export class StatsProvider {
const childStringValues: string[][] = [];

for (const child of stat.children ?? []) {
if (!(child.values && typeof child.values[0] === 'string' && child.values[0].length > 0)) {
if (!child.values || child.values.length === 0) {
continue;
}

childStringValues.push([child.name, child.values[0]]);
// Handle different value types
if (typeof child.values[0] === 'string' && child.values[0].length > 0) {
// Original behavior: string values
childStringValues.push([child.name, child.values[0]]);
} else if (typeof child.values[0] === 'number') {
// New behavior: numeric values
if (child.values.length === 1) {
// Single numeric value
childStringValues.push([child.name, child.values[0].toString()]);
} else if (child.values.length >= 2) {
// Multiple numeric values - create a row with all values
const valueStrings = child.values.map(v => v.toString());
childStringValues.push([child.name, ...valueStrings]);
}
}
}

const childStatData: StatData = {
Expand Down
53 changes: 53 additions & 0 deletions webview-ui/src/diagnostics_panel/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,56 @@ main {
background-color: var(--vscode-button-background);
color: var(--vscode-button-foreground);
}

/* Multi-column table with enhanced column interaction */
#multi-column-grid {
width: 100%;
overflow-x: auto;
table-layout: fixed;
}

/* Enhanced column styling for better visual feedback */
#multi-column-grid vscode-data-grid-cell[cell-type="columnheader"] {
font-weight: bold;
background-color: var(--vscode-editor-background);
border-bottom: 2px solid var(--vscode-editorGroup-border);
border-right: 1px solid var(--vscode-editorGroup-border);
position: relative;
cursor: default;
user-select: none;
padding: 8px 12px;
overflow: hidden;
text-overflow: ellipsis;
}

/* Add visual resize handle to column headers */
#multi-column-grid vscode-data-grid-cell[cell-type="columnheader"]::after {
content: '';
position: absolute;
top: 0;
right: 0;
width: 4px;
height: 100%;
background: transparent;
cursor: col-resize;
z-index: 1;
}

#multi-column-grid vscode-data-grid-cell[cell-type="columnheader"]:hover::after {
background: var(--vscode-focusBorder);
opacity: 0.5;
}

/* Regular cell styling */
#multi-column-grid vscode-data-grid-cell:not([cell-type="columnheader"]) {
padding: 8px 12px;
border-right: 1px solid var(--vscode-editorGroup-border);
overflow: hidden;
text-overflow: ellipsis;
min-width: 0;
}

/* Default styling for value columns when no columnWidths prop is provided */
#multi-column-grid vscode-data-grid-cell:not([grid-column="1"]) {
text-align: right;
}
5 changes: 4 additions & 1 deletion webview-ui/src/diagnostics_panel/StatisticProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ export class MultipleStatisticProvider extends StatisticProvider {
}

if (event.values.length === 0) {
return;
// Allow events through if they have children_string_values even if values is empty
if (!event.children_string_values || event.children_string_values.length === 0) {
return;
}
}

if (this.options.valuesFilter && !this.options.valuesFilter(event)) {
Expand Down
Loading