Import UI #64

Closed
opened 2026-07-04 14:52:33 +02:00 by fable-5 · 1 comment
Collaborator

Context

Users import documents from the pond sidebar and see progress and results.

Scope

'Import document' action in the sidebar new-page menu: file picker (accept .docx/.odt/.md), upload with progress, job polling with state display (queued/converting/done/failed), on success navigate to the new page, on failure show the error with retry; Markdown files import directly (no job).

Acceptance criteria

  • happy path: pick .docx → page opens with converted content (e2e with a corpus fixture)
  • failure path shows the localized error and no half-created page remains
  • concurrent imports queue cleanly and both complete

Technical notes

  • ADR 0009.

Dependencies

Depends on #63.

Size: ~1 day


Conventions: English code/comments, clear human-readable code, no hard-coded UI strings (ADR 0012, add de and en), permission checks only via the shared guard (docs/architecture/permissions.md). Read the referenced ADRs before starting.

## Context Users import documents from the pond sidebar and see progress and results. ## Scope 'Import document' action in the sidebar new-page menu: file picker (accept .docx/.odt/.md), upload with progress, job polling with state display (queued/converting/done/failed), on success navigate to the new page, on failure show the error with retry; Markdown files import directly (no job). ## Acceptance criteria - [ ] happy path: pick .docx → page opens with converted content (e2e with a corpus fixture) - [ ] failure path shows the localized error and no half-created page remains - [ ] concurrent imports queue cleanly and both complete ## Technical notes - ADR 0009. ## Dependencies Depends on #63. **Size**: ~1 day --- *Conventions: English code/comments, clear human-readable code, no hard-coded UI strings (ADR 0012, add `de` **and** `en`), permission checks only via the shared guard (docs/architecture/permissions.md). Read the referenced ADRs before starting.*
fable-5 added this to the M6 — Import, export & attachments milestone 2026-07-04 14:52:33 +02:00
fable-5 added the
frontend
label 2026-07-04 14:52:33 +02:00
Collaborator

Done in e2f942c. Pipeline fully green (all 7 contexts, incl. the new import e2e pack in the auth-e2e job); deployed to Test + Int and verified live.

What shipped

  • Sidebar "Import document" action (apps/web/src/import/): a file picker (accept .docx/.odt/.md, multiple), upload with per-file progress, and open the new page on success. useImport uploads via apiUploadFile, then for a conversion job polls GET /jobs/:id (queued → converting → done), resolves the created page's slug and navigates; the first success of a batch navigates, every success refreshes the sidebar list. Failures stay listed with the localized error and a retry. New import i18n namespace (de+en).
  • Markdown imports directly (no job): the api accepts .md/.markdown and imports in-process, returning a ConversionJobView already succeeded with resultPageId — the client navigates immediately, no polling. The media-extract → parse → create-page tail is now shared between the job path and the sync path; a conversion error on the sync path maps to an HTTP status.

Acceptance criteria

  • happy path: pick .docx → page opens with converted content (e2e with the #63 corpus fixture) — import.spec.ts; the .docx case self-skips without a reachable pandoc sidecar (CI's e2e stack is container-networked and has none, same reason #63's real-pandoc test skips in CI), so it runs locally / on a stage. Verified locally against pandoc/core:3.6 (all 4 e2e green).
  • failure path shows the localized error and no half-created page — an unsupported .txt shows the errors-namespace message; the pond's page count is unchanged.
  • concurrent imports queue cleanly and both complete — two .md imports both create their pages.

Tests: import.spec.ts (4 cases; .docx gated on E2E_PANDOC, the other three run in CI) + a .md-direct case in the api import.service.db.test.ts. Quality bar green: typecheck, lint, i18n:check, api 207, web 50.

Live verification

  • Int: uploaded a .md via the deployed endpoint → 201 succeeded (sourceFormat: md) with a resultPageId, page titled from its # heading. Web bundle serves (200). .docx end-to-end was already verified on Int in #63 and by the local e2e here.
  • Test: web serves (200), import route deployed (401 unauthenticated), readyz converter: ok. CD smoke tests green.

Next: #65 (export ZIP/docx/odt).

Done in `e2f942c`. Pipeline fully green (all 7 contexts, incl. the new import e2e pack in the auth-e2e job); deployed to Test + Int and verified live. **What shipped** - **Sidebar "Import document" action** (`apps/web/src/import/`): a file picker (accept `.docx`/`.odt`/`.md`, multiple), upload with per-file progress, and open the new page on success. `useImport` uploads via `apiUploadFile`, then for a conversion job polls `GET /jobs/:id` (queued → converting → done), resolves the created page's slug and navigates; the first success of a batch navigates, every success refreshes the sidebar list. Failures stay listed with the localized error and a **retry**. New `import` i18n namespace (de+en). - **Markdown imports directly (no job)**: the api accepts `.md`/`.markdown` and imports in-process, returning a `ConversionJobView` already `succeeded` with `resultPageId` — the client navigates immediately, no polling. The media-extract → parse → create-page tail is now shared between the job path and the sync path; a conversion error on the sync path maps to an HTTP status. **Acceptance criteria** - [x] happy path: pick `.docx` → page opens with converted content (e2e with the #63 corpus fixture) — `import.spec.ts`; the `.docx` case self-skips without a reachable pandoc sidecar (CI's e2e stack is container-networked and has none, same reason #63's real-pandoc test skips in CI), so it runs locally / on a stage. Verified locally against `pandoc/core:3.6` (all 4 e2e green). - [x] failure path shows the localized error and no half-created page — an unsupported `.txt` shows the errors-namespace message; the pond's page count is unchanged. - [x] concurrent imports queue cleanly and both complete — two `.md` imports both create their pages. **Tests**: `import.spec.ts` (4 cases; `.docx` gated on `E2E_PANDOC`, the other three run in CI) + a `.md`-direct case in the api `import.service.db.test.ts`. Quality bar green: typecheck, lint, i18n:check, api 207, web 50. **Live verification** - Int: uploaded a `.md` via the deployed endpoint → 201 `succeeded` (`sourceFormat: md`) with a `resultPageId`, page titled from its `# heading`. Web bundle serves (200). `.docx` end-to-end was already verified on Int in #63 and by the local e2e here. - Test: web serves (200), import route deployed (401 unauthenticated), `readyz` `converter: ok`. CD smoke tests green. Next: #65 (export ZIP/docx/odt).
Sign in to join this conversation.
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stwaidele/dorfteich#64
No description provided.