Skip to content

feat(export): add on-conflict if export exists; options with sidecar fingerprinting and skip for better export performance - #1921

Open
Binogulus wants to merge 5 commits into
CyberTimon:mainfrom
Binogulus:feature/export-conflict-handling
Open

Binogulus wants to merge 5 commits into
CyberTimon:mainfrom
Binogulus:feature/export-conflict-handling

Conversation

@Binogulus

Copy link
Copy Markdown

Description

When exporting images to a destination folder containing pre-existing files, RapidRAW previously had no granular control over file collisions.
This PR introduces an "On conflict" setting to the export pipeline with 4 non-blocking strategies:

  • Create unique (_1, _2) (Default): Automatically appends an incrementing numeric suffix to avoid collisions.
  • Overwrite: Always overwrites existing destination files.
  • Overwrite if changed: Computes a fast deterministic Blake3 fingerprint of the source file (modification time, adjustments JSON, target format, and export settings) stored inside the .rapidraw sidecar. If nothing changed since the last export, re-rendering and processing are skipped entirely, saving GPU/CPU resources.
  • Skip: Skips re-exporting files that already exist at the destination.
    In addition, batch exports provide clear toast notifications when images are skipped (e.g. Export completed: 3 exported, 2 skipped)

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Performance improvement
  • Code refactoring
  • Documentation update
  • UI/UX improvement
  • Build/CI or Dependency update

Changes Made

  • Rust Backend (src-tauri):
    • Added ConflictAction enum (CreateUnique, Overwrite, OverwriteIfChanged, Skip) in app_settings.rs and export_processing.rs.
    • Added pre-render conflict evaluation before decoding RAWs or running the GPU pipeline, skipping unchanged/existing files early.
    • Implemented cryptographic fingerprinting (compute_export_fingerprint) using existing blake3 and serde_json dependencies, persisted into last_exports within the .rapidraw sidecar (ImageMetadata).
    • Added collision-free path resolution for the CreateUnique strategy (filename_1.ext).
    • Enriched the export-complete Tauri event payload with { exported, skipped, total } counts.
    • Added automated unit tests verifying fingerprint determinism, sensitivity to adjustments/quality/mtime, and sidecar serialization.
  • Frontend & UI (src/):
    • Added "On conflict" selector dropdown in ExportPanel.tsx.
    • Added toast feedback in useTauriListeners.ts when files are skipped during batch export.
    • Added translations in English (en.json) and Italian (it.json).
    • Updated export settings stores and hook (useExportSettings.ts, useProcessStore.ts, ExportImportProperties.tsx).

Screenshots/Videos

Screenshot from 2026-10-13 21-37-00

Testing

[x] These changes were tested locally by a human and confirmed to work.

  • I haven't added any automated tests to the code because the codebase currently lacks a test suite.
    (Automated unit tests covering fingerprint sensitivity and metadata serialization were added to export_processing.rs and pass via cargo test).
    Test Configuration:
  • OS: Linux x86_64 (tested and verified across Linux x86_64, (.deb, appimage), Windows 11, and macOS)
  • Hardware: x86_64, Apple Silicon

Checklist

  • My code follows the project's code style
  • I haven't added unnecessary AI-generated code comments
  • My changes generate no new warnings or errors

Additional Notes

Fully backward-compatible: CreateUnique default ensures files are never accidentally overwritten.

  • Zero new external crate dependencies introduced (reuses existing project dependencies).
  • Focused, atomic diff without workflow changes or unrelated modifications.

AI Disclaimer:

Please state the involvement of AI in this PR:

  • This PR is created by an AI agent
  • This PR is mostly AI-generated but edited/merged together by a human
  • This PR was handwritten with AI assistance (spell check, logic suggestions, error resolving)
  • This PR contains only blood, sweat, and coffee (AI-free)

@Binogulus
Binogulus requested a review from CyberTimon as a code owner October 13, 2026 19:59
@Binogulus
Binogulus force-pushed the feature/export-conflict-handling branch from 1c66025 to 82265d1 Compare October 13, 2026 20:08
@Binogulus
Binogulus force-pushed the feature/export-conflict-handling branch from 82265d1 to f9a7145 Compare October 24, 2026 14:38
@Binogulus
Binogulus force-pushed the feature/export-conflict-handling branch from f9a7145 to f6168f6 Compare October 26, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant