[PR #3506] [MERGED] Launcher: delete an instance, and forget ones whose folder is gone #5030

Closed
opened 2026-11-03 05:09:44 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3506
Author: @ludovic111
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: fix/launcher-delete-instance


📝 Commits (1)

  • cbacada Launcher: delete an instance, and forget ones whose folder is gone

📊 Changes

7 files changed (+209 additions, -4 deletions)

View changed files

📝 docs/launcher-commands.md (+10 -0)
📝 launcher/lang/fr.json (+5 -1)
📝 launcher/lang/ru.json (+5 -1)
📝 launcher/src/cli.rs (+10 -0)
📝 launcher/src/instances.rs (+52 -1)
📝 launcher/src/instances/tests.rs (+39 -0)
📝 launcher/src/instances_page.rs (+88 -1)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Fixes a player report from #horizon-bugs (keegie): an instance stays in the list and can't be removed, with no Delete button and no folder for it under instances/.

What was missing. The launcher could make instances but never delete them.

  • Delete… on the Play page's instance row, for every instance but Horizon's own (the game's home). After a confirmation ("Move {name} to the Trash, with its worlds and settings? You can get it back from there." · Keep · Move to Trash), the instance's folder goes to the Trash through desktop_seams::to_trash (HORIZON_LAUNCHER_TRASH in test runs). That folder is instances/<slug>/ for an own instance, and the work folder for an imported (ports/) or registry (horizon-packs/) pack. Its choices in instances.json are dropped, and Play goes back to Horizon if it was the selected one. Refused while a game runs or starts; an error shows in the confirmation line.
  • horizon-launcher instance delete <instance> does the same (docs/launcher-commands.md regenerated).
  • Entries whose folder is gone (removed by hand): an own instance's choices are dropped from instances.json the next time the list is read, so a new instance of that name starts clean. Only when instances/ itself can be read, so a missing drive never wipes them. Ports and packs keep theirs.

About the report. In today's code the list holds only instances whose folder exists: own instances are read from instances/<slug>/, ports from ports/, registry packs from horizon-packs/. So keegie's instance most likely still had a folder: under ports/ or horizon-packs/, or under instances/ with a slug unlike its display name. Delete covers all three. One more gap, left for the redesign: with no Horizon version installed, the Play page shows no instance row, so no instance action (Edit, Copy, Delete) is reachable. R-phase moves them onto the sidebar entry.

Test: deleted_instances_go_to_the_trash_and_are_forgotten (own instance and its worlds in the trash, choices dropped; the game's home refused; a port deleted; a hand-removed folder's choices dropped and a new instance of that name clean). Checked in a scratch home with the CLI (delete, the Horizon refusal, selection back to Horizon, pruning) and a screenshot of the row with Delete…; the confirmation's clicks were not driven in a real window.

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 0e57b1f6c, 1 min 38 s)

Check Result
Scope ✅ 7 files, +209 −4
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 408 passed
launcher rustfmt ✅
launcher clippy ✅
launcher tests ✅ 247 passed
Parity ➖ lan_integration listed for CI (the launcher is not in the LAN suite)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3506 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/launcher-delete-instance` --- ### 📝 Commits (1) - [`cbacada`](https://github.com/horizon-rust/horizon/commit/cbacadae221daf944b6c220273f43b3f5d59d845) Launcher: delete an instance, and forget ones whose folder is gone ### 📊 Changes **7 files changed** (+209 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `docs/launcher-commands.md` (+10 -0) 📝 `launcher/lang/fr.json` (+5 -1) 📝 `launcher/lang/ru.json` (+5 -1) 📝 `launcher/src/cli.rs` (+10 -0) 📝 `launcher/src/instances.rs` (+52 -1) 📝 `launcher/src/instances/tests.rs` (+39 -0) 📝 `launcher/src/instances_page.rs` (+88 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes a player report from #horizon-bugs (keegie): an instance stays in the list and can't be removed, with no Delete button and no folder for it under `instances/`. **What was missing.** The launcher could make instances but never delete them. - **Delete…** on the Play page's instance row, for every instance but Horizon's own (the game's home). After a confirmation ("Move {name} to the Trash, with its worlds and settings? You can get it back from there." · Keep · Move to Trash), the instance's folder goes to the Trash through `desktop_seams::to_trash` (`HORIZON_LAUNCHER_TRASH` in test runs). That folder is `instances/<slug>/` for an own instance, and the work folder for an imported (`ports/`) or registry (`horizon-packs/`) pack. Its choices in `instances.json` are dropped, and Play goes back to Horizon if it was the selected one. Refused while a game runs or starts; an error shows in the confirmation line. - **`horizon-launcher instance delete <instance>`** does the same (docs/launcher-commands.md regenerated). - **Entries whose folder is gone** (removed by hand): an own instance's choices are dropped from `instances.json` the next time the list is read, so a new instance of that name starts clean. Only when `instances/` itself can be read, so a missing drive never wipes them. Ports and packs keep theirs. **About the report.** In today's code the list holds only instances whose folder exists: own instances are read from `instances/<slug>/`, ports from `ports/`, registry packs from `horizon-packs/`. So keegie's instance most likely still had a folder: under `ports/` or `horizon-packs/`, or under `instances/` with a slug unlike its display name. Delete covers all three. One more gap, left for the redesign: with no Horizon version installed, the Play page shows no instance row, so no instance action (Edit, Copy, Delete) is reachable. R-phase moves them onto the sidebar entry. Test: `deleted_instances_go_to_the_trash_and_are_forgotten` (own instance and its worlds in the trash, choices dropped; the game's home refused; a port deleted; a hand-removed folder's choices dropped and a new instance of that name clean). Checked in a scratch home with the CLI (delete, the Horizon refusal, selection back to Horizon, pruning) and a screenshot of the row with Delete…; the confirmation's clicks were not driven in a real window. **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 0e57b1f6c, 1 min 38 s) | Check | Result | | --- | --- | | Scope | ✅ 7 files, +209 −4 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 408 passed | | launcher rustfmt | ✅ | | launcher clippy | ✅ | | launcher tests | ✅ 247 passed | | Parity | ➖ lan_integration listed for CI (the launcher is not in the LAN suite) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:09:44 +07:00
Sign in to join this conversation.
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
horizon-rust/horizon#5030
No description provided.