Description
The report panel (reportPanel.ts) is a static snapshot. Once opened, it does not update when new scan results arrive. Users must close and re-open the panel to see fresh results. The status bar shows the latest score, but the report panel falls out of sync.
Current Behavior
showReportPanel() creates a new webview each time
- The caller passes
diagnosticsProvider.lastReport which is a snapshot
- No mechanism exists to push updates to an already-open panel
Expected Behavior
Option A: Auto-refresh open panel
- Track if a report panel is currently open
- When new scan results arrive, post a message to the webview with updated data
- The webview re-renders findings and score in-place
Option B: Reveal existing panel
- Before creating a new panel, check if one already exists
- If it does, reveal it (bring to front) instead of creating a duplicate
- Optionally refresh its content
Recommended: Both
- Reuse the existing panel if one is open
- Auto-refresh content when new scan results are available
- Use
panel.webview.postMessage({ type: 'update', results }) to push updates
Implementation Notes
- Store the active panel reference in a module-level variable
- Register a
postMessage handler in the webview JS
- In
diagnostics.ts, after scan completes, call a updateReport() function
- Handle the case where the panel has been closed by the user (dispose event)
Acceptance Criteria
Complexity
Medium — requires webview lifecycle management and cross-module communication.
Points
150
Description
The report panel (
reportPanel.ts) is a static snapshot. Once opened, it does not update when new scan results arrive. Users must close and re-open the panel to see fresh results. The status bar shows the latest score, but the report panel falls out of sync.Current Behavior
showReportPanel()creates a new webview each timediagnosticsProvider.lastReportwhich is a snapshotExpected Behavior
Option A: Auto-refresh open panel
Option B: Reveal existing panel
Recommended: Both
panel.webview.postMessage({ type: 'update', results })to push updatesImplementation Notes
postMessagehandler in the webview JSdiagnostics.ts, after scan completes, call aupdateReport()functionAcceptance Criteria
Complexity
Medium — requires webview lifecycle management and cross-module communication.
Points
150