# Project notes for agents ## Project snapshot - **Repo name:** `juri-merger` - **App name/branding:** `beA-Edit`, published by Nominandum GmbH. - **Tech stack:** SvelteKit + Svelte 5 (runes) + TypeScript + Vite + Tailwind v4 (CSS-first). - **UI system:** shadcn-svelte (style `nova`, lucide icons) layered on a custom "nom" theme via CSS variables in `src/routes/layout.css`. - **Core purpose:** upload one or more ZIP files, extract relevant PDFs/images, preview them, optionally reorder attachments, and download a merged PDF. - **Active branch:** `features/shadcn` (shadcn-svelte integration in progress). ## Main user flow 1. User adds ZIP files via drag/drop or file picker (`ZipDropzone`). 2. `+page.svelte` starts async extraction for each file (tracked via `archiveGeneration` so stale in-flight extractions are discarded on bulk delete). 3. Each ZIP is processed into one or more `ProcessedZipArchive` entries. 4. `ProcessedZipArchiveEditor` shows thumbnails, allows reordering, and can download the merged PDF. 5. `AttachmentPreview` renders image previews directly and PDF previews via `pdfjs-dist`. 6. A fixed bottom-right settings drawer (`
`) exposes **export all** and **delete all** archive actions plus the thumbnail-width slider. ## Important source files - `src/routes/+page.svelte` — top-level page state, file selection, localStorage-backed thumbnail width, async ZIP processing, bulk export/delete, settings drawer. - `src/routes/+layout.svelte` — app shell: header with logo and footer with Nominandum GmbH legal/imprint block. - `src/routes/layout.css` — Tailwind v4 entrypoint; imports `tw-animate-css`, `shadcn-svelte/tailwind.css`, Geist + Nunito fonts; defines the semantic token layer (`--background`, `--primary`, `--secondary`, `--accent`, `--destructive`, `--radius`, etc.) mapping shadcn tokens onto the nom palette, including a `.dark` override. - `src/lib/zip-processing.ts` — archive extraction, recursive nested ZIP handling, metadata ordering, PDF merge/export, image conversion. - `src/lib/services/zip-inflating.service.ts` — thin wrapper around `fflate` unzip. - `src/lib/services/xml-reading.service.ts` — parses XJustiz XML metadata (`sender`, `receiver`, `documentNames`). - `src/lib/components/ZipDropzone.svelte` — file picker + drag/drop ZIP intake. - `src/lib/components/ProcessedZipArchiveEditor.svelte` — archive editor (name input, drag reordering, per-archive PDF download, selection mode + sub-document management, export-mode switch). - `src/lib/components/SubDocumentEditor.svelte` — sub-document block editor (editable name, count, dissolve action, draggable header for block reorder, internal horizontal reorderable attachment list). - `src/lib/components/AttachmentPreview.svelte` — preview generation for images/PDFs. - `src/lib/components/ui/button.svelte` — shadcn-backed button atom (see "Button system" below). - `src/lib/components/ui/card/` — shadcn card composition (`Root/Content/Header/Title/Description/Footer/Action`, re-exported as `Card.*`). - `src/lib/actions/ripple.ts` — Svelte action that renders a click ripple animation on an element. - `src/lib/components/icons/` — hand-rolled SVG icon components (`IconSettings`, `IconFile`, `IconMenu`, `IconNeedle`, `IconOffice`, `IconPerson`, `IconTag`, `IconTrash`, `IconChain`, `IconUnknown`). If an icon is missing, report it, and we see if we can create - `src/lib/utils.ts` — shared `cn()` helper (clsx + tailwind-merge) and `WithElementRef`/`WithoutChild` typing helpers used by shadcn components. ## Button system `src/lib/components/ui/button.svelte` is a shadcn-svelte–style primitive adapted to the nom theme: - Built with `tailwind-variants` (`buttonVariants`) and the shared `cn()` helper. - Variants: `primary`, `secondary` (gradient `secondary → --secondary-end`), `bordered`, `tertiary`, `success`. - Sizes: `standard` (h-8, rounded-16px), `large` (h-12, rounded-24px). - Renders either a `