1
0
Fork 0
mirror of https://github.com/maziggy/bambuddy.git synced 2026-05-09 08:25:54 +02:00

[PR #932] [MERGED] Feature: print files directly from project view (closes #930) #1138

Closed
opened 2026-05-07 00:16:13 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/maziggy/bambuddy/pull/932
Author: @legend813
Created: 4/9/2026
Status: Merged
Merged: 4/10/2026
Merged by: @maziggy

Base: devHead: feat/print-from-project


📝 Commits (9)

  • 74d3ff9 feat: print files directly from project view (closes #930)
  • 5114945 test
  • aaa914d feat: auto-assign project to archive when printing from project view
  • 66bbd49 Merge branch 'dev' into feat/print-from-project
  • 1dac321 fix(print-from-project): address all PR review feedback from maziggy
  • 3877161 Merge branch 'dev' into feat/print-from-project
  • 97836cb Add project validation in add_to_queue endpoint
  • 90fd27e Import User model and validate project ID
  • fdb3bc8 Fix syntax errors in add_to_queue project_id validation

📊 Changes

21 files changed (+566 additions, -31 deletions)

View changed files

📝 backend/app/api/routes/library.py (+14 -1)
📝 backend/app/api/routes/print_queue.py (+8 -0)
📝 backend/app/schemas/library.py (+2 -0)
📝 backend/app/schemas/print_queue.py (+2 -0)
📝 backend/app/services/archive.py (+4 -0)
📝 backend/app/services/background_dispatch.py (+6 -0)
📝 backend/app/services/print_scheduler.py (+1 -0)
📝 frontend/src/__tests__/components/PrintModal.test.tsx (+103 -0)
frontend/src/__tests__/pages/ProjectDetailPage.test.tsx (+225 -0)
📝 frontend/src/api/client.ts (+7 -1)
📝 frontend/src/components/PrintModal/index.tsx (+5 -0)
📝 frontend/src/components/PrintModal/types.ts (+2 -0)
📝 frontend/src/i18n/locales/de.ts (+3 -0)
📝 frontend/src/i18n/locales/en.ts (+3 -0)
📝 frontend/src/i18n/locales/fr.ts (+3 -0)
📝 frontend/src/i18n/locales/it.ts (+3 -0)
📝 frontend/src/i18n/locales/ja.ts (+3 -0)
📝 frontend/src/i18n/locales/pt-BR.ts (+3 -0)
📝 frontend/src/i18n/locales/zh-CN.ts (+3 -0)
📝 frontend/src/pages/FileManagerPage.tsx (+1 -1)

...and 1 more files

📄 Description

Description

Show printable files from linked library folders directly in the project detail page, with Print Now and Add to Queue buttons per file. Removes the detour through the File Manager for common reprint workflows.

When Print Now or Add to Queue is triggered from the project detail page, the resulting archive is automatically linked to that project — no manual assignment needed afterwards.

Closes #930

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

  • Fetch files for all linked folders in parallel via useQueries

  • Render each folder with its file list below the folder header link

  • Show Play / CalendarPlus action buttons on sliced files (.gcode, .gcode.3mf)

  • Wire PrintModal in reprint and add-to-queue modes

  • Add noFiles / print / addToQueue translation keys to all 7 locales

  • project_id flows explicitly from the UI through the full stack:

  • PrintModal accepts projectId prop (only set from ProjectDetailPage)

  • printLibraryFile API options + PrintQueueItemCreate carry project_id

  • FilePrintRequest and PrintQueueItemCreate schemas accept project_id

  • PrintDispatchJob stores project_id through background_dispatch

  • archive_print() sets project_id on the created PrintArchive

  • print_scheduler passes item.project_id when creating archive from queue

Screenshots

image image image

Testing

  • I have tested this on my local machine
  • I have tested with my printer model:

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

Prints are only flagged as project prints when they were started in the ProjectDetailView - the linkage only is not enough.


🔄 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/932 **Author:** [@legend813](https://github.com/legend813) **Created:** 4/9/2026 **Status:** ✅ Merged **Merged:** 4/10/2026 **Merged by:** [@maziggy](https://github.com/maziggy) **Base:** `dev` ← **Head:** `feat/print-from-project` --- ### 📝 Commits (9) - [`74d3ff9`](https://github.com/maziggy/bambuddy/commit/74d3ff9b22f702dd9e90962b41110a65b9017185) feat: print files directly from project view (closes #930) - [`5114945`](https://github.com/maziggy/bambuddy/commit/511494581707000209628f5f9c8b127883658292) test - [`aaa914d`](https://github.com/maziggy/bambuddy/commit/aaa914d66289a584e72b688caf922db339092143) feat: auto-assign project to archive when printing from project view - [`66bbd49`](https://github.com/maziggy/bambuddy/commit/66bbd49606f6a2c7a4a5a561c3d6068cffefd24f) Merge branch 'dev' into feat/print-from-project - [`1dac321`](https://github.com/maziggy/bambuddy/commit/1dac3212f283337569ad4b527caf61029c3b6733) fix(print-from-project): address all PR review feedback from maziggy - [`3877161`](https://github.com/maziggy/bambuddy/commit/3877161a5807ca9ac80ec269a33bc4e69775cb56) Merge branch 'dev' into feat/print-from-project - [`97836cb`](https://github.com/maziggy/bambuddy/commit/97836cb805379aca03769d08b5de220d0a2f329f) Add project validation in add_to_queue endpoint - [`90fd27e`](https://github.com/maziggy/bambuddy/commit/90fd27e66e48b4a83bf41a75033dcd030acba483) Import User model and validate project ID - [`fdb3bc8`](https://github.com/maziggy/bambuddy/commit/fdb3bc8d5f3aae53769c0b6305f6074ff4ab7e07) Fix syntax errors in add_to_queue project_id validation ### 📊 Changes **21 files changed** (+566 additions, -31 deletions) <details> <summary>View changed files</summary> 📝 `backend/app/api/routes/library.py` (+14 -1) 📝 `backend/app/api/routes/print_queue.py` (+8 -0) 📝 `backend/app/schemas/library.py` (+2 -0) 📝 `backend/app/schemas/print_queue.py` (+2 -0) 📝 `backend/app/services/archive.py` (+4 -0) 📝 `backend/app/services/background_dispatch.py` (+6 -0) 📝 `backend/app/services/print_scheduler.py` (+1 -0) 📝 `frontend/src/__tests__/components/PrintModal.test.tsx` (+103 -0) ➕ `frontend/src/__tests__/pages/ProjectDetailPage.test.tsx` (+225 -0) 📝 `frontend/src/api/client.ts` (+7 -1) 📝 `frontend/src/components/PrintModal/index.tsx` (+5 -0) 📝 `frontend/src/components/PrintModal/types.ts` (+2 -0) 📝 `frontend/src/i18n/locales/de.ts` (+3 -0) 📝 `frontend/src/i18n/locales/en.ts` (+3 -0) 📝 `frontend/src/i18n/locales/fr.ts` (+3 -0) 📝 `frontend/src/i18n/locales/it.ts` (+3 -0) 📝 `frontend/src/i18n/locales/ja.ts` (+3 -0) 📝 `frontend/src/i18n/locales/pt-BR.ts` (+3 -0) 📝 `frontend/src/i18n/locales/zh-CN.ts` (+3 -0) 📝 `frontend/src/pages/FileManagerPage.tsx` (+1 -1) _...and 1 more files_ </details> ### 📄 Description ## Description Show printable files from linked library folders directly in the project detail page, with Print Now and Add to Queue buttons per file. Removes the detour through the File Manager for common reprint workflows. When Print Now or Add to Queue is triggered from the project detail page, the resulting archive is automatically linked to that project — no manual assignment needed afterwards. ## Related Issue <!-- Link to the issue this PR addresses (if applicable) --> Closes #930 ## Type of Change <!-- Mark the relevant option with an "x" --> - [ ] Bug fix (non-breaking change that fixes an issue) - [X] 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 - Fetch files for all linked folders in parallel via useQueries - Render each folder with its file list below the folder header link - Show Play / CalendarPlus action buttons on sliced files (.gcode, .gcode.3mf) - Wire PrintModal in reprint and add-to-queue modes - Add noFiles / print / addToQueue translation keys to all 7 locales - project_id flows explicitly from the UI through the full stack: - PrintModal accepts projectId prop (only set from ProjectDetailPage) - printLibraryFile API options + PrintQueueItemCreate carry project_id - FilePrintRequest and PrintQueueItemCreate schemas accept project_id - PrintDispatchJob stores project_id through background_dispatch - archive_print() sets project_id on the created PrintArchive - print_scheduler passes item.project_id when creating archive from queue ## Screenshots <img width="1734" height="345" alt="image" src="https://github.com/user-attachments/assets/5fa2f205-9b3e-4066-863e-e9704febe9c8" /> <img width="1040" height="334" alt="image" src="https://github.com/user-attachments/assets/35f6689e-edc1-4f67-9d74-f45c2abcd764" /> <img width="1394" height="502" alt="image" src="https://github.com/user-attachments/assets/41b84ab6-1343-44b8-a341-6a36bf9d9aec" /> ## Testing <!-- Describe how you tested your changes --> - [X] I have tested this on my local machine - [ ] I have tested with my printer model: <!-- e.g., X1C, P1S, A1 --> ## Checklist - [X] My code follows the project's coding style - [X] I have commented my code where necessary - [ ] I have updated the documentation (if needed) - [X] My changes generate no new warnings - [X] I have tested my changes thoroughly ## Additional Notes Prints are only flagged as project prints when they were started in the ProjectDetailView - the linkage only is not enough. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 00:16:13 +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-maziggy-1#1138
No description provided.