Skip to content

Fix recycle bin features#59

Merged
AlanRockefeller merged 2 commits intomainfrom
test
Mar 25, 2026
Merged

Fix recycle bin features#59
AlanRockefeller merged 2 commits intomainfrom
test

Conversation

@AlanRockefeller
Copy link
Copy Markdown
Owner

@AlanRockefeller AlanRockefeller commented Mar 25, 2026

Summary by CodeRabbit

  • New Features

    • Recycle bin restore is now per-directory with destination info, per-bin file counts and a dedicated Restore button.
    • Per-bin restore provides immediate feedback and refreshes the dialog, auto-closing when no bins remain.
  • Improvements

    • Bins containing legacy files are explicitly labeled and included in restore summaries.
    • Restore results report restored, skipped, and remaining legacy items.
    • RAW previews that fail now show a “Preview unavailable” placeholder.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1766e054-4bec-4093-b8db-d75efc192d94

📥 Commits

Reviewing files that changed from the base of the PR and between 340676b and e326006.

📒 Files selected for processing (1)
  • faststack/app.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • faststack/app.py

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Fix recycle bin features' is vague and generic, lacking specificity about what was fixed or improved. Consider a more descriptive title that highlights the primary changes, such as 'Reorganize recycle bin restore UX with per-directory bins and legacy file handling' or 'Refactor recycle bin restore workflow with per-bin UI and improved error reporting'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 95.24% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 340676be22

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread faststack/app.py Outdated
Comment on lines +7435 to +7437
m = AppController._RECYCLE_UUID_RE.match(recycled_path.stem)
if m:
return m.group(1) + recycled_path.suffix
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid stripping dot-hash segments from legacy filenames

_original_name_from_recycled assumes any stem ending in .8hex is a recycle suffix and removes it, but legacy bins can contain legitimate filenames in that format (for example, photo.a1b2c3d4.jpg). Those files are then misclassified as restorable and restore_single_bin restores them under a truncated name (photo.jpg), which silently renames user files. The restore detector needs a stronger discriminator than a regex-only suffix match.

Useful? React with 👍 / 👎.

Comment thread faststack/app.py Outdated
Comment on lines +7591 to +7594
(_, jpg_bin), (_, raw_bin) = record
return (
(jpg_bin is not None and jpg_bin in restored_paths)
or (raw_bin is not None and raw_bin in restored_paths)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Normalize paths before pruning stale delete history

restore_single_bin records restored files as absolute paths (because bin_path is resolved), then _record_stale compares those absolute paths directly against stored delete_history paths. If FastStack is started with a relative image directory, delete records can contain relative recycle paths, so this comparison misses restored entries and leaves stale undo records behind. In that case, pressing Undo after a manual restore can fail against now-missing recycle-bin files.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@faststack/app.py`:
- Around line 7440-7448: _collect_active_bins currently exposes the local bin as
soon as it exists which allows a user to restore a bin that still has pending
"delete" jobs; because only completed "delete" records are pruned in
_on_delete_finished, this can reintroduce stale undo/delete history. Update
_collect_active_bins to exclude any recycle bin (including the local_bin at
image_dir / "image recycle bin") that has outstanding/pending delete jobs or
uncompleted "delete" records—query the same job/record store that
_on_delete_finished consults (the delete-records or job queue) and filter out
bins with any non-terminal delete entries before adding them to
active_recycle_bins. Ensure you reference and use the same status/check logic as
_on_delete_finished so only bins with fully completed delete processing are
returned.
- Around line 7556-7582: The loop over bin_path.iterdir() can skip files as
entries are moved; change the iteration to first snapshot the directory by
calling list(bin_path.iterdir()) (or similar) and iterate that list instead so
moves don't affect the iterator; update the loop that references
bin_path.iterdir() in the restore routine (the block that calls
self._original_name_from_recycled, moves files into dest_dir, updates
restored_paths and result counters, and logs errors) to iterate over the
snapshot to ensure all files are processed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5e182a95-a664-47bb-91a5-2d44ed7729c3

📥 Commits

Reviewing files that changed from the base of the PR and between 2968dc3 and 340676b.

📒 Files selected for processing (5)
  • ChangeLog.md
  • faststack/app.py
  • faststack/imaging/prefetch.py
  • faststack/qml/Main.qml
  • faststack/ui/provider.py

Comment thread faststack/app.py
Comment thread faststack/app.py
@AlanRockefeller AlanRockefeller merged commit b9ee8c4 into main Mar 25, 2026
3 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Apr 14, 2026
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