Skip to content

feat(printing/ui): Spool Print selection page UX Improvement#869

Open
akira69 wants to merge 6 commits intoDonkie:masterfrom
akira69:feat/print-export-ui-upstream-split
Open

feat(printing/ui): Spool Print selection page UX Improvement#869
akira69 wants to merge 6 commits intoDonkie:masterfrom
akira69:feat/print-export-ui-upstream-split

Conversation

@akira69
Copy link
Copy Markdown

@akira69 akira69 commented Feb 24, 2026

Summary

Improves the spool pre-print selection step for larger datasets while keeping PR869 independent from the filament-printing stack.

What Changed

  • Added debounced full-dataset spool search via the existing spool ?search= API.
  • Kept the selection table viewport-filling with visible server pagination controls.
  • Kept bulk selection scoped to the currently visible rows.
  • Added Location and Lot Nr columns and preserved multi-color filament preview handling.
  • Carried forward shared saved-state hardening so malformed savedStates-* and malformed spool table hash/localStorage state recover instead of crashing.
  • Removed unrelated filament-selector locale spillover from this PR.

Screenshots

New Selection Page Layout:
image

Simple Text Search Field:
image

Testing Performed

  • cd client && ./node_modules/.bin/eslint src/pages/printing/spoolSelectModal.tsx src/utils/saveload.ts src/pages/printing/index.tsx
  • uv run ruff check spoolman/api/v1/spool.py spoolman/database/spool.py
  • /bin/bash -lc "cd /Users/dfinch/Code/Spoolman_Labels/worktrees/pr869/client && npm ci && VITE_APIURL=/api/v1 npm run build"
  • PATH=.venv/bin:$PATH SPOOLMAN_DIR_DATA=/tmp/spoolman_pr_869_data uv run uvicorn spoolman.main:app --host 0.0.0.0 --port 9869
  • Playwright on http://localhost:9869:
    • /spool/print: visible pagination rendered, page 2 navigation worked, and the first row on page 2 was spool 52
    • /spool/print: searching Rack Alpha narrowed visible results to 30 and Select/Unselect All updated the counter to 30 spools selected
    • /spool/print: enabling archived rows and searching LOT-12 surfaced archived spool 12
    • /spool/print: table scroll height adjusted from 332px at a 620px viewport to 612px at a 900px viewport
    • /spool/print?spools=1&return=%2Fspool%2Fprint: selected spool 1 advanced into the print dialog
    • Malformed persisted state recovery:
      • bad savedStates-selectedPreset and savedStates-print-previewScale no longer crash the print dialog
      • bad spool-* localStorage values and bad #sorters/#filters/#pagination hash state no longer crash /spool

Test Checklist

  • Search narrows the full spool dataset via the backend ?search= parameter
  • Bulk select only affects the currently visible rows
  • Pagination controls render and page navigation works
  • Table height responds to viewport size
  • Location and Lot Nr columns render in the selector
  • Print flow advances from selector to dialog with selected spool IDs
  • Malformed saved state recovers without crashing
  • Multi-color preview was visually inspected in the browser
  • No console errors on nested routes

Notes

  • Direct nested-route loads still log an existing service-worker registration 404 for /spool/sw.js. That showed up during validation but is outside this PR's diff.

@akira69 akira69 force-pushed the feat/print-export-ui-upstream-split branch from 547ccd5 to 79ac130 Compare February 25, 2026 17:25
akira69 added a commit to akira69/Spoolman_Labels that referenced this pull request Feb 26, 2026
akira69 added a commit to akira69/Spoolman_Labels that referenced this pull request Feb 26, 2026
@akira69 akira69 force-pushed the feat/print-export-ui-upstream-split branch 3 times, most recently from b769f25 to d5a8301 Compare February 26, 2026 14:17
akira69 added a commit to akira69/Spoolman_Labels that referenced this pull request Feb 26, 2026
@akira69 akira69 marked this pull request as ready for review February 26, 2026 17:12
@akira69 akira69 force-pushed the feat/print-export-ui-upstream-split branch from d5a8301 to b3a84f9 Compare February 26, 2026 21:11
@akira69 akira69 force-pushed the feat/print-export-ui-upstream-split branch from b3a84f9 to 378ea3a Compare February 26, 2026 21:29
@akira69 akira69 marked this pull request as draft February 27, 2026 15:04
@akira69 akira69 changed the title feat(printing/ui): split export-print selection page UX feat(printing/ui): Spool Print selection page UX Improvement Mar 2, 2026
@akira69 akira69 marked this pull request as ready for review March 2, 2026 17:17
@akira69 akira69 marked this pull request as draft March 14, 2026 05:00
akira69 added 2 commits March 17, 2026 02:39
- Remove redundant matchesSearch() and visibleDataSource (server already
  filters via the 'search' param added in bf4f8ea)
- Consolidate searchValue + serverSearchValue into single searchTerm state
- Add 300ms debounce effect (avoids API call per keystroke)
- Clear button sets debouncedSearch immediately for instant response
- Wrap selectUnselectFiltered and handleSelectItem in useCallback
- Wrap handlePageChange / handlePageSizeChange in useCallback
- Add PLR0915 noqa to spool find() (statement count increased by search impl)
- Consistent with filament selector optimisation pattern from PR846
@akira69 akira69 marked this pull request as ready for review March 19, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant