[PR #2886] [MERGED] launcher: offline names forget and show as they should #4670

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2886
Author: @socksprox
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @ludovic111

Base: main ← Head: fix/launcher-forget-offline-name


📝 Commits (4)

  • a7e3bcf launcher: a forgotten offline name is gone for good
  • 8cfc13f launcher: the account list follows changes made outside the window
  • 9b6faeb launcher: the game's made-up name can be rolled for a new one
  • 5096b41 Merge main into #2886: offline names need an owner since main

📊 Changes

12 files changed (+184 additions, -20 deletions)

View changed files

📝 docs/launcher-commands.md (+1 -1)
📝 launcher/README.md (+3 -2)
📝 launcher/src/account.rs (+4 -2)
📝 launcher/src/account/tests.rs (+19 -2)
📝 launcher/src/cli.rs (+2 -2)
📝 launcher/src/instances.rs (+28 -0)
📝 launcher/src/instances/tests.rs (+27 -0)
📝 launcher/src/main.rs (+21 -10)
📝 launcher/src/skin_page.rs (+16 -0)
📝 launcher/src/skins.rs (+7 -0)
📝 launcher/src/skins/tests.rs (+20 -0)
📝 launcher/src/switch_page.rs (+36 -1)

📄 Description

🤖 Opened by socksprox's AI agent (Devin), not by socksprox himself.

What and why

Offline names in the launcher couldn't be properly removed — and depending on where they came from, not even seen:

  • Accounts::remove_offline cleared the name and its look in accounts.json but left skins/<name>.png and skins/<name>.cape.png on disk. It now takes the skins dir and skins::forget deletes both files, from the Settings "Forget" button and account forget-offline alike.
  • The skin panel's file pick runs async: a name forgotten while the dialog was open still got skins/<name>.png written and a looks entry re-added (which would silently restore the skin if the name was ever re-added). take_look_file and save_look now bail when the name is no longer kept.
  • Settings' account rows (Play as / Play offline / Sign out) mutated and saved the window's in-memory account list, so a name forgotten through the CLI or another window since the list was loaded could be written back. They now load–mutate–save like the rest of the account code.
  • The window read accounts.json once at start-up: a name added through the CLI or another window had no row (and no Forget button) in Settings and didn't show in the quick switch until relaunch. Page switches and opening the account chip's menu read it again, as the game's made-up name already was.
  • The game's own name (horizon-player.txt, the "Offline, the game's name" entry) isn't a kept offline name, so Forget never applied and there was no way to be rid of it. Settings > Account now shows it with "New name", which writes a fresh PlayerNNNNN into every existing game home — the default and each instance's — so the player stays the same (new) player in its worlds, as PLAYER_FILES' copies do.

Vanilla reference

None — launcher tooling. The name: file format and Player + five digits scheme mirror horizon-client's offline_name.rs.

Self-check

pr_ready (tools/pr_ready.py --quick on MacBookPro, against origin/main at 42cbbb565, 1 min 21 s)

Check Result
Public tree ✅
Python tests ✅ 364 passed
launcher rustfmt ✅
launcher clippy ✅
launcher tests ✅ 199 passed

Also verified live: account skin + account forget-offline now leaves no files under skins/; new unit tests cover skins::forget, remove_offline dropping the look and files, and new_player_name replacing the kept name in every game home.

🤖 Generated with Devin


🔄 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/2886 **Author:** [@socksprox](https://github.com/socksprox) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/launcher-forget-offline-name` --- ### 📝 Commits (4) - [`a7e3bcf`](https://github.com/horizon-rust/horizon/commit/a7e3bcf79ff28b2289f8b4d45c4031f8d9cc81b7) launcher: a forgotten offline name is gone for good - [`8cfc13f`](https://github.com/horizon-rust/horizon/commit/8cfc13fe2c7cba822b2aa5b6bcb4e63cf7b2b86b) launcher: the account list follows changes made outside the window - [`9b6faeb`](https://github.com/horizon-rust/horizon/commit/9b6faeb8cfd514b829cd43511b5e6c49808a96bb) launcher: the game's made-up name can be rolled for a new one - [`5096b41`](https://github.com/horizon-rust/horizon/commit/5096b41100274869a587a0d5a603ff37d64546f1) Merge main into #2886: offline names need an owner since main ### 📊 Changes **12 files changed** (+184 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `docs/launcher-commands.md` (+1 -1) 📝 `launcher/README.md` (+3 -2) 📝 `launcher/src/account.rs` (+4 -2) 📝 `launcher/src/account/tests.rs` (+19 -2) 📝 `launcher/src/cli.rs` (+2 -2) 📝 `launcher/src/instances.rs` (+28 -0) 📝 `launcher/src/instances/tests.rs` (+27 -0) 📝 `launcher/src/main.rs` (+21 -10) 📝 `launcher/src/skin_page.rs` (+16 -0) 📝 `launcher/src/skins.rs` (+7 -0) 📝 `launcher/src/skins/tests.rs` (+20 -0) 📝 `launcher/src/switch_page.rs` (+36 -1) </details> ### 📄 Description > 🤖 Opened by socksprox's AI agent (Devin), not by socksprox himself. ## What and why Offline names in the launcher couldn't be properly removed — and depending on where they came from, not even seen: - `Accounts::remove_offline` cleared the name and its look in `accounts.json` but left `skins/<name>.png` and `skins/<name>.cape.png` on disk. It now takes the skins dir and `skins::forget` deletes both files, from the Settings "Forget" button and `account forget-offline` alike. - The skin panel's file pick runs async: a name forgotten while the dialog was open still got `skins/<name>.png` written and a `looks` entry re-added (which would silently restore the skin if the name was ever re-added). `take_look_file` and `save_look` now bail when the name is no longer kept. - Settings' account rows (Play as / Play offline / Sign out) mutated and saved the window's in-memory account list, so a name forgotten through the CLI or another window since the list was loaded could be written back. They now load–mutate–save like the rest of the account code. - The window read `accounts.json` once at start-up: a name added through the CLI or another window had no row (and no Forget button) in Settings and didn't show in the quick switch until relaunch. Page switches and opening the account chip's menu read it again, as the game's made-up name already was. - The game's own name (`horizon-player.txt`, the "Offline, the game's name" entry) isn't a kept offline name, so Forget never applied and there was no way to be rid of it. Settings > Account now shows it with "New name", which writes a fresh `PlayerNNNNN` into every existing game home — the default and each instance's — so the player stays the same (new) player in its worlds, as `PLAYER_FILES`' copies do. ## Vanilla reference None — launcher tooling. The `name:` file format and `Player` + five digits scheme mirror horizon-client's `offline_name.rs`. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on MacBookPro, against origin/main at 42cbbb565, 1 min 21 s) | Check | Result | | --- | --- | | Public tree | ✅ | | Python tests | ✅ 364 passed | | launcher rustfmt | ✅ | | launcher clippy | ✅ | | launcher tests | ✅ 199 passed | Also verified live: `account skin` + `account forget-offline` now leaves no files under `skins/`; new unit tests cover `skins::forget`, `remove_offline` dropping the look and files, and `new_player_name` replacing the kept name in every game home. 🤖 Generated with [Devin](https://devin.ai) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:07:05 +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#4670
No description provided.