Several support reports traced back to one root cause: a mistyped access
code in Add Printer left an empty card on the dashboard. POST /printers/
was persisting the row first, then firing connect_printer() fire-and-forget.
Now we test_connection() BEFORE the insert; failure returns HTTP 400 and
the row is never written.
Structured error response -- detail={"code", "message"} -- so the toast
shows the localized message instead of the English fallback. New
ApiError.code field on the frontend; printers.toast.connectionFailedNotAdded
PR #920 was merged without a CHANGELOG entry and without test coverage
for the location filter dropdown (every other new control — name
search, model search, serial search, whitespace trim, clear button,
status filter, empty states, combined filters — already had tests).
Adds:
- `filters by location via dropdown` — overrides the printers mock so
printer 1 has location 'Workshop' and printer 2 has location
'Office', then verifies that selecting each location shows only the
matching printer and that switching between the two works.
- `hides location filter when no printers have a location` — both
printers get a null location, and the test asserts the status filter
dropdown is still rendered but the location filter dropdown is not.
- CHANGELOG entry under [0.2.3b3] > New Features crediting the
contributor and documenting the search/filter feature, including the
WebSocket-reactive status filter behavior.
* feat(printers): add live search/filter bar to printers page
Adds a search bar below the page title that filters the printer list
in real time by name, model, location, and serial number. Includes an
X button to clear the search and an empty-state message when no
printers match. Filtering is purely client-side — no backend changes
needed.
Closes#852
H2/A1 series have linear rails, not carbon rods. X1/P1/P2S have carbon
rods, not linear rails. Split rod-specific maintenance into model-aware
pairs: "Lubricate/Clean Carbon Rods" for X1/P1/P2S and "Lubricate/Clean
Linear Rails" for A1/H2. Added rod type classification to printer_models
and startup cleanup for stale/duplicate system maintenance types.
Bug 1: Delete printer was not actually deleting archives when
delete_archives=True (default). The if-condition was inverted, causing
archives to remain and potentially causing FK constraint issues.
Bug 2: SmartPlug.printer_id had unique=True constraint, preventing
multiple HA scripts from being linked to the same printer. Removed the
constraint to allow multiple plugs/scripts per printer (matching
feature/176 behavior).
Closes#214
Backend:
- pytest configuration with async support and coverage
- Unit tests for notification service (23 tests)
- Unit tests for smart plug manager (12 tests)
- Unit tests for archive service (16 tests)
- Integration tests for API endpoints
- Fix: notifications now send immediately (digest is summary only)
Frontend:
- Vitest configuration with jsdom and coverage
- MSW for API mocking
- Component tests for Toggle, Button, Card, ConfirmModal (77 tests)
- Test utilities with custom render wrapper
CI/CD:
- GitHub Actions workflow for automated testing
- Backend lint, unit tests, integration tests
- Frontend lint, type-check, unit tests, build