Fix/dashboard setup history#6
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the web dashboard to a new “hero + timeline + overview chart” layout, and extends the /status payload to include file-type and health breakdowns to support richer UI state (including improved scheduler last-result reporting).
Changes:
- Redesignes the dashboard template structure (new hero, timeline panel, overview chart + issue pills) and adds corresponding CSS/JS rendering logic.
- Extends
/statuswithfile_typesandoverview_breakdownderived from new DB aggregation queries. - Updates/expands unit + Playwright E2E tests to assert the new dashboard elements and status payload shape.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_web_ui.py | Updates dashboard assertions and adds coverage for new overview/timeline elements. |
| tests/test_server.py | Adds test coverage for new /status fields (file_types, overview_breakdown). |
| tests/test_scheduler.py | Updates scheduler tests to account for origin="scheduled" and adds last-result reporting coverage. |
| tests/test_playwright_e2e.py | Extends E2E flow assertions for the new dashboard and adds a stale-status-response regression test. |
| semanticdog/web/templates/setup.html | Adds stable DOM hooks for dynamically updating setup warnings/scan roots. |
| semanticdog/web/templates/dashboard.html | Implements the new dashboard structure (hero, timeline, overview chart, issue pills). |
| semanticdog/web/static/app.js | Implements new dashboard rendering logic and setup diagnostics refresh after saving config. |
| semanticdog/web/static/app.css | Adds new dashboard styling for hero, timeline, overview chart, and pills. |
| semanticdog/services/scheduler.py | Tags scheduled runs with origin="scheduled" and improves last_trigger_result reporting. |
| semanticdog/services/scan_manager.py | Tracks active origin + last run summaries to support scheduler reporting and notifications. |
| semanticdog/server.py | Adds /status breakdown fields and helper functions for computing them. |
| semanticdog/scanner.py | Adjusts finish_scan(total=...) to exclude TOCTOU discards for “files examined” accuracy. |
| semanticdog/db.py | Adds get_format_status_counts() query used by the new status breakdowns. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return ` | ||
| <div class="diag-row"> | ||
| <div class="diag-icon ${iconClass}">${icon}</div> | ||
| <div> | ||
| <div class="diag-name mono" style="font-size:0.8125rem;">${root.path}</div> | ||
| <div class="row" style="gap:0.5rem; margin-top:3px;"> | ||
| <span class="badge ${badgeClass}">${badgeText}</span> | ||
| </div> | ||
| </div> |
There was a problem hiding this comment.
renderSetupDiagnostics() writes root.path into an HTML string assigned to scanRoots.innerHTML. Paths are user-controlled configuration input, so this is an XSS sink. Build the diagnostic rows with DOM APIs and set textContent for the path (or escape it) instead of interpolating into HTML.
| def _format_extension_label(ext: str) -> str: | ||
| if ext == "(no ext)": | ||
| return "No ext" | ||
| if ext == "other": | ||
| return "Others" | ||
| return ext[1:].upper() if ext.startswith(".") else ext.upper() |
There was a problem hiding this comment.
Labeling for the aggregated "other" bucket is inconsistent: _file_type_breakdown() uses "Other" while _format_extension_label() and _overview_breakdown() use "Others". This makes the API/UI harder to reason about and can lead to fragile tests. Consider standardizing on one label (singular vs plural) across both payloads/helpers.
No description provided.