[PR #2771] [MERGED] Select World: deleting the last world opens Create New World, as vanilla does #4597

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

📋 Pull Request Information

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

Base: main ← Head: claude/select-world-blank-deletion-332d14


📝 Commits (1)

  • f105583 Select World: deleting the last world opens Create New World

📊 Changes

2 files changed (+37 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/title.rs (+9 -1)
📝 crates/horizon-client/src/title/tests.rs (+28 -3)

📄 Description

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

What and why

Deleting the only world on Select World left a blank list with nothing in it. In vanilla, every time the singleplayer list reloads and comes back empty, it opens a fresh Create New World. Cancel there goes to the title screen, the same as opening Singleplayer with no saves.

Title::return_to_list (which deletion, Edit/Backup cancel and horizon-ctl's world-delete all reload through) now does the same. If no worlds are left, it opens a fresh Create New World screen and sets Cancel to return to the main menu. A search that filters the list down to nothing still shows the list: vanilla checks the unfiltered levels.

Vanilla reference

  • WorldSelectionList.handleNewLevels: levels.isEmpty() with EntryType.SINGLEPLAYER → CreateWorldScreen.openFresh(minecraft, () -> minecraft.gui.setScreen(null))
  • WorldSelectionList.WorldListEntry.deleteWorld / doDeleteWorld → returnToScreen → reloadWorldList

There's no harness: this is title-menu flow, covered by unit tests in title/tests.rs.

  • delete_requires_confirmation_and_both_cancel_paths_preserve_world and world_management_buttons_sound_when_enabled asserted the empty list. They now expect Create New World, and Cancel → title.
  • New: deleting_one_of_two_worlds_keeps_the_list, a_list_emptied_elsewhere_opens_create_world.

Checked in the running game (scratch HORIZON_HOME, horizon-ctl): I created one world, opened Singleplayer, selected it, and pressed Delete → Delete. The screen became create-world with the name "New World" and saves/ was empty. Cancel → main.

Self-check

The table counts 3 files and +55: the third was an untracked ctl.log my horizon-ctl run left in the worktree. It is deleted and not in the branch, which changes 2 files, +37 −4.

pr_ready (tools/pr_ready.py --quick --base upstream/main on cachyos, against upstream/main at 97437beaf, 4 min 30 s)

Check Result
Scope ✅ 3 files, +55 −4
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 331 passed (17 s)
rustfmt ✅ (4 s)
clippy ✅ (1 min 19 s)
tests: horizon-client ✅ 1331 passed (2 min 8 s)
doc tests ✅ 0 passed (24 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 36 affected, to run in CI (--quick): block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, entity_model, forced_end, friends_integration, hardcore_respawn, lan_integration and 24 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

I used --quick: several of the 36 harnesses open game windows or need vscreen, which this machine doesn't have. The change only touches the title menu.

Screenshots

After pressing Delete on the only world: the Create New World screen (Game tab, "New World"), with Create New World and Cancel at the bottom. Before this change it was an empty Select World list.

🤖 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/2771 **Author:** [@ASOwnerYT](https://github.com/ASOwnerYT) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `claude/select-world-blank-deletion-332d14` --- ### 📝 Commits (1) - [`f105583`](https://github.com/horizon-rust/horizon/commit/f10558380355eca58158d94869f6c5ff28a34f84) Select World: deleting the last world opens Create New World ### 📊 Changes **2 files changed** (+37 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/title.rs` (+9 -1) 📝 `crates/horizon-client/src/title/tests.rs` (+28 -3) </details> ### 📄 Description > 🤖 Opened by asowneryt's AI agent (Claude Code), not by asowneryt himself. ## What and why Deleting the only world on Select World left a blank list with nothing in it. In vanilla, every time the singleplayer list reloads and comes back empty, it opens a fresh Create New World. Cancel there goes to the title screen, the same as opening Singleplayer with no saves. `Title::return_to_list` (which deletion, Edit/Backup cancel and horizon-ctl's `world-delete` all reload through) now does the same. If no worlds are left, it opens a fresh Create New World screen and sets Cancel to return to the main menu. A search that filters the list down to nothing still shows the list: vanilla checks the unfiltered levels. ## Vanilla reference - `WorldSelectionList.handleNewLevels`: `levels.isEmpty()` with `EntryType.SINGLEPLAYER` → `CreateWorldScreen.openFresh(minecraft, () -> minecraft.gui.setScreen(null))` - `WorldSelectionList.WorldListEntry.deleteWorld` / `doDeleteWorld` → `returnToScreen` → `reloadWorldList` There's no harness: this is title-menu flow, covered by unit tests in `title/tests.rs`. - `delete_requires_confirmation_and_both_cancel_paths_preserve_world` and `world_management_buttons_sound_when_enabled` asserted the empty list. They now expect Create New World, and Cancel → title. - New: `deleting_one_of_two_worlds_keeps_the_list`, `a_list_emptied_elsewhere_opens_create_world`. Checked in the running game (scratch `HORIZON_HOME`, horizon-ctl): I created one world, opened Singleplayer, selected it, and pressed Delete → Delete. The screen became `create-world` with the name "New World" and `saves/` was empty. Cancel → `main`. ## Self-check The table counts 3 files and +55: the third was an untracked `ctl.log` my horizon-ctl run left in the worktree. It is deleted and not in the branch, which changes 2 files, +37 −4. **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on cachyos, against upstream/main at 97437beaf, 4 min 30 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +55 −4 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 331 passed (17 s) | | rustfmt | ✅ (4 s) | | clippy | ✅ (1 min 19 s) | | tests: horizon-client | ✅ 1331 passed (2 min 8 s) | | doc tests | ✅ 0 passed (24 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 36 affected, to run in CI (--quick): block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, entity_model, forced_end, friends_integration, hardcore_respawn, lan_integration and 24 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | I used `--quick`: several of the 36 harnesses open game windows or need `vscreen`, which this machine doesn't have. The change only touches the title menu. ## Screenshots After pressing Delete on the only world: the Create New World screen (Game tab, "New World"), with Create New World and Cancel at the bottom. Before this change it was an empty Select World list. 🤖 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 04:18:24 +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#4597
No description provided.