Skip to content

feat(import): browser-based genome import workflow UI (#15)#40

Merged
glebis merged 3 commits into
mainfrom
worktree-feat+import-workflow-ui
May 30, 2026
Merged

feat(import): browser-based genome import workflow UI (#15)#40
glebis merged 3 commits into
mainfrom
worktree-feat+import-workflow-ui

Conversation

@glebis

@glebis glebis commented May 30, 2026

Copy link
Copy Markdown
Owner

Closes #15.

Replaces CLI-only genome import (scripts/genome_init.py) with a full browser flow — the highest-leverage onboarding/accessibility win in the backlog, since import previously gated all first use.

What's new

  • Import view (#/import, always-visible nav tab; the app lands here automatically on first run when the DB is empty).
  • Drag-and-drop or browse → format auto-detection preview (provider, version, assembly, confidence, estimated variants) before anything is written → options (profile name, min-r² for VCF, dry-run) → import → result stats + history table.

Backend

  • scripts/lib/importer.py — shared detect_file() + import_genome_file() with an atomic single-transaction import and a profile-conflict guard. genome_init.py CLI refactored to use it, so CLI and web share one tested code path.
  • backend/app/routes/imports_route.pyPOST /api/import/detect, POST /api/import/upload, GET /api/import/history. Uploads streamed to a temp file (200 MB cap, .zip rejected), parsed in a threadpool so the event loop never blocks, temp deleted after use. Status codes: 400 undetectable · 409 profile exists · 413 too large · 415 unsupported archive. Temp paths never leak in error responses.

Frontend

  • components/import/{ImportView,DropZone}, hooks/useImport, wired into App.tsx. Accessible: real <button> dropzone, aria-live status, focus moves to the result/error heading, r² help via aria-describedby.

Quality

  • TDD: 9 importer + 8 route (pytest), 9 hook/component (vitest). Full frontend suite green (517).
  • Real-browser end-to-end verified: upload → detect (23andMe/GRCh37/95%) → import (19 variants) → history → empty-DB auto-route to Import.
  • Design notes, prototype, codex audit resolutions, and a gpt-image-2 UX mockup in docs/import-ui/.

Notes for reviewers

  • Pre-existing tsc strict errors and optional-dep test gaps (weasyprint/textual) exist on main and are unrelated; none are in the import code.

🤖 Generated with Claude Code

glebis and others added 3 commits May 29, 2026 16:47
Replace CLI-only import with a full browser flow: drag-and-drop upload,
format auto-detection preview, options (profile / min-r² / dry-run),
result stats, and import history.

Backend
- scripts/lib/importer.py: shared detect_file() + import_genome_file()
  with an atomic single-transaction import and a profile-conflict guard.
  genome_init.py CLI refactored to use it — one code path for CLI and web.
- backend/app/routes/imports_route.py: POST /api/import/detect,
  POST /api/import/upload, GET /api/import/history. Uploads streamed to a
  temp file (200 MB cap, .zip rejected), parsed in a threadpool, temp
  deleted after use. Status codes: 400 undetectable, 409 profile exists,
  413 too large, 415 unsupported archive.

Frontend
- components/import/{ImportView,DropZone}, hooks/useImport, wired into
  App.tsx as an always-visible "Import" view (#/import). An empty database
  lands on Import for first-run onboarding. Accessible dropzone (real
  button + aria-live status + focus management; r2 help via aria-describedby).

Tests (TDD): 9 importer + 8 route (pytest), 9 hook/component (vitest); full
suites green (frontend 517). Verified end-to-end in a real browser
(upload -> detect -> import -> history -> empty-DB auto-route).

Design notes, prototype, and codex audit resolutions in docs/import-ui/.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@glebis glebis merged commit a3179a0 into main May 30, 2026
2 checks passed
@glebis glebis deleted the worktree-feat+import-workflow-ui branch May 30, 2026 20:28
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.

Import workflow UI

1 participant