From 6139dee36bd824974058ccc1641f4103e8b774ea Mon Sep 17 00:00:00 2001 From: kool7 Date: Fri, 1 May 2026 00:47:20 +0530 Subject: [PATCH 1/2] 0.0.5 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 43f42c3..a0051a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "coverage-visualizer", - "version": "0.0.4", + "version": "0.0.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "coverage-visualizer", - "version": "0.0.4", + "version": "0.0.5", "license": "MIT", "dependencies": { "sql.js": "^1.14.1" diff --git a/package.json b/package.json index ac40e8e..f850be0 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "coverage-visualizer", "displayName": "Python Coverage Visualizer", "description": "Visualize Python test coverage inline in VS Code — highlights, CodeLens, dashboard, and sidebar tree view", - "version": "0.0.4", + "version": "0.0.5", "publisher": "kool7", "engines": { "vscode": "^1.90.0" From 9d8f6de31e123e2498339be5222fd29fdd42eac0 Mon Sep 17 00:00:00 2001 From: kool7 Date: Sat, 2 May 2026 15:17:07 +0530 Subject: [PATCH 2/2] fix: show relative paths and filter 0-statement files from dashboard and sidebar --- src/providers/treeProvider.ts | 8 ++++++-- src/ui/dashboardPanel.ts | 13 ++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/providers/treeProvider.ts b/src/providers/treeProvider.ts index ff0070d..eaa6241 100644 --- a/src/providers/treeProvider.ts +++ b/src/providers/treeProvider.ts @@ -41,14 +41,18 @@ export class CoverageTreeProvider implements vscode.TreeDataProvider data.executedLines.length + data.missingLines.length > 0) .sort(([, a], [, b]) => a.percentCovered - b.percentCovered) .map(([filePath, data]) => { - const label = filePath.split('/').pop() ?? filePath; + const displayPath = filePath.startsWith(workspaceRoot) + ? filePath.slice(workspaceRoot.length).replace(/^[\\/]/, '') + : filePath; + const label = displayPath.split(/[\\/]/).pop() ?? displayPath; const item = new vscode.TreeItem(label, vscode.TreeItemCollapsibleState.None); const total = data.executedLines.length + data.missingLines.length; item.description = `${data.percentCovered.toFixed(1)}% ${data.executedLines.length}/${total}`; item.tooltip = new vscode.MarkdownString( - `**${filePath}**\n\n${data.executedLines.length}/${total} lines covered` + `**${displayPath}**\n\n${data.executedLines.length}/${total} lines covered` ); item.iconPath = new vscode.ThemeIcon( data.percentCovered >= cfg.thresholdGood ? 'pass' diff --git a/src/ui/dashboardPanel.ts b/src/ui/dashboardPanel.ts index ad99625..c2ed0b1 100644 --- a/src/ui/dashboardPanel.ts +++ b/src/ui/dashboardPanel.ts @@ -45,9 +45,16 @@ function colorClass(pct: number, thresholdGood: number, thresholdWarn: number): function buildHtml(report: CoverageReport): string { const { percentCovered, coveredStatements, numStatements } = report.totals; const { thresholdGood, thresholdWarn } = getConfig(); + const workspaceRoot = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath ?? ''; const files = Object.entries(report.files) - .map(([filePath, data]) => ({ filePath, ...data })) + .filter(([, data]) => data.executedLines.length + data.missingLines.length > 0) + .map(([filePath, data]) => { + const displayPath = filePath.startsWith(workspaceRoot) + ? filePath.slice(workspaceRoot.length).replace(/^[\\/]/, '') + : filePath; + return { filePath, displayPath, ...data }; + }) .sort((a, b) => a.percentCovered - b.percentCovered); const fileRows = files.map(f => { @@ -55,8 +62,8 @@ function buildHtml(report: CoverageReport): string { const cls = colorClass(f.percentCovered, thresholdGood, thresholdWarn); const total = f.executedLines.length + f.missingLines.length; return ` - - ${f.filePath} + + ${f.displayPath} ${f.executedLines.length}/${total}