Skip to content

feat(import): add Ampersand importer#41

Merged
SiteRelEnby merged 1 commit into
mainfrom
feat/ampersand-import
Jul 15, 2026
Merged

feat(import): add Ampersand importer#41
SiteRelEnby merged 1 commit into
mainfrom
feat/ampersand-import

Conversation

@SiteRelEnby

@SiteRelEnby SiteRelEnby commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Adds an "Import from Ampersand" flow, cloned from the PluralSpace importer. The backend already exposes the
source, so this is purely the Android client.

Backend contract (already live in sheaf)

  • Preview: POST /v1/import/ampersand/preview (multipart, part file) -> AmpersandPreviewSummary
    (category counts + limit_warnings; no per-member list).
  • Submit: the unified POST /v1/imports/file with source="ampersand_file", idempotency_key, and an
    options JSON (AmpersandImportOptions). Same runner shape as PluralSpace / Prism / Tupperbox.
  • Format: a plain .json export (images inline as base64 data URIs, hence the server`s 100MB cap).

Android side

  • New AmpersandPreviewSummary model + ImportJobSource.AMPERSAND_FILE, and a previewAmpersandImport
    endpoint. createFileImport / getImportJob are reused unchanged.
  • AmpersandImportViewModel + AmpersandImportScreen under ui/ampersandimport/.
  • Because the preview has no member list, there is no selective-member UI - every real member imports
    (member_ids stays null). The ten content toggles mirror the servers options (custom_fronts, custom_fields, tags, groups, front_history, journals, notes, board_messages, reminders, images), each shown only when the export has that content and defaulted on accordingly. groups` imports Ampersand systems as Sheaf groups; the board-messages toggle also gates polls (the server
    couples them), which the label makes explicit.
  • Reuses the shared machinery: streaming upload, the latched idempotency key (retry resumes the same job),
    terminalResult() for the generic counts render, standard poll loop.
  • Wired into Settings > Data (card + route + nav lambda).

The options JSON is hand-built to match the servers extra="forbid"model exactly (field names verified againstschemas/ampersand_import.py`).

Verification

  • :app:assemblePlayRelease :app:testPlayReleaseUnitTest green.
  • Needs a device pass with a real Ampersand .json export

Intended to land before v1.2.3.

The backend already exposes the Ampersand import source (preview at
/v1/import/ampersand/preview, submit via the unified /v1/imports/file runner
with source "ampersand_file"), so this is the Android client for it, cloned from
the PluralSpace importer.

Ampersand's preview reports category counts only (no per-member list), so there
is no selective-member UI: every real member is imported (member_ids stays
null). The options mirror the server's AmpersandImportOptions
(conflict_strategy=skip plus the ten content toggles), each defaulted on only
when the export actually contains that kind of content. Groups imports Ampersand
systems as Sheaf groups; the board-messages toggle also gates polls.

Reuses the shared import machinery: streaming file upload, the latched
idempotency key so a poll-failure retry resumes the same job, terminalResult()
for the generic counts render, and the standard poll loop.

Wired into Settings > Data (card + route) alongside the other importers.
@SiteRelEnby
SiteRelEnby enabled auto-merge July 15, 2026 04:23
@SiteRelEnby
SiteRelEnby merged commit 56d16c3 into main Jul 15, 2026
1 check passed
@SiteRelEnby
SiteRelEnby deleted the feat/ampersand-import branch July 15, 2026 04:26
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