spliit
spliit copied to clipboard
[feature] File-based group creation / Spliit-JSON-Import (core, formats, server, UI)
This PR introduces a lean, extensible import architecture and wires the Spliit‑JSON format as the first adapter. Goal: reliable import/export as a core capability to ensure data sovereignty and smooth onboarding.
Motivation
- Import/Export is central: users should control their data and move it between instances.
- Onboarding from Splitwise should be simple and lossless (no balance drift) and feel reliable.
- A long-requested Splitwise import (refs #22) needs a solid, generic import foundation, not a one-off integration.
- To accelerate the discussion, a working prototype was built. With a lot of help of AI, it works. But I’m not a web developer — a thorough review is welcome.
Scope in this PR
- Core layer: import models, registry, and file pipeline under
src/lib/imports/**. - Formats: Spliit‑JSON v1 and a Debug format; automatic detection via
looksLike+ confidence (highest wins; deterministic tie-breaks). - Server: TRPC procedures for preview/start/chunk/cancel/finalize under
groups/import. - UI: import dialog (analyze → preview → import) with progress and cancel; import is enabled only after a successful analysis.
- Integration: “Import from file” as a submenu next to Create; “Add by URL” is unchanged vs trunk.
- Large flows: progress UI and user-initiated cancel are included.
Decisions
- Automatic format detection keeps the UI simple and resilient; explicit user selection would add friction, and future versions of the same tools will vary in structure.
- Focus on unobtrusive integration: the new import flow sits next to existing create actions without altering the established UI patterns.
Future work
- Splitwise adapter (multi-language), more formats.