- SUMMARY.md created: one-line fix, two new tests, full suite green - STATE.md updated: Phase 15 complete, decisions logged - ROADMAP.md: Phase 15 marked 1/1 Complete 2026-04-16 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
9.5 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | must_haves | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15-ux-driver-upload-feedback-fix | 01 | execute | 1 |
|
true |
|
|
Purpose: A technician uploading a driver on /printers/new must see the upload confirmation — driver name + driver list table — immediately after uploading, without reloading the page. The OOB select refresh (dropdown update) must continue to work.
Output: One-line template change to printers_new.html (remove style="display:none"), two new integration assertions in tests/test_printer_form.py.
<execution_context> @C:/Users/SebastienQUEROL/.claude/get-shit-done/workflows/execute-plan.md @C:/Users/SebastienQUEROL/.claude/get-shit-done/templates/summary.md </execution_context>
@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/phases/15-ux-driver-upload-feedback-fix/15-RESEARCH.md @.planning/phases/15-ux-driver-upload-feedback-fix/15-VALIDATION.mdFrom imptune/templates/printers_new.html (line 87-99, current state):
<form hx-post="/drivers/upload"
hx-target="#driver-list"
hx-encoding="multipart/form-data"
hx-swap="outerHTML">
<input type="hidden" name="caller" value="printer_form">
<label>
<span x-text="$store.i18n.t('upload_new_driver')">Upload New Driver</span>
<input type="file" name="file" accept=".zip" required>
</label>
<button type="submit" class="secondary" x-text="$store.i18n.t('upload_driver')">Upload Driver</button>
</form>
<div id="driver-list" style="display:none"></div> <!-- BUG: hidden — line 98 -->
</div>
From tests/conftest.py — client fixture:
@pytest.fixture
def client(tmp_data_dir):
from imptune.main import app
with TestClient(app) as c:
yield c
From tests/test_driver_upload.py — helper _make_driver_zip:
SAMPLE_INF = """\
[Version]
Signature="$Windows NT$"
...
[Strings]
MFG="Test Manufacturer"
DRIVER_NAME="Test LaserJet Pro"
"""
def _make_driver_zip(
inf_content: str = SAMPLE_INF,
inf_name: str = "sample.inf",
extra_files: dict[str, bytes] | None = None,
) -> bytes:
...
Note: _make_driver_zip is defined in test_driver_upload.py — do NOT import it.
Replicate a minimal equivalent helper locally in test_printer_form.py (or inline the zip creation).
test_printers_new_driver_list_visible:
- GET /printers/new, assert 200
- Assert
'id="driver-list"' in resp.text(anchor exists) - Assert
'id="driver-list" style="display:none"' not in resp.text(not hidden)
test_upload_feedback_visible_on_printers_new:
- Build a minimal driver ZIP in-memory: create a
BytesIO+zipfile.ZipFile, write one .inf file containingDRIVER_NAME="Test LaserJet Pro"using the same SAMPLE_INF-style content as intest_driver_upload.py. Do NOT import fromtest_driver_upload.py— replicate the ~10-line helper inline or as a local_make_driver_zip_for_form_testfunction at the top of the new block. - POST to
/drivers/uploadwithfiles={"file": ("driver.zip", zip_bytes, "application/zip")}anddata={"caller": "printer_form"} - Assert
resp.status_code == 200 - Assert
"Test LaserJet Pro" in resp.text(upload confirmation contains driver name) - Assert
'hx-swap-oob="true"' in resp.text(OOB select still present — regression guard)
Add required imports at top of file if not already present: import io, import zipfile.
Run tests after writing — they MUST fail (RED) before the template fix.
Run: pytest tests/test_printer_form.py::test_printers_new_driver_list_visible tests/test_printer_form.py::test_upload_feedback_visible_on_printers_new -x -q
Expected: test_printers_new_driver_list_visible FAILS (div is currently hidden).
Expected: test_upload_feedback_visible_on_printers_new may PASS already (server response is correct; visibility is DOM-side). If it passes, that is expected and acceptable — the server already returns the driver name in the fragment; the bug is only that the DOM target is hidden. Document this in a comment.
pytest tests/test_printer_form.py::test_printers_new_driver_list_visible tests/test_printer_form.py::test_upload_feedback_visible_on_printers_new -x -q
Both test functions exist in tests/test_printer_form.py. test_printers_new_driver_list_visible FAILS (RED — confirming the bug). test_upload_feedback_visible_on_printers_new PASSES (server fragment is correct). Test file has no import errors.
Change:
<div id="driver-list" style="display:none"></div>
To:
<div id="driver-list"></div>
That is the complete change. Do NOT modify any other line. Do NOT touch printer_form.html. Do NOT touch driver_upload_with_oob.html. Do NOT touch driver_list.html.
After saving, run the full targeted test suite to confirm GREEN:
pytest tests/test_printer_form.py tests/test_driver_upload.py -x -q
Then run the full suite (excluding e2e) to confirm no regression:
pytest tests/ -x -q --ignore=tests/e2e
pytest tests/test_printer_form.py tests/test_driver_upload.py -x -q
tests/test_printer_form.py::test_printers_new_driver_list_visiblePASSES (GREEN — div no longer hidden)tests/test_printer_form.py::test_upload_feedback_visible_on_printers_newPASSEStests/test_driver_upload.py::test_upload_returns_oob_when_called_from_formPASSES (no regression)- Full suite
pytest tests/ -x -q --ignore=tests/e2eis green printers_new.htmlline 98 reads<div id="driver-list"></div>with no style attribute
<success_criteria>
- GET /printers/new:
#driver-listdiv exists with nostyle="display:none"attribute - POST /drivers/upload with caller=printer_form: response fragment contains driver name (upload confirmation)
- OOB select (
hx-swap-oob="true") still present in upload response (no regression) - All tests pass:
pytest tests/ -x -q --ignore=tests/e2e - Single-line change in
printers_new.html— no other files modified except test additions </success_criteria>