Skip to content

feat(upload): multi-file drag-and-drop upload with per-file name + bike - #4

Merged
Addi90 merged 5 commits into
masterfrom
feat/multi-upload
Aug 30, 2026
Merged

Addi90 merged 5 commits into
masterfrom
feat/multi-upload

Conversation

@Addi90

@Addi90 Addi90 commented Aug 30, 2026

Copy link
Copy Markdown
Owner

Summary

Reworks the upload dialog into a multi-file flow: drag-and-drop (or browse) multiple GPX/FIT/TCX files, edit each file's name and bike, then upload them sequentially. A single drop is just a one-row queue, so single-file upload still works.

Changes

  • frontend/src/lib/UploadDialog.svelte — multi-file queue + drop zone, per-row name/bike editing, sequential submit with per-file status + progress, auto-close on all-success (stays open on failure).
  • frontend/src/lib/i18n.ts — new de/en keys.
  • tests/backend/routers/test_admin.py — new tests for POST /api/uploads (name+bike persistence, no-bike, default-name-from-filename, 400 bad extension, 422 empty file).
  • README.md — document the feature; drop a stale /import route reference.
  • docs/plan-multi-upload.md — the plan.

No backend changes: recompute_all(force=False) is incremental, so reusing the single-upload endpoint per file is cheap.

Validation

  • svelte-check: my files clean (the 3 remaining errors are pre-existing in RouteMap.svelte).
  • Production build: passes.
  • Backend suite: 43 passed (incl. 5 new).
  • Runtime smoke test: uploaded 2 GPX files with name+bike; both persisted correctly.

Commits

  • feat(upload): multi-file drag-and-drop upload with per-file name + bike (M1+M2)
  • feat(upload): honor prefers-reduced-motion (M3)
  • docs: plan (M0)
  • test(uploads): cover POST /api/uploads (M4)
  • docs(readme): document the feature (M5)

Addi90 added 5 commits August 30, 2026 19:44
Rework UploadDialog into a multi-file flow (M1 + M2):
- Drag-and-drop zone (and click-to-browse) accepting .fit/.tcx/.gpx/.gz, with
  dedupe by name+size. A single drop is just a one-row queue.
- Queue of files; each row editable for name (pre-filled from filename) + bike;
  per-row remove and clear-all.
- Sequential batch submit reusing the existing POST /api/uploads endpoint once
  per file; per-file status (uploading/done/error), i/n progress, and a
  completion summary. Dialog auto-closes on all-success, stays open on failure.
- RidesList reloads on the existing 'uploaded' event.

No backend changes: recompute_all(force=False) is incremental, so calling the
single-upload endpoint per file is cheap. New i18n keys added (de + en).
…ction paths

Adds tests/backend/routers/test_admin.py (M4): upload with name+bike_id
persists correctly, upload without bike leaves it null, missing name
defaults to the filename stem, unsupported extension -> 400, and a file
with no track points -> 422.
Add a Multi-file upload feature bullet and correct the now-stale wording
('individual files' -> 'one or more'; drop the nonexistent '/import' UI
route reference).
@Addi90
Addi90 merged commit 5ebd16d into master Aug 30, 2026
2 checks passed
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