feat(prune): R3 guarded deletion — confirm-to-delete + panel button

Extend BANK_PRUNE_FOLDER from report-only to dry-run→confirm-with-manifest→
delete exactly the pure-core orphan set (fresh recompute, stale entries skipped).
Windows routes to Recycle Bin (SHFileOperation+FOF_ALLOWUNDO), else unlink.
New pure prune_button module + footer button dispatching the action id. No
ext-state write, no undo point (deletion is not REAPER-undoable).
This commit is contained in:
2026-07-26 18:47:02 -04:00
parent 105a4421a8
commit 7b53ba16f6
12 changed files with 695 additions and 28 deletions
+17
View File
@@ -52,4 +52,21 @@ PruneReport buildPruneReport(
return report;
}
std::vector<std::string> pruneDeletePlan(const std::vector<std::string>& confirmed,
const std::vector<std::string>& freshOrphans) {
// fresh is a pure-core output (referenced/hand-dropped already excluded), so keeping a
// confirmed path iff it is still a fresh orphan can never re-admit an unsafe file. Walk
// `confirmed` to preserve the confirm's listing order; emitted de-dups repeats.
const std::unordered_set<std::string> freshSet(freshOrphans.begin(), freshOrphans.end());
std::vector<std::string> plan;
std::unordered_set<std::string> emitted;
for (const std::string& path : confirmed) {
if (freshSet.count(path) == 0) continue; // stale: vanished / now-referenced -> skip
if (!emitted.insert(path).second) continue; // already emitted
plan.push_back(path);
}
return plan;
}
} // namespace reasampler