[PR #423] [MERGED] Server list: confirm before deleting, vanilla Direct Connection layout #2554

Closed
opened 2026-11-02 15:57:09 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/server-list-dialogs


📝 Commits (2)

  • fc97b78 Server list: confirm before deleting, vanilla Direct Connection layout
  • c72a564 Merge remote-tracking branch 'origin/main' into fix/server-list-dialogs

📊 Changes

3 files changed (+259 additions, -31 deletions)

View changed files

📝 crates/horizon-client/src/front.rs (+36 -0)
📝 crates/horizon-client/src/multiplayer.rs (+222 -30)
📝 crates/horizon-client/src/title.rs (+1 -1)

📄 Description

Fixes #380
Fixes #381

Merge order: after #421. Both touch multiplayer.rs. The overlap is only the use crate::text line and the end of the test module (resolved on the combined test branch), so a rebase after #421 lands is mechanical.

What vanilla does

  • Delete (#380). JoinMultiplayerScreen's Delete button opens new ConfirmScreen(this::deleteCallback, "selectServer.deleteQuestion", "selectServer.deleteWarning"(name), "selectServer.deleteButton", GUI_CANCEL). Only deleteCallback(true) removes the server, saves the list and clears the selection. Either answer returns to the list as it was. ConfirmScreen itself:
    • a vertical LinearLayout with spacing 8 holding the title, then the message (MultiLineTextWidget, max width width - 50), then the two 150-wide buttons 4 apart with 16 padding above;
    • the whole block is centred (FrameLayout.centerInRectangle);
    • Escape answers no.
  • Direct Connection (#381). DirectJoinServerScreen.init puts the EditBox at (width/2 - 100, 116). extractRenderState draws the title at 20 and ENTER_IP_LABEL at (width/2 - 100 + 1, 100) in 0xA0A0A0. Horizon had the label at 89 and the box at 100. ManageServerScreen (Add/Edit Server) uses boxes at 66 and 106 under labels at 53 and 94. Horizon had them at 64 and 105, so they share the fixed helper.

Changes (multiplayer.rs)

  • New Screen::ConfirmDelete holding the list it came from, so the pings, scroll and selection survive. It uses buttons 58/59 and is drawn with title::confirm_top, the same formula as the world-delete ConfirmScreen, now pub(crate).
  • field() takes the label and box positions, and centres on the integer half width.
  • Direct Connection strings come from the language file.
  • front.rs: Horizon's own UI gets a matching "Remove this server?" page (Delete server / Cancel) instead of deleting at once.
  • Not included: vanilla prefills Direct Connection with options.lastMpIp (options.txt lastServer). Horizon still starts it empty. This is a behaviour gap rather than formatting, so I left it for a follow-up.

How it was verified

  • Unit test delete_asks_before_removing_the_server:
    • Delete opens the confirm screen with the server's name and leaves servers.dat untouched;
    • the buttons sit at (61, 135) and (215, 135) in a 427×240 GUI;
    • Cancel and Escape return to the list with the selection kept;
    • Delete removes the server, saves and clears the selection.
  • In game, offscreen:
    • Direct Connection screenshot: label and box now at vanilla's height (compared with the 26.3 half of the issue's screenshot);
    • the delete confirm screenshot matches the vanilla dialog in #380 (title, warning, two buttons), and horizon-ctl screen lists Delete/Cancel at y 135.

Self-check (combined branch of the batch's seven PRs, #406 #407 #409 #414 #416 #421 #423, on origin/main d28521f7; Mac mini):

  • cargo fmt --all --check: ok
  • cargo clippy --workspace --all-targets -- -D warnings: ok
  • cargo test -p horizon-client: 775 passed, 0 failed
  • tools/parity.py --changed origin/main (82 harnesses, including the new world_reopen): 82 pass.
    • The first pass found two #407 regressions, both fixed in #407 and rerun green: command_parse (suggestions were pruned in brigadier itself rather than only in the player's chat) and dedicated_server (dedicated-server guests lost their ops-based commands).
    • 34 harnesses passed on the combined commit before those two #407 fixes. The other 48 plus the two reruns passed after them.
  • Not run: the Linux and Windows checks (this batch was developed and checked on the Mac mini only).

🤖 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/423 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/16/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/server-list-dialogs` --- ### 📝 Commits (2) - [`fc97b78`](https://github.com/horizon-rust/horizon/commit/fc97b7893186a238bee61bf4b6082bb89c5156c9) Server list: confirm before deleting, vanilla Direct Connection layout - [`c72a564`](https://github.com/horizon-rust/horizon/commit/c72a5643a4376bdd9381bdfcc331b22a3c6db875) Merge remote-tracking branch 'origin/main' into fix/server-list-dialogs ### 📊 Changes **3 files changed** (+259 additions, -31 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/front.rs` (+36 -0) 📝 `crates/horizon-client/src/multiplayer.rs` (+222 -30) 📝 `crates/horizon-client/src/title.rs` (+1 -1) </details> ### 📄 Description Fixes #380 Fixes #381 **Merge order:** after #421. Both touch `multiplayer.rs`. The overlap is only the `use crate::text` line and the end of the test module (resolved on the combined test branch), so a rebase after #421 lands is mechanical. **What vanilla does** - **Delete (#380).** `JoinMultiplayerScreen`'s Delete button opens `new ConfirmScreen(this::deleteCallback, "selectServer.deleteQuestion", "selectServer.deleteWarning"(name), "selectServer.deleteButton", GUI_CANCEL)`. Only `deleteCallback(true)` removes the server, saves the list and clears the selection. Either answer returns to the list as it was. `ConfirmScreen` itself: - a vertical `LinearLayout` with spacing 8 holding the title, then the message (`MultiLineTextWidget`, max width `width - 50`), then the two 150-wide buttons 4 apart with 16 padding above; - the whole block is centred (`FrameLayout.centerInRectangle`); - Escape answers no. - **Direct Connection (#381).** `DirectJoinServerScreen.init` puts the `EditBox` at `(width/2 - 100, 116)`. `extractRenderState` draws the title at 20 and `ENTER_IP_LABEL` at `(width/2 - 100 + 1, 100)` in 0xA0A0A0. Horizon had the label at 89 and the box at 100. `ManageServerScreen` (Add/Edit Server) uses boxes at 66 and 106 under labels at 53 and 94. Horizon had them at 64 and 105, so they share the fixed helper. **Changes** (`multiplayer.rs`) - New `Screen::ConfirmDelete` holding the list it came from, so the pings, scroll and selection survive. It uses buttons 58/59 and is drawn with `title::confirm_top`, the same formula as the world-delete ConfirmScreen, now `pub(crate)`. - `field()` takes the label and box positions, and centres on the integer half width. - Direct Connection strings come from the language file. - `front.rs`: Horizon's own UI gets a matching "Remove this server?" page (Delete server / Cancel) instead of deleting at once. - Not included: vanilla prefills Direct Connection with `options.lastMpIp` (options.txt `lastServer`). Horizon still starts it empty. This is a behaviour gap rather than formatting, so I left it for a follow-up. **How it was verified** - Unit test `delete_asks_before_removing_the_server`: - Delete opens the confirm screen with the server's name and leaves servers.dat untouched; - the buttons sit at (61, 135) and (215, 135) in a 427×240 GUI; - Cancel and Escape return to the list with the selection kept; - Delete removes the server, saves and clears the selection. - In game, offscreen: - Direct Connection screenshot: label and box now at vanilla's height (compared with the 26.3 half of the issue's screenshot); - the delete confirm screenshot matches the vanilla dialog in #380 (title, warning, two buttons), and `horizon-ctl screen` lists Delete/Cancel at y 135. **Self-check** (combined branch of the batch's seven PRs, #406 #407 #409 #414 #416 #421 #423, on origin/main d28521f7; Mac mini): - `cargo fmt --all --check`: ok - `cargo clippy --workspace --all-targets -- -D warnings`: ok - `cargo test -p horizon-client`: 775 passed, 0 failed - `tools/parity.py --changed origin/main` (82 harnesses, including the new `world_reopen`): 82 pass. - The first pass found two #407 regressions, both fixed in #407 and rerun green: `command_parse` (suggestions were pruned in brigadier itself rather than only in the player's chat) and `dedicated_server` (dedicated-server guests lost their ops-based commands). - 34 harnesses passed on the combined commit before those two #407 fixes. The other 48 plus the two reruns passed after them. - Not run: the Linux and Windows checks (this batch was developed and checked on the Mac mini only). 🤖 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-02 15:57:09 +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#2554
No description provided.