Add searchable and flattened export, history re-export and diagnostics self-test

issueAndArchive keeps an issued invoice even when rendering or archiving
fails (Issued - not archived, with a Render & archive action). The export
menu offers a searchable PDF or a 300 DPI image-only PDF whose metadata is
the invoice number alone; flatten failures offer Retry or searchable export
and never silently lower the resolution. History re-exports the original
as issued by default and warns when a re-render's layout fingerprint
differs. The render client gains a FIFO assemble lane that previews cannot
supersede. A Diagnostics panel runs fixtures in the real worker and
compares against goldens generated from Node.
This commit is contained in:
2026-10-04 06:11:23 +05:30
parent 7162dac6e7
commit f1b7502e9d
30 changed files with 2727 additions and 154 deletions
+10
View File
@@ -0,0 +1,10 @@
import { assembleImagePdf } from "../assemble";
import { renderBytes } from "./core";
import type { AssembleJob, AssembleResult } from "./jobs";
/** Runs an assemble job where it is called: the worker, the main thread, or a Node test. */
export async function runAssembleJob(job: AssembleJob): Promise<AssembleResult> {
const t0 = performance.now();
const bytes = await renderBytes(assembleImagePdf({ pages: job.pages, title: job.title }));
return { id: job.id, bytes, ms: Math.round(performance.now() - t0) };
}