Skip to content

Refresh the library and folder tree after an export (fixes #1674) - #1836

Open
yojen7 wants to merge 3 commits into
CyberTimon:mainfrom
yojen7:fix/1674-refresh-after-export
Open

yojen7 wants to merge 3 commits into
CyberTimon:mainfrom
yojen7:fix/1674-refresh-after-export

Conversation

@yojen7

@yojen7 yojen7 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #1674. Exporting into the source folder (or any folder in the library) doesn't show the new files in the library grid or filmstrip, and the folder image counts don't change, until a manual "Refresh folders".

Cause: the export-complete listener in src/hooks/useTauriListeners.ts only sets the export status. import-complete in the same file refreshes the folder tree and the current folder, but nothing does that after an export.

Type of Change

  • Bug fix

Changes Made

  • useTauriListeners.ts: after export-complete, export-error and export-cancelled, call refreshAllFolderTrees() and, when a folder is open, refreshImageList() (the same calls used after moving files and after indexing). Errors and cancels are included because a failed or cancelled batch can still have written some files.

This refreshes after every export, also when the destination is outside the library. A narrower version would send the output folders in the export-complete payload (export_processing.rs) and refresh only when one of them is open; I kept it frontend-only, but can do that if you prefer.

Testing

  • 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.

  • tsc --noEmit: no new errors (upstream has pre-existing ones). eslint on the file: no new findings. prettier --check: clean.

  • Untested in the GUI. Things to check: the new file appears in the grid and filmstrip after exporting into the open folder; the folder count goes up; the editor stays open when exporting from the editor (refreshImageList uses preserveEditor).

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

AI Disclaimer:

  • 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)

🤖 Generated with Claude Code

Exports into a library folder didn't show up in the grid, filmstrip or
folder counts until a manual refresh, because the export-complete
listener only set the status. Refresh the folder trees and the current
folder after an export completes, fails or is cancelled (a partial batch
can still have written files), as import-complete already does.

Fixes CyberTimon#1674

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@yojen7
yojen7 requested a review from CyberTimon as a code owner October 4, 2026 00:49
@CyberTimon

Copy link
Copy Markdown
Owner

A narrower version would send the output folders in the export-complete payload (export_processing.rs) and refresh only when one of them is open

Yes I think this would be a much cleaner approach, as most of the time you don't export into the folder you're currently in. (at least in my workflow)

yojen7 added 2 commits October 3, 2026 23:47
Emit the deduplicated output folders from completed image and LUT workers. Refresh the library and folder tree only if the current folder is among those destinations; errors and cancellations no longer force a broad refresh.

AI-assisted with Codex. Native fmt, strict Clippy and library tests pass; seven local listener tests pass. Frontend typecheck and scoped ESLint reproduce the unchanged upstream baseline (70 type errors and 34 lint errors). Local only, pending maintainer approval to push.
Track destination folders immediately after successful file writes. Emit export-outputs before the success, error or cancelled terminal event, while keeping export-complete payload-less. Match only the open folder, normalising trailing separators and Windows slash/case spelling.

AI-assisted with Codex. Fmt, locked strict Clippy, library test and 15 local listener tests pass. Frontend typecheck (70 errors) and scoped ESLint (34 errors) match the unchanged upstream baseline. Local only; no upstream push or comment.
@yojen7

yojen7 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Done, it's narrower now. The export records each folder it actually wrote a file to and sends that list in a new export-outputs event. The library and folder tree refresh only when the open folder is in the list, so exporting elsewhere doesn't touch the current view.

The event also fires for partly failed and cancelled batches, since those can still have written files into the open folder. export-complete is unchanged (no payload).

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.

BUG: Folder doesn't update after image(s) are exported into it

2 participants