[PR #669] [MERGED] [Fix]: Update location when linking/unlinking to/from Spoolman #1088

Closed
opened 2026-05-06 12:34:58 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/maziggy/bambuddy/pull/669
Author: @shrunbr
Created: 3/10/2026
Status: Merged
Merged: 3/11/2026
Merged by: @maziggy

Base: 0.2.3b1Head: 0.2.3b1


📝 Commits (9)

  • d6ca3e5 Enhance link spool functionality with additional printer and AMS details
  • 7f4754d Refactor linkSpool function to accept detailed context object for improved spooling integration
  • 40d9f9b Enhance LinkSpoolModal to include amsName in props and linkSpool mutation for improved functionality
  • b89f48a Add amsName prop to PrinterCard for enhanced spool linking functionality
  • ab1d1cd Updates LinkSpoolModal test to work with recent spool location update changes
  • b623f04 Adds clear_location to unlink testing
  • ddb7b74 Refactor LinkSpoolRequest to remove ams_name and update location generation logic for improved clarity
  • ae31d5d Remove amsName from LinkSpoolModal and PrinterCard for cleaner API integration
  • d1b7326 Remove amsName from LinkSpoolModal test props and update linkSpool mock response for improved clarity

📊 Changes

5 files changed (+49 additions, -8 deletions)

View changed files

📝 backend/app/api/routes/spoolman.py (+18 -3)
📝 backend/tests/integration/test_spoolman_api.py (+1 -0)
📝 frontend/src/__tests__/components/LinkSpoolModal.test.tsx (+9 -2)
📝 frontend/src/api/client.ts (+15 -2)
📝 frontend/src/components/LinkSpoolModal.tsx (+6 -1)

📄 Description

Description

Currently on 0.2.3b1 when linking/unlinking from Spoolman it does not properly update the location. This pull request fixes that by updating the location to {Printer Name} - {AMS Name} {Slot Number}, this also works for external spools. I have confirmed that when unlinking it does clear the location from Spoolman for both AMS and external spools.

COPILOT GENERATED SUMMARY

This pull request introduces enhancements to the spool linking functionality, allowing for more detailed location information when linking and unlinking spools. The changes span both backend and frontend, enabling the system to track and display spool locations with printer and AMS details, and ensuring the frontend passes and utilizes this information.

Fixes #667

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition or update

Changes Made

  • spoolman.py: Includes printer_id, ams_id, tray_id and ams_name to build out a location and send it along in the link update_spool request.
  • spoolman.py: Sets clear_location to True on the unlink update_spool request.
  • client.ts: Includes the same data mentioned above to be sent from frontend to backend
  • LinkSpoolModal.tsx: Includes amsName in the LinkSpoolModal and includes printerId, amsId, trayId and amsName in linkSpool API request
  • PrinterPage.tsx: Includes amsName for spool linking
  • test_spoolman_api.py & LinkSpoolModal.test.tsx: Updates these tests to reflect the changes above

Screenshots

Linking Spool:
image

Unlinking Spool:
image

Testing

  • I have tested this on my local machine
  • I have tested with my printer model: P2S w/ AMS 2 Pro

Checklist

  • My code follows the project's coding style
  • I have commented my code where necessary
  • I have updated the documentation (if needed)
  • My changes generate no new warnings
  • I have tested my changes thoroughly

Additional Notes

./test_all passed successfully for me


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/maziggy/bambuddy/pull/669 **Author:** [@shrunbr](https://github.com/shrunbr) **Created:** 3/10/2026 **Status:** ✅ Merged **Merged:** 3/11/2026 **Merged by:** [@maziggy](https://github.com/maziggy) **Base:** `0.2.3b1` ← **Head:** `0.2.3b1` --- ### 📝 Commits (9) - [`d6ca3e5`](https://github.com/maziggy/bambuddy/commit/d6ca3e53be5468238d7bde6e4e3183a58a2b28bd) Enhance link spool functionality with additional printer and AMS details - [`7f4754d`](https://github.com/maziggy/bambuddy/commit/7f4754d0c8cd858e8d4093f45d55a7b7a5c9e1d8) Refactor linkSpool function to accept detailed context object for improved spooling integration - [`40d9f9b`](https://github.com/maziggy/bambuddy/commit/40d9f9b77219d480ed97297bcce7febe0ea9fc76) Enhance LinkSpoolModal to include amsName in props and linkSpool mutation for improved functionality - [`b89f48a`](https://github.com/maziggy/bambuddy/commit/b89f48aa7c96c39ddf429ab7cf58199a2b7e315f) Add amsName prop to PrinterCard for enhanced spool linking functionality - [`ab1d1cd`](https://github.com/maziggy/bambuddy/commit/ab1d1cdbfa3223faf4baabd1559f1a4bd056018f) Updates LinkSpoolModal test to work with recent spool location update changes - [`b623f04`](https://github.com/maziggy/bambuddy/commit/b623f0448795d5d7d7db0e4604ea9fc7f7dd1b95) Adds clear_location to unlink testing - [`ddb7b74`](https://github.com/maziggy/bambuddy/commit/ddb7b74646e0ba57467f77c99413623773abc891) Refactor LinkSpoolRequest to remove ams_name and update location generation logic for improved clarity - [`ae31d5d`](https://github.com/maziggy/bambuddy/commit/ae31d5d12a70c347c7e9593ea944dd60b42bc314) Remove amsName from LinkSpoolModal and PrinterCard for cleaner API integration - [`d1b7326`](https://github.com/maziggy/bambuddy/commit/d1b732602766256d821919755797c65be9648b2d) Remove amsName from LinkSpoolModal test props and update linkSpool mock response for improved clarity ### 📊 Changes **5 files changed** (+49 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `backend/app/api/routes/spoolman.py` (+18 -3) 📝 `backend/tests/integration/test_spoolman_api.py` (+1 -0) 📝 `frontend/src/__tests__/components/LinkSpoolModal.test.tsx` (+9 -2) 📝 `frontend/src/api/client.ts` (+15 -2) 📝 `frontend/src/components/LinkSpoolModal.tsx` (+6 -1) </details> ### 📄 Description ## Description Currently on 0.2.3b1 when linking/unlinking from Spoolman it does not properly update the location. This pull request fixes that by updating the location to {Printer Name} - {AMS Name} {Slot Number}, this also works for external spools. I have confirmed that when unlinking it does clear the location from Spoolman for both AMS and external spools. **COPILOT GENERATED SUMMARY** This pull request introduces enhancements to the spool linking functionality, allowing for more detailed location information when linking and unlinking spools. The changes span both backend and frontend, enabling the system to track and display spool locations with printer and AMS details, and ensuring the frontend passes and utilizes this information. ## Related Issue <!-- Link to the issue this PR addresses (if applicable) --> Fixes #667 ## Type of Change <!-- Mark the relevant option with an "x" --> - [X] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Code refactoring - [ ] Performance improvement - [X] Test addition or update ## Changes Made <!-- List the specific changes made in this PR --> - **spoolman.py:** Includes printer_id, ams_id, tray_id and ams_name to build out a location and send it along in the link update_spool request. - **spoolman.py:** Sets clear_location to True on the unlink update_spool request. - **client.ts:** Includes the same data mentioned above to be sent from frontend to backend - **LinkSpoolModal.tsx:** Includes amsName in the LinkSpoolModal and includes printerId, amsId, trayId and amsName in linkSpool API request - **PrinterPage.tsx:** Includes amsName for spool linking - **test_spoolman_api.py** & **LinkSpoolModal.test.tsx:** Updates these tests to reflect the changes above ## Screenshots Linking Spool: <img width="1427" height="159" alt="image" src="https://github.com/user-attachments/assets/5c18617c-3b4c-4b05-91c3-fff0b0d9ce25" /> Unlinking Spool: <img width="1412" height="129" alt="image" src="https://github.com/user-attachments/assets/02eea377-08e2-4ae8-aa71-b56953d41e19" /> ## Testing <!-- Describe how you tested your changes --> - [X] I have tested this on my local machine - [X] I have tested with my printer model: P2S w/ AMS 2 Pro ## Checklist - [X] My code follows the project's coding style - [X] I have commented my code where necessary - [X] I have updated the documentation (if needed) - [X] My changes generate no new warnings - [X] I have tested my changes thoroughly ## Additional Notes ./test_all passed successfully for me --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:34:58 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/bambuddy#1088
No description provided.