--- phase: 09-ux-tech-debt-closure plan: "01" subsystem: ui tags: [fastapi, htmx, jinja2, oob-swap, driver-upload, pytest] # Dependency graph requires: - phase: 03-printer-configuration provides: printer_form.html with Alpine.js x-data and driver for OOB targeting - caller=printer_form sentinel-based OOB branching in upload handler - 4 new integration tests (500 regression x2 + OOB contract x2) + 1 printer form test affects: - 09-02-playwright-port-autofill (depends on final printer_form.html shape) - 10-rtval (runtime validation uses driver upload flow) # Tech tracking tech-stack: added: [] patterns: - "HTMX OOB swap via hx-swap-oob=\"true\" on sibling element in same response body" - "Caller-context sentinel: hidden form field name=caller value=printer_form" - "FastAPI mixed multipart: UploadFile + Form() parameters in same handler" - "TDD RED-GREEN: write failing tests, diagnose from output, implement fix" key-files: created: - imptune/templates/partials/driver_upload_with_oob.html - tests/test_printer_form.py modified: - imptune/api/drivers.py - imptune/templates/partials/printer_form.html - tests/test_driver_upload.py key-decisions: - "Sentinel field (caller=printer_form) chosen over HX-Target header for caller detection — explicit and testable without HTTP header manipulation" - "OOB template includes driver_list.html as primary swap + sibling ` with new driver auto-selected - Wired inline driver upload form in `printer_form.html`: sibling `
` with `caller=printer_form` sentinel, outside the printer `` to comply with HTML spec - Added stable `id="printer-form-driver-select"` to driver `