perf: reuse preview on apply instead of reprocessing

Pass the already-processed preview data URL when applying edits.
The thumbnail updates instantly without triggering another process cycle.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-05-14 07:10:00 -04:00
parent dbb896e2b7
commit e37dd6f25d
2 changed files with 10 additions and 4 deletions

View File

@@ -89,9 +89,15 @@
editingImage = null;
}
function handleApplyPipeline(imageId: string, config: PipelineConfig): void {
function handleApplyPipeline(imageId: string, config: PipelineConfig, processedDataUrl: string | null): void {
imagesStore.setPipelineOverride(imageId, config);
imagesStore.reprocessImage(imageId, deviceStore.selected);
if (processedDataUrl) {
// Use the already-processed preview directly
imagesStore.updateImage(imageId, { processedDataUrl });
} else {
// Fallback: reprocess if no preview available
imagesStore.reprocessImage(imageId, deviceStore.selected);
}
}
function handleClearAll(): void {