Commit Graph
1255 Commits
Author SHA1 Message Date
maziggy 4cd36abfef fix(queue): update queue item status before archive lookup early return
The queue item status update (printing → completed/failed) was placed
after `if not archive_id: return` in on_print_complete. When archive
lookup failed (app restart mid-print, manual deletion), the function
returned early and the queue item stayed stuck in "printing" forever.

Over multiple print cycles, stale items accumulated — showing double
the actual printer count in the "Printing" stat and completed prints
remaining in the "Currently Printing" section.

Move the entire queue item status update block (status transition,
MQTT relay, queue-completed notification, auto-power-off) to before
the archive_id early return, matching the pattern used for SD card
cleanup.
2026-02-17 07:41:12 +01:00
maziggy 27e4fe49bd fix(ghost-print): run SD card cleanup before archive lookup and add retry logic (#374)
The SD card file cleanup (which prevents phantom prints on power cycle)
was placed after the archive_id early-return in on_print_complete. Users
with auto-archiving disabled never reached the cleanup code, so ghost
prints persisted on every reboot.

- Move cleanup before the archive_id check so it always runs
- Add retry loop (3 attempts, 2s delay) for printers that briefly lock
  the filesystem after a print ends
- Try both .3mf and .gcode extensions

Reported by @DIYofThings in #374.
2026-02-17 07:26:28 +01:00
maziggy 12399abfea fix(usage-tracker): capture ams_mapping from MQTT request topic for slicer-initiated prints
Subscribe to the MQTT request topic (device/{serial}/request) to intercept
print commands from any source (BambuStudio, OrcaSlicer, Bambu Handy, or
Bambuddy itself). Captures ams_mapping from project_file commands and passes
it through print start/complete callbacks. Fixes wrong tray attribution on
H2D Pro when prints are started from external slicers.
2026-02-17 07:07:39 +01:00
maziggy ca9ffbba5d feat(usage-tracker): add diagnostic logging for slot-to-tray mapping investigation
Usage tracking works on X1E but fails on H2D Pro — the wrong tray
is identified, attributing usage to the wrong spool. The root cause
is unknown because we don't know what MQTT mapping data each printer
model reports.

Adds INFO-level logging at print start and completion:
- state.raw_data["mapping"] (unknown format, preserved but never parsed)
- tray_now, last_loaded_tray values
- All raw_data keys containing "map" (discovery)
- Per-AMS-tray summary: tray_type, tray_color, tray_now, tray_tar

This enables comparing MQTT behavior across printer models without
requiring DEBUG mode, so testers can send normal logs.
2026-02-16 17:04:47 +01:00
maziggy cf7c459099 fix(inventory): fix usage tracking for remapped AMS slots and slicer prints
Three fixes for inventory spool usage not updating after prints:

1. Store ams_mapping from print command (reprint, library print, queue)
   so the usage tracker maps 3MF slots to the actual physical trays
   the user selected, not the default slicer mapping.

2. Track last_loaded_tray on printer state — the last valid tray_now
   (0-253) seen during printing. On H2D printers, tray_now is always
   255 in AMS data; the real tray resolves via snow field ~44s after
   print start but reverts to "unloaded" at completion. The fallback
   chain is: tray_now_at_start > current tray_now > last_loaded_tray.

3. Use color similarity (Euclidean RGB distance, threshold 50) instead
   of exact hex match for auto-unlink fingerprint checks. RFID sensors
   report slightly different shades across reads (e.g. distance ~43.6
   for the same spool), causing false assignment unlinks after prints.
2026-02-16 15:46:32 +01:00
MartinNYHC ec82e4d428 Merge pull request #401 from aneopsy/queue-plate-name
feat(queue): display plate name alongside file name for multi-plate files
2026-02-16 13:50:43 +01:00
MartinNYHC f8768b9ee9 Merge branch '0.2.0b' into queue-plate-name 2026-02-16 13:48:14 +01:00
maziggy 6ba5d43a18 fix(queue): show library file name in printer queue widget (#364)
The "Next in queue" widget on the printer card only checked
archive_name/archive_id, so file-manager-sourced queue items
displayed "Archive #null". Now falls back to library_file_name
and library_file_id, matching the Queue page display logic.
2026-02-16 13:46:22 +01:00
AneoPsy 191600b006 fix: use same query keys as PrintModal and ArchivesPage 2026-02-16 02:42:18 -10:00
MartinNYHC bf9679f232 Merge branch '0.2.0b' into queue-plate-name 2026-02-16 13:07:32 +01:00
maziggy e13a72ef19 fix(queue): create archive for library-file prints so 3MF usage tracking works (#364)
When a print was queued from the file manager (library_file_id path),
the scheduler never created an archive or called register_expected_print().
This forced on_print_start to re-download the 3MF via FTP, and if that
failed, a fallback archive with no file was created — breaking 3MF-based
filament usage tracking entirely. The queue item's archive_id also stayed
NULL, so the usage tracker couldn't find the AMS slot mapping.

Now the scheduler creates an archive from the library file before uploading,
sets item.archive_id, and the existing register_expected_print() call fires
since archive is no longer None.
2026-02-16 13:04:10 +01:00
AneoPsy f1f27cefe1 feat(queue): display plate info alongside file name for multi-plate files
- Show plate name or plate ID next to the file name in queue items
- Add translation queue.plateNumber
2026-02-16 01:51:05 -10:00
maziggy 2f61973af2 Housekeeping 2026-02-16 10:57:39 +01:00
MartinNYHC 2cb1a7d8d6 Merge pull request #387 from Keybored02/feature/ui_improvements
Fixed Archive object card clipping, added reprint icon to list view
2026-02-16 10:34:39 +01:00
MartinNYHC bb4687a832 Merge branch '0.2.0b' into feature/ui_improvements 2026-02-16 10:30:08 +01:00
maziggy bc15d49a7e feat: add clear HMS errors button to dismiss stale print errors
Add a "Clear Errors" button to the HMS error modal that sends
clean_print_error via MQTT and locally clears hms_errors for
immediate UI feedback. Useful for dismissing stale print_error
values that persist after print cancellation or transient events.
2026-02-16 10:29:07 +01:00
Matteo Parenti b0d1358b2e Change gcode/3MF preview icon 2026-02-16 10:15:44 +01:00
MartinNYHC 82964da459 Merge pull request #395 from aneopsy/queue-currently-printing-card
feat(Queue) Add more information in Currently Printing job
2026-02-16 10:09:15 +01:00
MartinNYHC 957e57f689 Merge branch '0.2.0b' into feature/ui_improvements 2026-02-16 09:59:00 +01:00
MartinNYHC 78fdb27fa5 Fix indentation in QueuePage.tsx 2026-02-16 09:55:30 +01:00
MartinNYHC ddce4d5c98 Merge branch '0.2.0b' into queue-currently-printing-card 2026-02-16 09:52:20 +01:00
maziggy 2a06ebd9f6 feat: add click-to-enlarge lightbox to skip objects modal (#396)
The small 208px image panel in the skip objects modal made it hard to
distinguish object markers when parts are close together. Clicking the
image now opens a fullscreen lightbox overlay (up to 600px) with the
same markers at a proportionally smaller size, solving the overlap
problem. Close via X button, Escape key, or backdrop click. Escape
cascades correctly — closes lightbox first, then the modal.
2026-02-16 09:50:59 +01:00
AneoPsy 7134007e6a fix(queue): optimize printer status polling and minor cleanup
- Only poll printer status for actively printing items
- Fix indentation in useQuery block
- Add trailing newline to utils/date.ts
2026-02-15 22:47:06 -10:00
AneoPsy 687a48e655 feat(queue): enhance currently printing item display
- Add progress bar, time remaining, ETA, and layer count to currently printing item
- Remove duplicate formatDuration & formatETA functions, now imported from utils/dates
- Remove formatTime (duplicate of formatDuration)
- Update formatETA to support optional i18n translation
- Update translation: common.tomorrow
2026-02-15 22:25:52 -10:00
maziggy cf0287d5c8 fix: auto-select first plate for multi-plate files in print modal (#394)
When scheduling a multi-plate file from the file manager, the modal
allowed submission without selecting a plate. Now auto-selects the
first plate by default and enforces plate selection for both archive
and library files.
2026-02-16 09:11:08 +01:00
MartinNYHC df839bb762 Merge pull request #356 from aneopsy/0.2.0b
Queue Page - Add weight information
2026-02-16 08:42:32 +01:00
MartinNYHC 0774130994 Merge branch '0.2.0b' into 0.2.0b 2026-02-16 08:36:38 +01:00
maziggy bd9821d39c The only-labels: 'feedback' parameter tells the stale bot to only process issues that have the feedback label. All other issues (feature requests with future, bug
reports, etc.) will be left alone.
2026-02-16 08:35:10 +01:00
maziggy 8b7a1697a8 feat: add thumbnail images to Telegram and ntfy notifications (#372)
Pushover and Discord already received print thumbnails, but Telegram
and ntfy only got text. Telegram now uses sendPhoto with the image as
a caption attachment. ntfy sends the image as a binary PUT with
Filename/Message headers. No config changes needed.
2026-02-16 08:31:56 +01:00
maziggy 8981c11bac fix: spool form scrollbar flicker in Edge (#364), delete SD card file after print (#374)
Add scrollbar-gutter: stable to spool form modal to prevent scrollbar
layout thrashing on Windows Edge at non-default zoom levels.

Delete uploaded .3mf from printer SD card root after print completion
to prevent phantom prints on power cycle (reported on P1S).
2026-02-16 08:21:09 +01:00
maziggy f35e662e8b fix: delete uploaded 3MF from SD card after print completes (#374)
The print scheduler uploads .3mf files to the printer's SD card root
but never cleans them up. Some printers (e.g. P1S) auto-start files
found in root on power cycle, causing phantom/ghost prints on every
reboot. Now deletes the uploaded file via FTP after print completion
(best-effort, non-blocking).
2026-02-16 08:12:14 +01:00
MartinNYHC 71b9aec857 Merge branch '0.2.0b' into feature/ui_improvements 2026-02-16 07:28:02 +01:00
maziggy be569f7577 fix: prevent spool weight corruption, add AMS weight sync, fix extruder_id
Three bugs fixed and one recovery feature added:

1. AMS remain=0 zeroed all spools on printer power-off. The weight sync
   treated 0% remain as "fully consumed," setting weight_used to
   label_weight for every assigned spool. Fix: skip remain=0 in AMS
   weight sync — empty spools are tracked by the usage tracker.

2. Editing any spool field sent stale weight_used from the React Query
   cache back to the server, resetting usage-tracked weight. Fix: only
   include weight_used in PATCH when the user explicitly changes it.

3. K-profile auto-select crashed on dual-nozzle printers for non-BL
   spools with 'SpoolKProfile has no attribute extruder_id'. The model
   attribute is 'extruder', not 'extruder_id'.

4. New "Sync Weights from AMS" button in Settings > Filament Tracking
   (built-in inventory mode) to force-recover spool weights from live
   AMS sensor data. Bypasses the "only increase" guard for explicit
   user-initiated recovery.
2026-02-15 15:47:41 +01:00
Keybored 08da1e3c43 Merge branch '0.2.0b' into feature/ui_improvements 2026-02-15 15:21:53 +01:00
maziggy 9babf5d345 fix: spool edit form overwrites usage-tracked weight
When editing a spool (changing note, color, etc.), the form always sent
weight_used back to the server. If the React Query cache held a stale
pre-print value, saving would silently reset remaining weight to full.

Track whether the user explicitly touched the weight field and only
include weight_used in the PATCH request when creating a new spool or
when the weight was intentionally changed.
2026-02-15 15:18:52 +01:00
Keybored 6ba3d91971 Merge branch '0.2.0b' into feature/ui_improvements 2026-02-15 15:01:59 +01:00
maziggy 461fcf20e5 Sync 2026-02-15 14:54:03 +01:00
MartinNYHC fa3372f402 Merge branch '0.2.0b' into 0.2.0b 2026-02-15 14:53:21 +01:00
MartinNYHC 027b964f67 Merge pull request #383 from Keybored02/feature/storage_meter
Add storage usage metering and breakdown
2026-02-15 14:49:37 +01:00
Matteo Parenti 5ad0e59209 Removed BOM, fixed apostrophe 2026-02-15 14:43:53 +01:00
Keybored 8f0abb9bde Merge branch '0.2.0b' into feature/storage_meter 2026-02-15 14:33:52 +01:00
MartinNYHC 4644d2bee0 Merge pull request #382 from Keybored02/feature/mobile_view_fix
Fix UI clipping in mobile view
2026-02-15 14:33:06 +01:00
Matteo Parenti cf5d403c26 Merge branch 'feature/mobile_view_fix' of https://github.com/Keybored02/bambuddy into feature/mobile_view_fix 2026-02-15 14:24:58 +01:00
Matteo Parenti 4ff3e2a60f Update responsive breakpoints for various components, implement useIsSidebarCompact hook 2026-02-15 14:24:50 +01:00
Keybored 9886cb2007 Merge branch '0.2.0b' into feature/mobile_view_fix 2026-02-15 14:06:44 +01:00
Keybored fc77e7aaa3 Merge branch '0.2.0b' into feature/storage_meter 2026-02-15 14:05:51 +01:00
maziggy 2de2d3be8d fix: detect archive duplicates by print name in list view (#315)
The duplicate badge on archive cards only matched by content hash,
so re-sliced prints of the same model (different GCODE, same name)
were not flagged. Now also matches by print name (case-insensitive),
consistent with the detail view's find_duplicates() logic.
2026-02-15 14:05:11 +01:00
Keybored 22114dee42 Merge branch '0.2.0b' into feature/storage_meter 2026-02-15 14:02:26 +01:00
Matteo Parenti 115f2617cf Fix TS error, add missing translation keys, fix fr locale, cleanup duplicated functions 2026-02-15 14:01:54 +01:00
maziggy aa9db501ec Changed the inventory icon from Package (box) to Disc3 (spool/reel shape) 2026-02-15 13:24:00 +01:00