1. bambu_mqtt.py: Added hms_errors to the completion callback data, which includes the HMS error codes when a print fails
2. archive.py: Updated update_archive_status() to accept an optional failure_reason parameter
3. main.py: Added auto-detection of failure reasons:
- status == "aborted" → failure_reason = "User cancelled"
- status == "failed" with HMS errors → maps module codes to reasons:
- Module 0x07 (Filament) → "Filament runout"
- Module 0x0C (Motion Controller) → "Layer shift"
- Module 0x05 (Nozzle) → "Clogged nozzle"
Frontend changes:
1. ArchivesPage.tsx:
- Badge now shows "cancelled" for aborted prints, "failed" for failed prints
- "Failed Prints" collection and "Hide Failed" filter now include both failed and aborted statuses
2. EditArchiveModal.tsx: Failure reason field now shows for both failed and aborted prints
New tests added:
- test_hms_errors_included_in_failed_completion_callback
- test_aborted_status_when_cancelled
The HMS error module mapping is basic and can be expanded as you observe more failure types. The actual Bambu HMS error codes are documented in their wiki - we can add
more mappings as needed.
- frontend/src/components/TimelapseViewer.tsx:17 - Changed from 0.5 to 2
2. Archive page: hide failed prints filter with persistence
- Added hideFailed state initialized from localStorage.getItem('archiveHideFailed')
- Added localStorage persistence via useEffect
- Added "Hide Failed" toggle button (red styling when active) next to the Favorites button
- Filter is automatically bypassed when viewing the "Failed Prints" collection
- "Reset" button also clears this filter
The filter state persists across page refreshes and browser sessions via localStorage.
- Separate AMS and AMS-HT notification switches (one per device type)
- Fix notification variables not showing (duration, filament, estimated_time)
- Add fallback values for empty notification variables ("Unknown" instead of blank)
Settings:
- Fix API keys badge count only showing after visiting tab
- Move External Links card to third column above Updates
- Add Release Notes modal for viewing full notes before updating
Statistics:
- Fix filament usage trends not showing (wrong API parameters)
- Move dashboard controls (Hidden, Reset Layout) to header row
- Remove duplicate Reset Layout button
Camera:
- Fix ffmpeg processes not killed when closing webcam window
- Add /camera/stop endpoint with POST support for sendBeacon
- Track active streams and proper cleanup on disconnect
- Add database model for storing AMS sensor history (humidity, temperature)
- Record sensor data every 5 minutes via background task
- Add API endpoint to retrieve history with min/max/avg statistics
- Create AMSHistoryModal component with Recharts line charts
- Make humidity/temperature indicators clickable to open history
- Support time range selection (6h, 24h, 48h, 7d)
- Show threshold reference lines on charts (Good/Fair levels)
- Add configurable data retention (default 30 days) in Settings
- Auto-cleanup old data daily
- Fix dark theme styling in modal using inline styles
- Add Escape key to close modal
### Projects / Print Grouping
- Create projects to group related prints (e.g., "Voron Build" with 50 parts)
- Track progress with target count and completion percentage
- Assign archives to projects via edit modal or context menu
- Project cards show archive thumbnails with clickable links
- Color-coded project badges on archive cards
- Filter and manage projects by status (active/completed/archived)
### Full-Text Search (FTS5)
- SQLite FTS5 virtual table for efficient searching
- Search across print_name, filename, tags, notes, designer, filament_type
- Automatic index sync with triggers for INSERT/UPDATE/DELETE
### Webhooks & API Keys
- API key authentication with granular permissions
- Permissions: can_read_status, can_manage_queue, can_control_printer
- Secure key generation with prefix display only after creation
- Settings page API Keys tab for key management
- Webhook endpoints for external integrations
### Failure Analysis
- Dashboard widget showing failure rate with color coding
- Correlate failures with conditions (filament type, printer, time)
- Top failure reasons breakdown
- Weekly trend visualization
### Archive Comparison
- Select 2-5 archives to compare side-by-side
- Highlight differences in print settings (yellow)
- Success/failure correlation insights
- Modal with close via button, X, Escape, or backdrop
### CSV/Excel Export
- Export archives and statistics with current filters
- Support for both CSV and Excel (.xlsx) formats
- openpyxl dependency added
## Bug Fixes
- Fixed context menu submenu not showing (removed overflow-hidden)
- Fixed project card thumbnails using correct API endpoint
- Fixed EditArchiveModal to invalidate projects query on save
- Fixed clipboard API fallback for HTTP contexts
- Fixed archive PATCH 500 error (FTS5 index rebuild)
- Fixed FastAPI trailing slash routing for projects endpoint
## UI Improvements
- Context menu submenu with hover/click support
- Project badge on archive cards with project color
- "Go to Project" context menu item for assigned archives
- Clickable project card thumbnails linking to archives
- Reset Layout button moved to Stats page header
- Add hamburger drawer navigation for mobile (< 768px)
- Create useIsMobile hook for responsive breakpoint detection
- Create useLongPress hook for touch gesture context menus
- Update Button component with 44px min-height for WCAG touch compliance
- Update Toggle component with larger mobile size (44x28px)
- Add responsive padding (p-4 md:p-8) to all pages
- Update ArchivesPage with mobile menu button and horizontal scroll filters
- Update SettingsPage with stacked column layout on mobile
- Increase drag handle sizes for touch-friendly reordering
- Add CSS utilities for touch-manipulation and safe-area insets
- Add AMS4TrayIcon and AMS1TrayIcon SVG components with colored spool slots
- Spool colors displayed inside device icon windows with gray overlay frames
- Empty slots shown as white with diagonal strike (matching slicer style)
- Fix AMS-HT nozzle mapping bug (HT-A was showing Left instead of Right)
- Use actual ams.id for extruder map lookup before normalizing
Cloud Profiles (ProfilesPage.tsx):
- Add template visibility control (showInModal flag)
- Eye/EyeOff toggle in templates modal to show/hide templates
- Only templates with showInModal=true appear in preset modals
- Default new templates to showInModal=true in save dialog
- Add preset diff/compare view with two modes:
- Compare button in edit modal (preset vs base)
- Compare mode on main page (two-preset comparison)
- Side-by-side diff with added/removed/changed highlighting
- Stats showing added/removed/changed/same counts
- Search filter and Changes/All toggle
- Type restriction (only compare same preset types)
- Fix array value display (show "value" instead of ["value"])
- Fix printer preset G-code display (format escaped \n as real newlines)
- Fix modal overflow issues with proper flex patterns
- Fix light theme colors for compare selection text
- Add dynamic humidity indicator with Bambu Lab style water drop icons
- Empty drop for good (dry), half-filled for fair, full for bad (wet)
- Configurable thresholds via Settings page
- Add dynamic temperature indicator with thermometer icons
- Empty for good, half-filled for fair, full for hot
- Colors match humidity: green/gold/red
- Add AMS Display Thresholds settings card
- Humidity thresholds (good/fair) configurable
- Temperature thresholds (good/fair) configurable
- Persisted in backend settings
- Fix AMS card stability issues
- Add ams_extruder_map to WebSocket broadcasts
- Cache AMS data and extruder map to prevent bouncing
- Fix L/R nozzle indicator for dual-nozzle H2 printers
- Fix status summary bar counting
- Don't count printers with unknown status as offline
- Theme-aware L/R nozzle badges (light/dark theme support)