This commit is contained in:
@@ -67,6 +67,7 @@ src/
|
||||
│ ├── assets/ # Favicon and local Nunito fonts
|
||||
│ ├── components/
|
||||
│ │ ├── AttachmentPreview.svelte # Browser-rendered PDF/image thumbnails
|
||||
│ │ ├── BatchFileList.svelte # Shared batch rows: status chips, downloads, retry
|
||||
│ │ ├── BeaArchiveProcessing.svelte
|
||||
│ │ ├── BeaWorkspaceControls.svelte # beA workspace toolbar, settings popover, dialogs
|
||||
│ │ ├── ProcessedZipArchiveEditor.svelte
|
||||
@@ -81,6 +82,9 @@ src/
|
||||
│ ├── services/
|
||||
│ │ ├── xml-reading.service.ts # Namespace-tolerant XJustiz parsing
|
||||
│ │ └── zip-inflating.service.ts # Async fflate wrapper
|
||||
│ ├── batch.ts # Sequential batch engine for multi-file tools
|
||||
│ ├── pdf-compression.ts # Shared compression presets and rasterize pipeline
|
||||
│ ├── pdf-overlay.ts # Shared PDF overlay positions and color parsing
|
||||
│ ├── pdf-processing.ts # Reusable PDF merge helper
|
||||
│ ├── pdf-thumbnails.ts # Managed pdfjs thumbnail loading and cleanup
|
||||
│ ├── utils.ts # cn() and shared component utility types
|
||||
@@ -92,7 +96,7 @@ src/
|
||||
├── tools/
|
||||
│ ├── +layout.svelte # Shared back-navigation shell
|
||||
│ ├── bea/+page.svelte # Existing ZIP archive workflow
|
||||
│ └── {merge,separate,watermark,encrypt,decrypt,compress,convert}/
|
||||
│ └── {merge,separate,stamp,watermark,encrypt,decrypt,compress,convert}/
|
||||
├── datenschutz/+page.svelte # Privacy policy
|
||||
└── impressum/+page.svelte # Imprint
|
||||
static/ # Public logo, footer art, and robots.txt
|
||||
@@ -174,6 +178,32 @@ localStorage, and `crypto.randomUUID()`. Do not invoke browser-only work during
|
||||
initialization. Keep it in event handlers, `onMount`, effects guarded by hydration, or functions only
|
||||
called in the browser.
|
||||
|
||||
## Batch processing pattern for single-PDF tools
|
||||
|
||||
Tools that transform one PDF per run (compress, watermark, encrypt, …) are being retrofitted to
|
||||
accept multiple files. Follow the established compress retrofit when adding the pattern to another
|
||||
tool; see `plan/batch-processing-plan.md` for the full design.
|
||||
|
||||
- `src/lib/batch.ts` owns the engine: `createBatchItem(file)`, `runBatch(items, process, update,
|
||||
options?)` and `formatBytes`. `runBatch` processes strictly sequentially (one PDF in flight for
|
||||
memory safety), never throws — per-item failures are caught and written to the item as a German
|
||||
error message — and consults the optional `shouldProcess` predicate so rows removed mid-run are
|
||||
skipped.
|
||||
- `src/lib/components/BatchFileList.svelte` renders the rows: name, size, status chip
|
||||
(Wartet / Verarbeite… / Fertig ✓ / Fehler), per-row download, remove, and retry buttons with
|
||||
accessible names including the file name, a progress line (“Datei 3 von 7 wird verarbeitet…”), a
|
||||
total result-size summary, a memory warning (>20 files or any file >25 MB), and the bulk
|
||||
“Alle herunterladen” ZIP action (via fflate, named `{toolname}_{date}.zip`) shown once ≥2 results
|
||||
exist. Duplicate result names inside the ZIP are suffixed instead of overwriting.
|
||||
- Page wiring: keep `items = $state<BatchItem[]>([])`, append newly dropped files (do not replace;
|
||||
deduplicate by name + size), pass a `process(file)` callback that reads the current option state
|
||||
so option changes mid-run affect only subsequent files, and gate the run button on pending items.
|
||||
Files too large to rasterize (>100 MB) are marked as error rows immediately on selection instead
|
||||
of blocking the batch.
|
||||
- Per-tool ZIP base names: compress uses `komprimiert`, watermark `wasserzeichen`, encrypt
|
||||
`geschuetzt`, decrypt `entsperrt`. Choose an analogous German name per tool and cover the batch
|
||||
flow with Playwright tests (multi-file ZIP contents, failure continuation, retry, removal).
|
||||
|
||||
## Svelte conventions
|
||||
|
||||
- Use Svelte 5 runes and current event syntax: `$props()`, `$state`, `$derived`, `$effect`, snippets,
|
||||
|
||||
Reference in New Issue
Block a user