Commit Graph
1308 Commits
Author SHA1 Message Date
maziggy e5f3b259ea Sync 2026-02-18 17:00:33 +01:00
maziggy 1bb6758807 Updated CHANGELOG 2026-02-18 16:53:25 +01:00
MartinNYHC 8ce679986b Merge pull request #421 from wreuel/feature/brazilianPortugueseTranslation
Added translation to Brazilian Portuguese on existing strings.
2026-02-18 16:52:34 +01:00
MartinNYHC 181364c687 Merge branch '0.2.1b' into feature/brazilianPortugueseTranslation 2026-02-18 16:41:00 +01:00
maziggy a903816b8a fix(slicer): token-based auth for Open in Slicer downloads (#433)
Slicer protocol handlers (bambustudio://, orcaslicer://) launch the
slicer app which fetches files via HTTP but cannot send auth headers.
The global auth middleware returned 401, causing "importing failed."

Add short-lived, single-use download tokens: the frontend fetches a
token via authenticated POST, then builds a /dl/{token}/{filename} URL
the slicer can access without auth headers. Tokens are validated
server-side (5-min expiry, single-use). Applies to archive files,
source 3MFs, and library files.

Also fix platform-specific URL formats to match slicer source code:
- macOS: bambustudioopen:// with encodeURIComponent
- Windows/Linux: bambustudio://open?file= (was wrongly using macOS scheme on Linux)
- OrcaSlicer: orcaslicer://open?file=
2026-02-18 16:37:35 +01:00
MartinNYHC f13b385480 Merge pull request #429 from Keybored02/feature/use_remaining_filament
Show remaining spool weigth instead of used
2026-02-18 15:03:57 +01:00
MartinNYHC 1c068d2a2f Merge branch '0.2.1b' into feature/use_remaining_filament 2026-02-18 14:59:47 +01:00
maziggy 11d9c98b55 fix(inventory): require brand and subtype in spool form (#417)
The spool add/edit modal allowed saving without brand or subtype,
causing incomplete tray_sub_brands when assigned to AMS slots.
BambuStudio then failed to recognize the filament profile.

Brand and Subtype are now mandatory with validation errors on submit.
2026-02-18 14:59:03 +01:00
Wesley Reuel Marques Silva f657e4c433 Merge branch '0.2.1b' into feature/brazilianPortugueseTranslation 2026-02-18 13:33:50 +00:00
Wesley Silva 5415593951 Complying with PR 2026-02-18 13:27:34 +00:00
Matteo Parenti c68b73fde8 Merge branch 'feature/use_remaining_filament' of https://github.com/Keybored02/bambuddy into feature/use_remaining_filament 2026-02-18 14:16:21 +01:00
Matteo Parenti 07015a7f8f fix(i18n): update remaining filament labels in multiple languages 2026-02-18 14:16:03 +01:00
MartinNYHC a8d00edc4f Merge pull request #430 from aneopsy/queue-ui-improvement
feat(queue): improve mobile responsiveness for QueuePage
2026-02-18 13:51:16 +01:00
MartinNYHC 626a345596 Merge branch '0.2.1b' into feature/use_remaining_filament 2026-02-18 13:42:56 +01:00
MartinNYHC fa8e279700 Merge branch '0.2.1b' into queue-ui-improvement 2026-02-18 13:29:19 +01:00
maziggy 289dc2d5d6 Updated CI 2026-02-18 13:28:11 +01:00
AneoPsy b96afbd4ea Merge remote-tracking branch 'upstream/0.2.1b' into queue-ui-improvement 2026-02-18 02:08:53 -10:00
AneoPsy 6c308ecbd2 feat(queue): improve mobile responsiveness for QueuePage
- Summary cards: 2-col mobile grid with responsive padding, icons, and text sizing; 5th card spans full width on 2-col layout
- Filters: flex-wrap with scaled text/padding; selects share width on mobile; clear history button goes full-width
- Section headers (Pending/History): flex-wrap so sort controls wrap below title; drag hint hidden on mobile; responsive icon and text sizes
- Bulk action toolbar: flex-wrap with tighter gaps/padding; vertical divider hidden on mobile; scaled button text and icons
- SortableQueueItem: top-aligned on mobile; smaller thumbnail (10→14 at sm); metadata row wraps with truncated printer name; username hidden on mobile; badges scale down; status badge and actions stack vertically on mobile; tighter button padding
2026-02-18 02:08:42 -10:00
maziggy e0ee3a3e5c Housekeeping 2026-02-18 13:07:07 +01:00
MartinNYHC d8007fca62 Merge pull request #414 from Keybored02/feature/filament-fix
Fix: Spool Empty Weight Catalog Matching by ID
2026-02-18 12:28:23 +01:00
MartinNYHC 72f5bd445f Merge branch '0.2.1b' into feature/filament-fix 2026-02-18 12:23:21 +01:00
MartinNYHC 8a0fbbd7b4 Merge branch '0.2.1b' into feature/brazilianPortugueseTranslation 2026-02-18 12:13:33 +01:00
Matteo Parenti a649a246b2 Merge branch 'feature/filament-fix' of https://github.com/Keybored02/bambuddy into feature/filament-fix 2026-02-18 12:03:02 +01:00
Matteo Parenti 87c6bfe672 fix(spool-form): improve handling of core_weight_catalog_id and catalog ID selection logic 2026-02-18 12:02:55 +01:00
maziggy 2fd90e9dce refactor(api): rename /filaments/ to /filament-catalog/ for clarity (#427)
The /filaments/ endpoint manages material type definitions (cost, temps,
density) but shares its name with the UI's "Filament" page which shows
the spool inventory (/inventory/spools/). This caused users to expect
the API to return their spool inventory.

Rename to /filament-catalog/ to make the distinction clear. No frontend
behavior change — these API methods are defined but unused in the UI.
2026-02-18 11:58:17 +01:00
MartinNYHC e60832d9f4 Merge branch '0.2.1b' into feature/brazilianPortugueseTranslation 2026-02-18 11:34:33 +01:00
MartinNYHC b0d341a58a Merge branch '0.2.1b' into feature/filament-fix 2026-02-18 11:32:43 +01:00
maziggy 713a3e931a fix(usage-tracker): decode MQTT mapping field for correct spool tracking on multi-AMS printers (#364)
On dual-nozzle printers (H2C, H2D Pro) with multiple AMS units, usage
tracking attributed filament consumption to the wrong spools. The MQTT
mapping field — a snow-encoded array mapping slicer slots to physical
AMS trays — was preserved in state but never parsed.

Add _decode_mqtt_mapping() to convert snow encoding (ams_hw_id * 256 +
slot) to bambuddy global tray IDs. Insert as priority 2 in the mapping
resolution chain, after print_cmd ams_mapping but before queue/tray_now
fallbacks. Works for all printer models and print sources.
2026-02-18 11:24:22 +01:00
maziggy 60b5ff2363 Closes #426 2026-02-18 11:05:16 +01:00
maziggy c19de47ce5 test(mqtt): add tray_now disambiguation regression tests (28 tests)
Replay realistic MQTT message sequences through _process_message() to
cover all tray_now disambiguation paths: single-nozzle passthrough
(X1E/P2S), H2D dual-nozzle snow field, pending target, ams_extruder_map
fallback, active extruder switching, and full multi-color lifecycles.
2026-02-18 10:54:04 +01:00
maziggy 1eaf9c62e3 Updated CHANGELOG 2026-02-18 10:22:55 +01:00
maziggy 4f8cad0cf7 fix(mqtt): correct AMS-HT snow slot computation for H2D disambiguation
AMS-HT trays (IDs 128-135) are single-slot units, but the snow_slot
computation used `snow_tray % 4 if snow_tray < 128 else -1`, yielding
-1 for AMS HT. This caused a misleading "slot mismatch" debug log on
every MQTT update despite producing the correct tray_now value. Now
returns slot 0 for AMS-HT IDs (128-135), matching the firmware's
tray_now=0 for these single-slot units.
2026-02-18 10:22:02 +01:00
maziggy d46f8e8938 fix(mqtt): skip H2D tray_now disambiguation on single-nozzle printers
P2S (and X1C) with multiple AMS units incorrectly entered the H2D
dual-nozzle tray_now disambiguation code path, causing warning log
spam. The check `tray_now <= 3` matched any printer loading from
AMS 0. Now uses a persistent `_is_dual_nozzle` flag detected from
device.extruder.info (>= 2 entries), which only dual-nozzle printers
(H2D, H2D Pro) report. Flag is set early in message processing so
it's available before AMS data is parsed.
2026-02-18 09:51:39 +01:00
maziggy bedcd0a73e 1. ajv is only used by eslint to validate config schemas during linting
2. It's a dev dependency, never reaches production
  3. The ReDoS requires crafted $data schema input — not an attack vector in a linting config
2026-02-18 09:30:29 +01:00
maziggy 29e9593f6c AMS mapping fixes (7 bugs):
- backend/app/services/print_scheduler.py — hard nozzle filter + external spool extruder
- backend/app/api/routes/printers.py — ams_extruder_map race condition
- backend/app/utils/threemf_tools.py — group_id priority + dual-nozzle detection
- frontend/src/hooks/useFilamentMapping.ts — external spool extruder
- frontend/src/pages/PrintersPage.tsx — AMS-HT globalTrayId
- frontend/src/components/PrintModal/FilamentMapping.tsx — dropdown nozzle filter

Usage tracking fix:
- backend/app/services/bambu_mqtt.py — capture last valid progress/layer
- backend/app/services/usage_tracker.py — use captured values on cancel

UI fix:
- frontend/src/components/spool-form/ColorSection.tsx — color tooltip z-index

Tests:
- backend/tests/unit/test_scheduler_ams_mapping.py — 63 tests
- frontend/src/__tests__/hooks/useFilamentMapping.test.ts — 43 tests

Static assets:
- static/ — rebuilt frontend bundles
2026-02-18 09:17:50 +01:00
Wesley Silva 7ce2048e09 Fixing typo on CONTRIBUTING.md 2026-02-17 20:09:47 +00:00
Wesley Reuel Marques Silva f289ca6979 Merge branch '0.2.1b' into feature/brazilianPortugueseTranslation 2026-02-17 19:52:43 +00:00
Wesley Silva 3291e8c6f9 Added translation to Brazilian Portuguese on existing strings. 2026-02-17 19:49:57 +00:00
Matteo Parenti 7efbb1fc58 Show remaining spool weigth instead of used 2026-02-17 17:25:04 +01:00
Matteo Parenti e17b55fe22 Add tests for core_weight_catalog_id handling 2026-02-17 16:23:06 +01:00
Matteo Parenti 233f50c38d fix(inventory): spool catalog entry ID matching 2026-02-17 16:07:15 +01:00
maziggy 157dca27b7 Bumped version 2026-02-17 12:38:40 +01:00
maziggy ac2aaaac20 Bumped version v0.2.0 2026-02-17 12:36:53 +01:00
MartinNYHC 5987283f6f Merge pull request #411 from maziggy/0.2.0b
v0.2.0
2026-02-17 12:32:20 +01:00
MartinNYHC 2710fee82e Merge branch 'main' into 0.2.0b 2026-02-17 12:27:21 +01:00
maziggy a0abeba394 fix(queue): persist clear plate state across page refresh (#410)
After clicking "Clear Plate & Start Next", refreshing the page showed
the button again because the frontend determined the state purely from
the printer's FINISH/FAILED status. The backend already tracked a
plate_cleared flag in memory but never exposed it to the frontend.

- Add plate_cleared field to PrinterStatus schema and API response
- Pass plateCleared prop to PrinterQueueWidget
- Skip clear plate UI when plate is already acknowledged
- Add 2 tests for plateCleared=true behavior
2026-02-17 12:14:47 +01:00
maziggy 20e06bcf0c feat(virtual-printer): add port 3000 bind/detect server for slicer connectivity
Recent BambuStudio/OrcaSlicer updates require a bind/detect handshake on
port 3000 before connecting via MQTT/FTP. Without this, slicers cannot
discover or connect to the virtual printer in any mode.

- Add BindServer for server modes (immediate/review/print_queue)
- Add TCPProxy for raw TCP forwarding (proxy mode)
- Update Dockerfile (EXPOSE 3000) and docker-compose.yml (bridge port)
- Add 10 new tests for BindServer protocol and integration
2026-02-17 11:57:50 +01:00
maziggy a4fad2d2f5 fix(mqtt): fail-safe request topic subscription for ams_mapping capture (#405)
Some printer MQTT brokers (e.g. P1S) reject subscriptions to the request
topic by killing the TCP connection, causing a disconnect loop. The request
topic subscription for ams_mapping capture is now fail-safe with two
detection paths:

- SUBACK rejection: on_subscribe callback detects failure code 0x80
- Broker kills connection: on_disconnect detects disconnect within 10s of
  unconfirmed subscription attempt

After detection, the request topic is disabled for that printer and
reconnection succeeds with only the report topic. Printers that support
the request topic (e.g. X1E, H2D) get ams_mapping capture; printers that
don't (e.g. P1S) gracefully degrade to tray_now-based tracking.
2026-02-17 09:33:32 +01:00
maziggy bd84f8d87a Housekeeping 2026-02-17 08:57:27 +01:00
maziggy 83ed4b2581 Housekeeping 2026-02-17 08:57:09 +01:00