From a24455ba68798bf1ff35fc32149d73aa6695ed04 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 26 Jan 2026 12:40:50 -0800 Subject: [PATCH 1/5] docs: add Discord community badge and link to README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 186afad..d06aaaa 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # PrintQue - 3D Printer Management System +[![Discord](https://img.shields.io/badge/Discord-PrintQue-5865F2?logo=discord&logoColor=white)](https://discord.gg/UhFBCKdq) + PrintQue is a powerful and easy-to-use management system designed for 3D print farms. It provides centralized control, monitoring, and queue management for multiple 3D printers, helping you maximize efficiency and productivity. ## Quick Start @@ -258,6 +260,7 @@ Logs are stored in your user directory: ### Support For assistance with PrintQue: +- **Discord**: [Join our community](https://discord.gg/UhFBCKdq) - **Email**: zhartley@hotmail.ca - **Website**: www.printque.ca From 059faebc6d9d25e45108f9594f4bb83b8979fdd2 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 26 Jan 2026 12:41:19 -0800 Subject: [PATCH 2/5] feat: add Windows executable signing and enhance PrinterCard with delete functionality --- .github/workflows/release.yml | 23 +++++++++++++++++++ api/services/state.py | 3 ++- app/src/components/printers/PrinterCard.tsx | 25 +++++++++++++++++++-- 3 files changed, 48 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cfaf2e4..04a6d4c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -86,6 +86,29 @@ jobs: - name: Build executable run: python build.py --skip-deps --version ${{ steps.get_version.outputs.version }} + - name: Sign Windows executable + if: matrix.platform == 'Windows' && env.CERTIFICATE_BASE64 != '' + env: + CERTIFICATE_BASE64: ${{ secrets.CODE_SIGNING_CERT_BASE64 }} + CERTIFICATE_PASSWORD: ${{ secrets.CODE_SIGNING_CERT_PASSWORD }} + run: | + # Decode certificate + echo "$CERTIFICATE_BASE64" | base64 -d > certificate.pfx + + # Sign the executable + & "C:\Program Files (x86)\Windows Kits\10\bin\x64\signtool.exe" sign ` + /f certificate.pfx ` + /p "$env:CERTIFICATE_PASSWORD" ` + /tr http://timestamp.digicert.com ` + /td sha256 ` + /fd sha256 ` + /d "PrintQue" ` + "dist\PrintQue-${{ steps.get_version.outputs.version }}-Windows\PrintQue.exe" + + # Clean up + Remove-Item certificate.pfx + shell: pwsh + - name: Upload artifact uses: actions/upload-artifact@v4 with: diff --git a/api/services/state.py b/api/services/state.py index ebaaa15..ddf37c0 100644 --- a/api/services/state.py +++ b/api/services/state.py @@ -13,7 +13,8 @@ from flask import current_app # Set up logging directory -LOG_DIR = os.path.join(os.path.expanduser("~"), "PrintQueData") +# Support DATA_DIR environment variable for test isolation +LOG_DIR = os.path.join(os.getenv('DATA_DIR', os.path.expanduser("~")), "PrintQueData") os.makedirs(LOG_DIR, exist_ok=True) LOG_FILE = os.path.join(LOG_DIR, "app.log") diff --git a/app/src/components/printers/PrinterCard.tsx b/app/src/components/printers/PrinterCard.tsx index b5f5dd6..d55001f 100644 --- a/app/src/components/printers/PrinterCard.tsx +++ b/app/src/components/printers/PrinterCard.tsx @@ -9,6 +9,7 @@ import { Square, Thermometer, } from 'lucide-react' +import { toast } from 'sonner' import { Badge } from '@/components/ui/badge' import { Button } from '@/components/ui/button' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' @@ -19,7 +20,14 @@ import { DropdownMenuTrigger, } from '@/components/ui/dropdown-menu' import { Progress } from '@/components/ui/progress' -import { useClearError, useMarkReady, usePausePrint, useResumePrint, useStopPrint } from '@/hooks' +import { + useClearError, + useDeletePrinter, + useMarkReady, + usePausePrint, + useResumePrint, + useStopPrint, +} from '@/hooks' import type { Printer } from '@/types' interface PrinterCardProps { @@ -56,12 +64,23 @@ export function PrinterCard({ printer }: PrinterCardProps) { const resumePrint = useResumePrint() const markReady = useMarkReady() const clearError = useClearError() + const deletePrinter = useDeletePrinter() const handleStop = () => stopPrint.mutate(printer.name) const handlePause = () => pausePrint.mutate(printer.name) const handleResume = () => resumePrint.mutate(printer.name) const handleMarkReady = () => markReady.mutate(printer.name) const handleClearError = () => clearError.mutate(printer.name) + const handleDelete = async () => { + if (confirm(`Are you sure you want to delete printer "${printer.name}"?`)) { + try { + await deletePrinter.mutateAsync(printer.name) + toast.success('Printer deleted') + } catch (_error) { + toast.error('Failed to delete printer') + } + } + } const isPrinting = printer.status === 'PRINTING' const isPaused = printer.status === 'PAUSED' @@ -237,7 +256,9 @@ export function PrinterCard({ printer }: PrinterCardProps) { Edit - Delete + + Delete + From 07e0718c53080f7eeeacb276c4f6f699b8cb019a Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 26 Jan 2026 12:42:31 -0800 Subject: [PATCH 3/5] chore: remove Windows executable signing from release workflow --- .github/workflows/release.yml | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 04a6d4c..cfaf2e4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -86,29 +86,6 @@ jobs: - name: Build executable run: python build.py --skip-deps --version ${{ steps.get_version.outputs.version }} - - name: Sign Windows executable - if: matrix.platform == 'Windows' && env.CERTIFICATE_BASE64 != '' - env: - CERTIFICATE_BASE64: ${{ secrets.CODE_SIGNING_CERT_BASE64 }} - CERTIFICATE_PASSWORD: ${{ secrets.CODE_SIGNING_CERT_PASSWORD }} - run: | - # Decode certificate - echo "$CERTIFICATE_BASE64" | base64 -d > certificate.pfx - - # Sign the executable - & "C:\Program Files (x86)\Windows Kits\10\bin\x64\signtool.exe" sign ` - /f certificate.pfx ` - /p "$env:CERTIFICATE_PASSWORD" ` - /tr http://timestamp.digicert.com ` - /td sha256 ` - /fd sha256 ` - /d "PrintQue" ` - "dist\PrintQue-${{ steps.get_version.outputs.version }}-Windows\PrintQue.exe" - - # Clean up - Remove-Item certificate.pfx - shell: pwsh - - name: Upload artifact uses: actions/upload-artifact@v4 with: From 72e8816522466830ed43ffa7157c2523e88ee0bf Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 26 Jan 2026 12:46:46 -0800 Subject: [PATCH 4/5] chore(readme): updating support --- .husky/pre-commit | 21 +++++++++++++-------- README.md | 2 -- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 54333a0..f314350 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,18 +1,23 @@ #!/bin/sh -# Run lint-staged for frontend files (Biome) -cd app -npx lint-staged -cd .. +# Run lint-staged for frontend files (Biome) only if there are relevant files staged +STAGED_FRONTEND_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '^app/.*\.(js|ts|tsx|json)$' || true) +if [ -n "$STAGED_FRONTEND_FILES" ]; then + echo "Running Biome on staged frontend files..." + cd app + npx lint-staged || exit 1 + cd .. +fi # Run Ruff for Python backend files -if command -v ruff >/dev/null 2>&1; then - # Get staged Python files in api directory - STAGED_PY_FILES=$(git diff --cached --name-only --diff-filter=ACM -- '*.py' | grep '^api/') - if [ -n "$STAGED_PY_FILES" ]; then +STAGED_PY_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '^api/.*\.py$' || true) +if [ -n "$STAGED_PY_FILES" ]; then + if command -v ruff >/dev/null 2>&1; then echo "Running Ruff on staged Python files..." echo "$STAGED_PY_FILES" | xargs ruff check --fix # Re-add fixed files to staging echo "$STAGED_PY_FILES" | xargs git add fi fi + +exit 0 diff --git a/README.md b/README.md index d06aaaa..f96d9a7 100644 --- a/README.md +++ b/README.md @@ -261,8 +261,6 @@ Logs are stored in your user directory: For assistance with PrintQue: - **Discord**: [Join our community](https://discord.gg/UhFBCKdq) -- **Email**: zhartley@hotmail.ca -- **Website**: www.printque.ca ## Development From 388526f4e5ae501679b51d2ea2a0649704cc8d64 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 26 Jan 2026 12:48:54 -0800 Subject: [PATCH 5/5] test(printercard): fix failed test mock --- app/src/__tests__/components/PrinterCard.test.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/__tests__/components/PrinterCard.test.tsx b/app/src/__tests__/components/PrinterCard.test.tsx index 7e403e0..0596887 100644 --- a/app/src/__tests__/components/PrinterCard.test.tsx +++ b/app/src/__tests__/components/PrinterCard.test.tsx @@ -15,6 +15,15 @@ vi.mock('../../hooks', () => ({ useResumePrint: () => ({ mutate: vi.fn(), isPending: false }), useMarkReady: () => ({ mutate: vi.fn(), isPending: false }), useClearError: () => ({ mutate: vi.fn(), isPending: false }), + useDeletePrinter: () => ({ mutate: vi.fn(), mutateAsync: vi.fn(), isPending: false }), +})) + +// Mock sonner toast +vi.mock('sonner', () => ({ + toast: { + success: vi.fn(), + error: vi.fn(), + }, })) const createWrapper = () => {