Skip to content

feat: history tracking — manual snapshots, fingerprint diff, trends view#8

Merged
Lefix2 merged 2 commits intomainfrom
feat/history-tracking
May 2, 2026
Merged

feat: history tracking — manual snapshots, fingerprint diff, trends view#8
Lefix2 merged 2 commits intomainfrom
feat/history-tracking

Conversation

@Lefix2
Copy link
Copy Markdown
Owner

@Lefix2 Lefix2 commented May 1, 2026

Summary

  • HistoryManager — append-only NDJSON storage in .vscode/codeclimate-visualiser.history.ndjson; fingerprint resolution with 3 tiers (native / derived / volatile)
  • Sidebar History section — collapsible, shows snapshots newest-first with +new/−fixed diffs and ⚠ when derived fingerprints are used; save icon button + per-row delete
  • Command CodeClimate: Save History Snapshot — prompts for optional label, saves current loaded issues
  • Trends view fully replaced: SVG line chart, diff KPIs (new/fixed/net), snapshot table with inline label editing, per-severity deltas, delete

Fingerprint strategy

Source Key Used when
native issue.fingerprint CodeClimate provides it
derived sha1(check_name:path:line) fingerprint absent but check_name + path present
volatile sha1(check_name:description) fallback

Derived/volatile issues are counted but flagged with ⚠ in diff displays — new/fixed counts may drift if code moves.

Test plan

  • Load a report → Save Snapshot (with label)
  • Load same/different report → Save Snapshot again → verify sidebar shows +new / −fixed diff
  • Open Trends tab → line chart + diff KPIs appear
  • Edit snapshot label inline in table
  • Delete snapshot from table and from sidebar
  • Load report with no fingerprints → save two snapshots → verify ⚠ shown

🤖 Generated with Claude Code

TREFOU Felix and others added 2 commits May 1, 2026 12:29
Storage: append-only NDJSON at .vscode/codeclimate-visualiser.history.ndjson

Fingerprint resolution (HistoryManager):
- native:  issue.fingerprint used directly
- derived: sha1(check_name:path:line) when fingerprint absent
- volatile: sha1(check_name:description) as last resort
  derived/volatile shown with ⚠ warning in diff

Sidebar (SourcesViewProvider):
- New "History" collapsible section showing snapshots newest-first
- Each entry: label, date, total count, +new/-fixed diff vs previous, ⚠ if derived
- Save icon button in History header → runs saveSnapshot command
- Delete button per snapshot

Command: CodeClimate: Save History Snapshot
- Prompts for optional label (e.g. v1.2.3, sprint-42)
- Saves current loaded issues as snapshot

Trends view (buildTrendsView):
- 0 snapshots → save-first prompt
- 1 snapshot  → severity KPI cards
- 2+ snapshots → SVG line chart (total + per-severity overlays),
  new/fixed/persisting diff KPIs, full snapshot table with
  inline label editing, delta indicators, delete per row

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Sidebar: click report filename → opens JSON in editor (vscode.open)
- History diff now compares current loaded issues vs last snapshot
  (not snapshot vs snapshot) — uses computeCurrentState() fingerprints
- Trends view redesigned to match Claude Design prototype:
  * 3 header cards with colored left stripe (Introduced/Fixed/Net)
  * New vs Fixed SVG area chart with area fills and dots per data point
  * Per-severity mini-cards with ▲/▼ delta + sparkline
  * Full line chart including current state as rightmost point
- Overview KPI cards now show ▲/▼ delta vs last snapshot + sparklines
- KPI secondary row (Major/Minor/Info) shows delta arrows
- CSS: kpi-delta, kpi-spark, kpi-sev-delta, trend-card-stripe styles

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Lefix2 Lefix2 merged commit ea3fdb9 into main May 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant