[PR #6723] [MERGED] Command confirmation: no returns to the book or dialog, it frees the pointer and takes the keyboard #7055

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6723
Author: @4404c
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: secure-chat/confirm-command-return


📝 Commits (3)

  • 3ec71e2 Command confirmation: no returns to the book or dialog, and it takes the keyboard
  • 1201038 Tests: the command confirmation keeps the pointer
  • 2b5e91b Merge main: the mod API's generated output is current there

📊 Changes

7 files changed (+130 additions, -22 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+12 -4)
📝 crates/horizon-client/src/game/books.rs (+13 -1)
📝 crates/horizon-client/src/game/control.rs (+3 -3)
📝 crates/horizon-client/src/game/dialogs.rs (+23 -0)
📝 crates/horizon-client/src/game/remote_chat.rs (+66 -11)
📝 tests/test_world_input_capture.py (+12 -2)
📝 tools/port_map/client-002.tsv (+1 -1)

📄 Description

🤖 Opened by 4404c's AI agent (Claude Code, Opus 5.5), not by 4404c personally.

What and why

Fixes #6704. Three gaps left by #6114 in the clicked-command confirmation:

  • The pointer. Opened from a book or a dialog that closes, the confirmation left the pointer captured, so its buttons couldn't be clicked. It now frees the pointer and capture won't grab while it is open; answering grabs again only if nothing else is open.
  • No returns to what the click left, as openSendConfirmationWindow's currentScreen: the book, or the dialog with what was typed in it (AfterAction::Close and WaitForResponse). A lectern doesn't come back, as LecternScreen.closeContainerOnServer closes its screen. The second button says Back there, and "Copy to Chat Screen" follows screenAfterCommand, so a dialog that stays open (AfterAction::None) copies to the clipboard instead. The confirmation is drawn in the dialog's place, not over it.
  • The keyboard. Tab, the arrows, Enter and Space work its buttons. horizon-ctl key goes the same way.

Still different, in the ledger: over the chat, the confirmation is drawn on top of it rather than replacing it.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

ClientPacketListener.openSendConfirmationWindow, openSignedCommandSendConfirmationWindow, DialogScreen.runAction, handleDialogClickEvent, BookViewScreen.handleClickEvent, LecternScreen.closeContainerOnServer, LocalPlayer.closeContainer, ConfirmScreen.keyPressed (read with tools/rea_vanilla.py).

Harness: tools/secure_chat_client_e2e.py against vanilla 26.3's server on Windows, passing online and offline.

Also driven through horizon-ctl in a scratch single player world: a /dialog show notice and a written book each open the confirmation with a /msg run_command. From the dialog, Tab and the right arrow move the focus (checked in screenshots), Enter on Back returns to it, and Tab then Enter on the first button leaves /msg @s from a dialog in the chat box. From the book, Escape returns to it. tests/test_world_input_capture.py gains the case that nothing grabs the pointer while it is open.

Not checked: a physical mouse and keyboard, the freed pointer in a real window (these runs have none), a lectern, a dialog's after_action other than close, and text typed in a dialog surviving the return.

Other projects' code

none

Self-check

Run on Windows, before the last commit (the test fixture's new field and case). After it, the Python tests were run again: that fixture now compiles, and the rest is below.

pr_ready (tools/pr_ready.py --quick --base upstream/main on naza, against upstream/main at 0454e97e3, 7 min 10 s)

Check Result
Scope ✅ 6 files, +118 −20
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 598 run, FAILED (errors=1, skipped=2) (4 min 38 s)
rustfmt ✅ (26 s)
clippy ✅ (8 s)
tests: horizon-client ❌ 588 passed, 2 failed (1 min 46 s)
doc tests ✅ 0 passed (5 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 ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The failures left, all on this Windows checkout:

  • test_capture_lifecycle: the fixture's pointer warp count (left: 1, right: 2) on Windows. The test errors the same way on unchanged main (0454e97e3).
  • native_breathing_stays_hookable and native_loot_kinds_stay_hookable: an unwrap on a search. The first looks for "\n}\n" in a checkout with CRLF line endings; the second panics on the same kind of line and I didn't read it further. This branch doesn't touch those files.

I expect these to pass on CI's Linux, which is what verify here will show.

🤖 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/6723 **Author:** [@4404c](https://github.com/4404c) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `secure-chat/confirm-command-return` --- ### 📝 Commits (3) - [`3ec71e2`](https://github.com/horizon-rust/horizon/commit/3ec71e20eeaf93118cb3e92fb60d953c04f00ca6) Command confirmation: no returns to the book or dialog, and it takes the keyboard - [`1201038`](https://github.com/horizon-rust/horizon/commit/1201038941e39984f6fb88b6e6e349d1a7d82074) Tests: the command confirmation keeps the pointer - [`2b5e91b`](https://github.com/horizon-rust/horizon/commit/2b5e91b3481abd4349c9e8d8f7c8f45db9d7ec5b) Merge main: the mod API's generated output is current there ### 📊 Changes **7 files changed** (+130 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+12 -4) 📝 `crates/horizon-client/src/game/books.rs` (+13 -1) 📝 `crates/horizon-client/src/game/control.rs` (+3 -3) 📝 `crates/horizon-client/src/game/dialogs.rs` (+23 -0) 📝 `crates/horizon-client/src/game/remote_chat.rs` (+66 -11) 📝 `tests/test_world_input_capture.py` (+12 -2) 📝 `tools/port_map/client-002.tsv` (+1 -1) </details> ### 📄 Description > 🤖 Opened by 4404c's AI agent (Claude Code, Opus 5.5), not by 4404c personally. ## What and why Fixes #6704. Three gaps left by #6114 in the clicked-command confirmation: - **The pointer.** Opened from a book or a dialog that closes, the confirmation left the pointer captured, so its buttons couldn't be clicked. It now frees the pointer and `capture` won't grab while it is open; answering grabs again only if nothing else is open. - **No returns to what the click left**, as `openSendConfirmationWindow`'s `currentScreen`: the book, or the dialog with what was typed in it (`AfterAction::Close` and `WaitForResponse`). A lectern doesn't come back, as `LecternScreen.closeContainerOnServer` closes its screen. The second button says Back there, and "Copy to Chat Screen" follows `screenAfterCommand`, so a dialog that stays open (`AfterAction::None`) copies to the clipboard instead. The confirmation is drawn in the dialog's place, not over it. - **The keyboard.** Tab, the arrows, Enter and Space work its buttons. `horizon-ctl key` goes the same way. Still different, in the ledger: over the chat, the confirmation is drawn on top of it rather than replacing it. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference `ClientPacketListener.openSendConfirmationWindow`, `openSignedCommandSendConfirmationWindow`, `DialogScreen.runAction`, `handleDialogClickEvent`, `BookViewScreen.handleClickEvent`, `LecternScreen.closeContainerOnServer`, `LocalPlayer.closeContainer`, `ConfirmScreen.keyPressed` (read with `tools/rea_vanilla.py`). Harness: `tools/secure_chat_client_e2e.py` against vanilla 26.3's server on Windows, passing online and offline. Also driven through `horizon-ctl` in a scratch single player world: a `/dialog show` notice and a written book each open the confirmation with a `/msg` run_command. From the dialog, Tab and the right arrow move the focus (checked in screenshots), Enter on Back returns to it, and Tab then Enter on the first button leaves `/msg @s from a dialog` in the chat box. From the book, Escape returns to it. `tests/test_world_input_capture.py` gains the case that nothing grabs the pointer while it is open. Not checked: a physical mouse and keyboard, the freed pointer in a real window (these runs have none), a lectern, a dialog's `after_action` other than close, and text typed in a dialog surviving the return. ## Other projects' code none ## Self-check Run on Windows, before the last commit (the test fixture's new field and case). After it, the Python tests were run again: that fixture now compiles, and the rest is below. **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on naza, against upstream/main at 0454e97e3, 7 min 10 s) | Check | Result | | --- | --- | | Scope | ✅ 6 files, +118 −20 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 598 run, FAILED (errors=1, skipped=2) (4 min 38 s) | | rustfmt | ✅ (26 s) | | clippy | ✅ (8 s) | | tests: horizon-client | ❌ 588 passed, 2 failed (1 min 46 s) | | doc tests | ✅ 0 passed (5 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 | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The failures left, all on this Windows checkout: - `test_capture_lifecycle`: the fixture's pointer warp count (`left: 1, right: 2`) on Windows. The test errors the same way on unchanged main (0454e97e3). - `native_breathing_stays_hookable` and `native_loot_kinds_stay_hookable`: an unwrap on a search. The first looks for `"\n}\n"` in a checkout with CRLF line endings; the second panics on the same kind of line and I didn't read it further. This branch doesn't touch those files. I expect these to pass on CI's Linux, which is what `verify` here will show. 🤖 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 06:32:57 +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#7055
No description provided.