feat(versions): show previous launcher builds and remove one in one action #317

Open
riqmarmes wants to merge 4 commits from riqmarmes/LongshotLauncher:feat/previous-launcher-builds into main
Contributor

Why. A player upgrading from Longshot Launcher 1.3.x arrives with a complete Longshot build that the new launcher cannot run (it plays only longshot-builder versions), and today nothing says so: Versions is empty and the only trace is one generic sentence. Players conclude their 20–30 GiB build is gone and switch back to stable. This change shows the previous launcher's builds, explains them, and gives one honest action to clean them up without losing saves or the game dump. (It also removes the separate "Clean up files" trip: Remove now does the generated-file cleanup and the folder removal in one confirmed action.)

What changed.

  • New src/game/previous.rs: lists the previous launcher's installations read-only from its builds.json plus a folder scan (version, folder, size, last used date), de-duplicated against this launcher's own versions. Nothing is registered, played or modified during discovery.
  • Home: an outlined card, "Your previous launcher's game is still here", with the build's version/size/date, what happened to it, a hint on returning to the stable launcher, and one Manage button styled like the version picker's Manage (opens Versions).
  • Versions → From the previous launcher: Build a new version above the section title and outside the cards (the existing wizard, with the game file linked automatically by the separate first-run change); each build row then has Remove… and Open folder to its right.
  • Remove… in one action: confirmation dialog; backs up that build's own user/ saves; runs the previous launcher's reviewed generated-file cleanup (storage::clean_previous, the Storage → Previous launcher list, now also including old toolchains); resolves reparse-point ancestors (e.g. OneDrive) and then deletes only that build's actual folder. It refuses unknown folders, the launcher's own folder, a linked build folder, or a running game; shared saves and the original game dump are never touched. A row shows "Removing this build…" while the background work runs, and the result reports the files/bytes cleaned and where the saves were backed up.
  • 11 new UI strings in all 14 non-English catalogs (English drafts, to be translated in a later pass); docs updated in README, docs/saves.md.

Tests.

  • 10 new unit tests in previous: listing newest-first with versions/sizes/dates, folder-scan fallback, de-duplication of registered versions, display rows, save-backup-then-remove, generated-file cleanup, a build reached through a Windows junction, and the refusal cases (unknown folder, the launcher's own folder).
  • cargo fmt --all -- --check; cargo clippy --locked --all-targets -- -D warnings; cargo test --locked → 192 passed on Windows with the same 14 pre-existing environment-only failures (junction/symlink, Steam and portable-folder tests), none in touched code; python -I scripts/translations.py; Tooling tests/test_release.py → 46 tests OK. The branch is merged up to main @ ed29aca.
  • Not run: the builder-contract half of tests/test_launcher_core.py (needs the pinned Longshot checkout 7015105c) and tests/test_rust_window.py (needs a Linux display); CI covers both.
  • UI checked on Windows against a synthetic launcher home: a copied save set, a fake empty .nup, and a 75-byte mock old build, so no real game data or game build is involved. Screenshots are attached on the screenshot comment. The original game file, saves, and the previous launcher's own files were left byte-identical by the discovery path.

Screenshots. Attached on the screenshot comment: Home card + Manage, the updated Versions layout (Build above the previous-launcher section; Remove then Open folder in the row), and the Remove confirmation.

**Why.** A player upgrading from Longshot Launcher 1.3.x arrives with a complete Longshot build that the new launcher cannot run (it plays only `longshot-builder` versions), and today nothing says so: Versions is empty and the only trace is one generic sentence. Players conclude their 20–30 GiB build is gone and switch back to stable. This change shows the previous launcher's builds, explains them, and gives one honest action to clean them up without losing saves or the game dump. (It also removes the separate "Clean up files" trip: Remove now does the generated-file cleanup and the folder removal in one confirmed action.) **What changed.** - New `src/game/previous.rs`: lists the previous launcher's installations read-only from its `builds.json` plus a folder scan (version, folder, size, last used date), de-duplicated against this launcher's own versions. Nothing is registered, played or modified during discovery. - **Home**: an outlined card, "Your previous launcher's game is still here", with the build's version/size/date, what happened to it, a hint on returning to the stable launcher, and one **Manage** button styled like the version picker's Manage (opens Versions). - **Versions → From the previous launcher**: **Build a new version** above the section title and outside the cards (the existing wizard, with the game file linked automatically by the separate first-run change); each build row then has **Remove…** and **Open folder** to its right. - **Remove… in one action**: confirmation dialog; backs up that build's own `user/` saves; runs the previous launcher's reviewed generated-file cleanup (`storage::clean_previous`, the Storage → Previous launcher list, now also including old toolchains); resolves reparse-point ancestors (e.g. OneDrive) and then deletes only that build's actual folder. It refuses unknown folders, the launcher's own folder, a linked build folder, or a running game; shared saves and the original game dump are never touched. A row shows "Removing this build…" while the background work runs, and the result reports the files/bytes cleaned and where the saves were backed up. - 11 new UI strings in all 14 non-English catalogs (English drafts, to be translated in a later pass); docs updated in README, `docs/saves.md`. **Tests.** - 10 new unit tests in `previous`: listing newest-first with versions/sizes/dates, folder-scan fallback, de-duplication of registered versions, display rows, save-backup-then-remove, generated-file cleanup, a build reached through a Windows junction, and the refusal cases (unknown folder, the launcher's own folder). - `cargo fmt --all -- --check`; `cargo clippy --locked --all-targets -- -D warnings`; `cargo test --locked` → 192 passed on Windows with the same 14 pre-existing environment-only failures (junction/symlink, Steam and portable-folder tests), none in touched code; `python -I scripts/translations.py`; Tooling `tests/test_release.py` → 46 tests OK. The branch is merged up to `main` @ `ed29aca`. - Not run: the builder-contract half of `tests/test_launcher_core.py` (needs the pinned Longshot checkout `7015105c`) and `tests/test_rust_window.py` (needs a Linux display); CI covers both. - UI checked on Windows against a synthetic launcher home: a copied save set, a fake empty `.nup`, and a 75-byte mock old build, so no real game data or game build is involved. Screenshots are attached on the screenshot comment. The original game file, saves, and the previous launcher's own files were left byte-identical by the discovery path. **Screenshots.** Attached on the screenshot comment: Home card + Manage, the updated Versions layout (Build above the previous-launcher section; Remove then Open folder in the row), and the Remove confirmation.
feat(versions): show previous launcher builds and remove one in one action
Some checks failed
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Has been cancelled
CI / Rust formatting, lint and tests (pull_request) Has been cancelled
CI / Release packages and stable upgrades (pull_request) Has been cancelled
PR title / Conventional Commit title (pull_request) Has been cancelled
4306209c78
Author
Contributor

Screenshots from a synthetic launcher home (updated layout: Build a new version above the previous-launcher section; Remove before Open folder) (a copied save set, a fake empty .nup, and a 75-byte mock old build, so no real game data or game build is involved).

home.png

versions-layout.png

remove-dialog.png

Screenshots from a synthetic launcher home (updated layout: Build a new version above the previous-launcher section; Remove before Open folder) (a copied save set, a fake empty .nup, and a 75-byte mock old build, so no real game data or game build is involved). ![home.png](https://git.magicbean.dev/attachments/d072c1ef-5854-4f69-b0aa-0ba708d27ef6) ![versions-layout.png](https://git.magicbean.dev/attachments/1c11dcba-7c49-487d-967a-a47e7a68bf17) ![remove-dialog.png](https://git.magicbean.dev/attachments/18bb463c-1618-461e-b2ad-739f67fd8f75)
Member

Possibly related, for context:

  • PR #315 feat(migrate): reuse the previous launcher's game file automatically — Imports old launcher’s game-file path; called by the related build flow
  • PR #316 feat(migrate): carry the previous launcher's language and cache folder — Parallel upgrade migration; shares previous-launcher setup context
  • issue MagicBeanDev/Longshot#1068 Idea: Option to autodelete prior builds — Related prior-build deletion idea; this adds manual cleanup rather than auto-delete
  • PR #121 feat(home): offer to delete the old versions' folders updates left on the disk — Merged precedent for removing old build folders
Possibly related, for context: - PR #315 feat(migrate): reuse the previous launcher's game file automatically — Imports old launcher’s game-file path; called by the related build flow - PR #316 feat(migrate): carry the previous launcher's language and cache folder — Parallel upgrade migration; shares previous-launcher setup context - issue MagicBeanDev/Longshot#1068 Idea: Option to autodelete prior builds — Related prior-build deletion idea; this adds manual cleanup rather than auto-delete - PR #121 feat(home): offer to delete the old versions' folders updates left on the disk — Merged precedent for removing old build folders
Owner

image

The "Build a new version" should be at top of the list, alongside "Clean up all"

I thought we already had something like this which does cleanup btw? Can you verify

![image](/attachments/ec5ca4ed-17ba-48cb-9395-217c397c86d7) The "Build a new version" should be at top of the list, alongside "Clean up all" I thought we already had something like this which does cleanup btw? Can you verify
Author
Contributor

@HumanBean wrote in #317 (comment):

The "Build a new version" should be at top of the list, alongside "Clean up all"

I m not sure i understood what you mean by algonside clean up all but I'll push an update and let me know again if it wasn't what you intended

I thought we already had something like this which does cleanup btw? Can you verify

Yes, cleanup existed — but it only deletes recognized generated files (reclaim/previous_plan), never an old build's folder. #317 reuses that same cleanup and adds the missing part: list the old build, back up its saves, delete its folder.

@HumanBean wrote in https://git.magicbean.dev/MagicBeanDev/LongshotLauncher/pulls/317#issuecomment-86193: > The "Build a new version" should be at top of the list, alongside "Clean up all" I m not sure i understood what you mean by algonside clean up all but I'll push an update and let me know again if it wasn't what you intended > I thought we already had something like this which does cleanup btw? Can you verify Yes, cleanup existed — but it only deletes recognized generated files (reclaim/previous_plan), never an old build's folder. #317 reuses that same cleanup and adds the missing part: list the old build, back up its saves, delete its folder.
fix(versions): keep Build above the previous-launcher list and Open folder right of Remove
Some checks failed
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Has been cancelled
CI / Rust formatting, lint and tests (pull_request) Has been cancelled
CI / Release packages and stable upgrades (pull_request) Has been cancelled
PR title / Conventional Commit title (pull_request) Has been cancelled
f61f9f4b6c
# Conflicts:
#	assets/lang/de.json
#	assets/lang/es.json
#	assets/lang/fr.json
#	assets/lang/it.json
#	assets/lang/ja.json
#	assets/lang/ko.json
#	assets/lang/nl.json
#	assets/lang/pl.json
#	assets/lang/pt-BR.json
#	assets/lang/ru.json
#	assets/lang/zh-Hans.json
#	assets/lang/zh-Hant.json
#	ui/main.slint
fix(storage): follow the reclaim progress callback's two arguments
Some checks are pending
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Blocked by required conditions
CI / Rust formatting, lint and tests (pull_request) Blocked by required conditions
CI / Release packages and stable upgrades (pull_request) Blocked by required conditions
PR title / Conventional Commit title (pull_request) Blocked by required conditions
831072061e
Some checks are pending
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Blocked by required conditions
CI / Rust formatting, lint and tests (pull_request) Blocked by required conditions
CI / Release packages and stable upgrades (pull_request) Blocked by required conditions
PR title / Conventional Commit title (pull_request) Blocked by required conditions
This pull request has changes conflicting with the target branch.
  • assets/lang/de.json
  • assets/lang/es.json
  • assets/lang/fr.json
  • assets/lang/it.json
  • assets/lang/ja.json
  • assets/lang/ko.json
  • assets/lang/nl.json
  • assets/lang/pl.json
  • assets/lang/pt-BR.json
  • assets/lang/ru.json
  • assets/lang/zh-Hans.json
  • assets/lang/zh-Hant.json
  • src/game/actions.rs
  • src/game/jobs.rs
  • src/game/mod.rs
  • src/players/mod.rs
Some workflows are waiting to be reviewed.
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'feat/previous-launcher-builds:riqmarmes-feat/previous-launcher-builds'
git switch 'riqmarmes-feat/previous-launcher-builds'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
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!317
No description provided.