Fix inconsistent and confusing project statistics display

Backend:
- Count print job records instead of summing quantities for stats
- Include "archived" status as successful (completed + archived)
- Include all failure states (failed, aborted, cancelled, stopped)
- Add completed_count and failed_count to ProjectListResponse

Frontend ProjectsPage:
- Show completed_count instead of total_items in progress displays
- Progress bar now shows "X / Y completed" to match percentage
- Add failed count indicator (red) when failures exist
- Footer stats show completed (green checkmark) and failed (red) separately

Frontend ProjectDetailPage:
- Replace confusing "Total Items" card with "Print Jobs" card
- Show "X successful" as main value, "Y failed" below in red
- Show "Z in progress" in yellow for unfinished prints
- Progress bar text changed from "items" to "completed"
- Add hint prop to StatCard component for tooltips

This ensures stats are consistent between:
- Project list page and detail page
- Stats cards and archive list counts
- Progress percentages and displayed fractions

Fixes #85
This commit is contained in:
maziggy
2026-01-14 16:26:58 +01:00
parent 3dbbd7ea19
commit c7377bfb0c
3 changed files with 59 additions and 34 deletions
+3 -1
View File
@@ -412,7 +412,9 @@ export interface ProjectListItem {
target_count: number | null;
created_at: string;
archive_count: number; // Number of print jobs
total_items: number; // Sum of quantities (total items printed)
total_items: number; // Sum of quantities (total items printed, including failed)
completed_count: number; // Sum of quantities for completed prints only
failed_count: number; // Sum of quantities for failed prints
queue_count: number;
progress_percent: number | null;
archives: ArchivePreview[];