feat(home): offer to delete the old versions' folders updates left on the disk #121

Merged
HumanBean merged 1 commit from madebyjordan/LongshotLauncher:feat/leftover-folders into main 2026-11-15 22:57:52 +00:00
Member

Before #104 each update built the new version in a new folder and left the old one on the disk, a whole game (~40 GB) with no row in the list. The README says "nothing deletes them yet", and #104 lists deleting them as a follow-up. This adds that: when the home opens, it offers to delete those folders once nothing of the player's is left in them.

What changed

  • The offer (HomeView.axaml, HomeViewModel): an Old versions left on the disk card, the same kind as the Hookshot and NX2navi offers. It names the versions and the folder, says nothing of the player's is in them (their saves are in the shared folder), and gives what deleting frees once measured. It has two buttons:

    • Keep leaves them and remembers it (KeptFolders in settings.json), so the card doesn't come back.
    • Delete removes each folder off the window's thread, then toasts what was freed. It refuses while Longshot runs, as Delete on a row does. No new build can start while it runs, since NewFolder may hand a new build an unlisted game folder.
  • Which folders (Core/Leftovers.cs, Leftovers.Find): the game folders directly in the builds folder that no build lists. It looks once, when the home opens, after Saves.Gather has taken their saves in on Windows. Never offered:

    • a link, or a folder that holds a build's folder (or is inside one) or the launcher's home
    • one with a save still in user/save (a gather that hasn't run, or couldn't)
    • one whose user/ or user/save is a link (the player's own arrangement)
    • one with anything in mods/: an update to a new folder left the player's mods in the old one

    Only user/save is looked at: Gather leaves the saves it took in as save.moved-* beside it, and its backup in oot-save-backups/gather-* keeps them. A finished folder keeps make_game.py's .longshot_exefs/.longshot_romfs, so those are no sign of a stopped build (a first build that stopped has no stamp, so it isn't a game folder).

  • Deleting is BuildRegistry.DeleteFolder, as a row's Delete is: game folders only, links not followed, never one holding a build's folder or the home. BuildRegistry.Holds is now internal so Leftovers can use it. What it frees is Disk.Measure over the leftovers, so a game file still hard-linked into a build isn't counted.

  • README ("A new build's folder is named after its channel"): what the home offers. docs/saves.md (Saves from before): the folder goes with its save.moved-*, and the gather's backup keeps the save.

  • Every new text is in every catalog, after "Delete" rather than at the end, where other PRs append.

  • tools/screenshots: home-leftovers, home-leftover. HomeViewModel.ShowLeftovers is the scenes' stand-in for the disk.

Screenshots

From tools/screenshots, Windows (960x600), in the comment below: the offer for two old versions, and for one.

Testing

Windows 11, .NET SDK 10.0.404, on main @ d79e1e4.

  • tests/launcher_core/LeftoverChecks.cs (new), on a scratch builds folder:
    • offered: a leftover whose saves were gathered (save.moved-*, .longshot_romfs kept), and one with an empty mods/
    • not offered: the build's own folder, one with a save in user/save, one with a mod, a stopped first build (no stamp), a folder that isn't a game's, a loose file, a kept folder, one that holds a build's folder, and one that holds the home
    • a stamp with no version (shown by its folder's name), and no builds folder
    • links: user/ a link, and a builds folder entry that is a link
    • Delete, as the home does it: the leftover goes and the build stays, and a folder holding a build's is refused
  • python -I tests/test_launcher_core.py: on Windows the run stops at ShellLinkChecks, the same on main (the shell's shortcut on the test's Unicode scratch path). So LeftoverChecks, RegistryChecks and SettingsChecks were also run right after ReleaseNotesChecks, locally, and passed. The link cases need links, so on Windows without Developer Mode they say they were skipped. The full run is CI's, on Linux.
  • On this PC (read only): the real leftover Games\Longshot\nightly-130-0caf0618, from an update before #104, meets every rule. It has user\save.moved-20261115-121040, no user\save, no mods, a stamp, and make_game.py's .longshot_* folders. Its save is in oot-save-backups\gather-20261115-121040\nightly-130-0caf0618. Nothing was deleted.
  • dotnet build App/LongshotLauncher.csproj and tools/screenshots: 0 errors. dotnet format --verify-no-changes on the changed files: nothing on the lines changed here.
  • scripts/translations.py: every catalog lacks the same 25 texts as on main.
  • Merges: test-merged with every open PR that merges with main. #119, #59 and #46 merge cleanly; #74, #55, #50, #49 and #42 already conflict with main.

Not tested: pressing Delete in the window on a real leftover. It runs a row's Delete (BuildRegistry.DeleteFolder), which the checks above run on the folders Find gives.

🤖 Generated with Claude Code

Before #104 each update built the new version in a new folder and left the old one on the disk, a whole game (~40 GB) with no row in the list. The README says "nothing deletes them yet", and #104 lists deleting them as a follow-up. This adds that: when the home opens, it offers to delete those folders once nothing of the player's is left in them. ## What changed - **The offer** (`HomeView.axaml`, `HomeViewModel`): an *Old versions left on the disk* card, the same kind as the Hookshot and NX2navi offers. It names the versions and the folder, says nothing of the player's is in them (their saves are in the shared folder), and gives what deleting frees once measured. It has two buttons: - **Keep** leaves them and remembers it (`KeptFolders` in settings.json), so the card doesn't come back. - **Delete** removes each folder off the window's thread, then toasts what was freed. It refuses while Longshot runs, as Delete on a row does. No new build can start while it runs, since `NewFolder` may hand a new build an unlisted game folder. - **Which folders** (`Core/Leftovers.cs`, `Leftovers.Find`): the game folders directly in the builds folder that no build lists. It looks once, when the home opens, after `Saves.Gather` has taken their saves in on Windows. Never offered: - a link, or a folder that holds a build's folder (or is inside one) or the launcher's home - one with a save still in `user/save` (a gather that hasn't run, or couldn't) - one whose `user/` or `user/save` is a link (the player's own arrangement) - one with anything in `mods/`: an update to a new folder left the player's mods in the old one Only `user/save` is looked at: Gather leaves the saves it took in as `save.moved-*` beside it, and its backup in `oot-save-backups/gather-*` keeps them. A finished folder keeps make_game.py's `.longshot_exefs`/`.longshot_romfs`, so those are no sign of a stopped build (a first build that stopped has no stamp, so it isn't a game folder). - **Deleting** is `BuildRegistry.DeleteFolder`, as a row's Delete is: game folders only, links not followed, never one holding a build's folder or the home. `BuildRegistry.Holds` is now `internal` so `Leftovers` can use it. **What it frees** is `Disk.Measure` over the leftovers, so a game file still hard-linked into a build isn't counted. - **README** ("A new build's folder is named after its channel"): what the home offers. **docs/saves.md** (Saves from before): the folder goes with its `save.moved-*`, and the gather's backup keeps the save. - Every new text is in every catalog, after "Delete" rather than at the end, where other PRs append. - **tools/screenshots:** `home-leftovers`, `home-leftover`. `HomeViewModel.ShowLeftovers` is the scenes' stand-in for the disk. ## Screenshots From `tools/screenshots`, Windows (960x600), in the comment below: the offer for two old versions, and for one. ## Testing Windows 11, .NET SDK 10.0.404, on main @ d79e1e4. - `tests/launcher_core/LeftoverChecks.cs` (new), on a scratch builds folder: - offered: a leftover whose saves were gathered (`save.moved-*`, `.longshot_romfs` kept), and one with an empty `mods/` - not offered: the build's own folder, one with a save in `user/save`, one with a mod, a stopped first build (no stamp), a folder that isn't a game's, a loose file, a kept folder, one that holds a build's folder, and one that holds the home - a stamp with no version (shown by its folder's name), and no builds folder - links: `user/` a link, and a builds folder entry that is a link - Delete, as the home does it: the leftover goes and the build stays, and a folder holding a build's is refused - `python -I tests/test_launcher_core.py`: on Windows the run stops at `ShellLinkChecks`, the same on main (the shell's shortcut on the test's Unicode scratch path). So `LeftoverChecks`, `RegistryChecks` and `SettingsChecks` were also run right after `ReleaseNotesChecks`, locally, and passed. The link cases need links, so on Windows without Developer Mode they say they were skipped. The full run is CI's, on Linux. - On this PC (read only): the real leftover `Games\Longshot\nightly-130-0caf0618`, from an update before #104, meets every rule. It has `user\save.moved-20261115-121040`, no `user\save`, no `mods`, a stamp, and make_game.py's `.longshot_*` folders. Its save is in `oot-save-backups\gather-20261115-121040\nightly-130-0caf0618`. Nothing was deleted. - `dotnet build App/LongshotLauncher.csproj` and `tools/screenshots`: 0 errors. `dotnet format --verify-no-changes` on the changed files: nothing on the lines changed here. - `scripts/translations.py`: every catalog lacks the same 25 texts as on main. - Merges: test-merged with every open PR that merges with main. #119, #59 and #46 merge cleanly; #74, #55, #50, #49 and #42 already conflict with main. Not tested: pressing Delete in the window on a real leftover. It runs a row's Delete (`BuildRegistry.DeleteFolder`), which the checks above run on the folders `Find` gives. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(home): offer to delete the old versions' folders updates left on the disk
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Compile and test (pull_request) Blocked by required conditions
0c47ece6e2
Before updates stayed in their build's folder (#104), each update built the new version in a new folder and left the
one before on the disk with no row: ~40 GB per update, and the README said nothing deletes them yet. The home now finds
them (Leftovers.Find: unlisted game folders in the builds folder with nothing of the player's left in them, after
Saves.Gather took their saves in) and offers Keep or Delete, with what deleting frees.

- Never offered: a link, a folder that holds a build's or the launcher's home, one with a save still in user/save, a
  linked user/ or save/, or anything in mods/. Keep is remembered (KeptFolders).
- Delete runs BuildRegistry.DeleteFolder (game folders only, links not followed), not while Longshot runs, and no new
  build starts meanwhile (NewFolder may reuse an unlisted game folder)
- LeftoverChecks; tools/screenshots home-leftovers, home-leftover; README, docs/saves.md; every catalog

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Screenshots (tools/screenshots, Windows, 960x600): the offer for two old versions, and for one.

home-leftovers
home-leftover

home-leftovers.png

home-leftover.png

Screenshots (tools/screenshots, Windows, 960x600): the offer for two old versions, and for one. ![home-leftovers](home-leftovers.png) ![home-leftover](home-leftover.png) ![home-leftovers.png](https://git.magicbean.dev/attachments/17b7140e-38c7-48da-9c2d-c8ba9dfe2589) ![home-leftover.png](https://git.magicbean.dev/attachments/bee9137c-12b5-417b-bfa6-8046bf2fc6c1)
madebyjordan changed title from WIP: feat(home): offer to delete the old versions' folders updates left on the disk to feat(home): offer to delete the old versions' folders updates left on the disk 2026-11-15 22:26:20 +00:00
HumanBean deleted branch feat/leftover-folders 2026-11-15 22:57:52 +00:00
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Compile and test (pull_request) Blocked by required conditions
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher!121
No description provided.