Skip to content

fix: branch coverage parsing, UI consistency, and sidebar accuracy#4

Closed
kool7 wants to merge 3 commits intomainfrom
fix/coverage-accuracy-ui
Closed

fix: branch coverage parsing, UI consistency, and sidebar accuracy#4
kool7 wants to merge 3 commits intomainfrom
fix/coverage-accuracy-ui

Conversation

@kool7
Copy link
Copy Markdown
Owner

@kool7 kool7 commented May 3, 2026

Problems fixed

1. 0% coverage everywhere with branch=true projects
coverage.py's branch=true mode writes only to the arc table — the line_bits table is empty. The extension was only reading line_bits, so all files showed 0%. Now detects arc mode and reads (fromno, tono) pairs; positive values = executed lines, negative values = virtual entry/exit markers (ignored).

2. False red highlights on continuation lines
Multi-line constructs like __all__ = [...], multi-line function calls, and dict literals had each continuation line marked as uncovered. inferMissingLines now tracks bracket depth — lines inside an unclosed ([{ are skipped as they are not independent statements.

3. ^C corruption when running pytest
VS Code's Python extension injects source /path/activate into any new terminal ~500ms after creation, corrupting running processes. Replaced terminal-based pytest run with child_process.spawn — background processes are unaffected by the Python extension's venv auto-activation.

4. Percentage mismatch across surfaces
Status bar showed raw totals (all files), tree "Overall" showed raw totals, dashboard showed filtered totals — three different numbers. All three now compute filtered stats identically (respecting excludeTestFiles).

5. Coverage tree disappeared
Moving the tree to a custom activity bar container made it undetectable. Moved back to the Explorer panel where users naturally look.

6. Dashboard tab icon invisible on dark themes
Panel tab now uses ThemeIcon('graph') which VS Code themes automatically. Dashboard header icon is inlined SVG so currentColor inherits the editor foreground on both light and dark themes.

7. Noisy info popup on every reload
Removed the showInformationMessage toast that fired on every load and auto-reload. The status bar shows the same information persistently.

What changed

  • src/parsers/coverageParser.ts — arc table detection + bracket-depth tracking in inferMissingLines
  • src/extension.ts — spawn-based pytest runner, debounced watchers, filtered status bar stats, no popup
  • src/providers/treeProvider.ts — filtered totals for Overall summary, test-file filter on file list
  • src/ui/dashboardPanel.ts — ThemeIcon for tab, inline SVG for header, filtered ring/totals
  • src/ui/statusBar.ts — accepts pre-computed filtered stats instead of raw report
  • src/config.tsexcludeTestFiles setting wired up
  • package.json — tree view moved back to Explorer, excludeTestFiles config entry added
  • assets/ — activity bar SVG icon added

kool7 added 2 commits May 3, 2026 22:31
- Parse arc table for branch-coverage .coverage files (coverage.py branch=true);
  previously all files showed 0% because line_bits is empty in that mode
- Fix inferMissingLines to track bracket depth, eliminating false red highlights
  on continuation lines inside __all__, multi-line function calls, dict literals
- Run pytest via child_process.spawn instead of a VS Code terminal; eliminates
  ^C corruption from the Python extension auto-activating the venv in terminals
- Debounce file-watcher reloads and guard handleNoCoverage with a mutex to
  prevent concurrent prompts on rapid file changes
- Filter test files from Coverage tree and dashboard (excludeTestFiles setting)
- Recompute filtered totals in tree Overall, status bar, and dashboard ring so
  all three surfaces always show the same percentage
- Remove info-message toast on every reload; status bar is sufficient
- Dashboard header icon inlined as SVG so currentColor inherits VS Code theme
- Panel tab icon uses ThemeIcon graph — works on light and dark themes
- Coverage tree moved back to Explorer panel for discoverability
- Add activity bar SVG icon and dashboard icon assets
@kool7 kool7 self-assigned this May 3, 2026
@kool7 kool7 added bug Something isn't working enhancement New feature or request ui labels May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant