[PR #1123] [MERGED] Book title: Select All's highlight and vanilla's centring (BookSignScreen EditBox) #3069

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

📋 Pull Request Information

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

Base: main ← Head: fix/book-title-edit-box


📝 Commits (1)

  • cb20d70 Book title: draw Select All's highlight, as BookSignScreen's EditBox

📊 Changes

5 files changed (+47 additions, -20 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+1 -1)
📝 crates/horizon-client/src/game/books.rs (+15 -10)
📝 crates/horizon-client/src/game/control.rs (+22 -0)
📝 crates/horizon-client/src/game/stations.rs (+1 -1)
📝 crates/horizon-client/src/ui.rs (+8 -8)

📄 Description

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

What

The book's title box (signing a Book and Quill) is drawn as vanilla's BookSignScreen EditBox: unbordered, centred, black, no text shadow, with Select All's highlight (inverted, then blue) and the blinking cursor after the value.

Why

Left over from #275 (Online5277's list; #394 did the creative search and the anvil): Ctrl/Cmd+A already selected the title (typing replaced it) but nothing showed it. The title was also centred together with its cursor, so it sat 3 px left of vanilla's and jumped as the underscore blinked; vanilla centres the value alone (EditBox.updateTextPosition with setCentered(true)).

How

  • ui::append_field takes the text shadow with the colour ((color, shadow), setTextShadow); the anvil and creative search keep their shadow.
  • game/books.rs draws the title through it at vanilla's box (x = (width - 114) / 2 - 3, y = 50, 114 wide).
  • horizon-ctl: key super|cmd|meta (the edit modifier on macOS) and key f6; with the edit modifier held, key a|c|v|x act on the open book (Select All, Copy, Paste, Cut), so the screenshot below is scripted.

Screenshots (Mac mini, --offscreen, 1280x720)

Typed After Cmd+A

Before this PR the Cmd+A frame looked like the typed one: no highlight.

Part of #275

Self-check (Mac mini, one integration commit of the five Q1 PRs on origin/main 2d586fac)

  • cargo fmt --all --check: clean
  • set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings: clean (no warnings, no errors)
  • cargo test -p horizon-client: lib 962 passed (14 ignored), main 84 passed, horizon-ctl 15 passed, integration tests 7 passed
  • tools/parity.py --changed origin/main: all 101 affected harnesses pass (secure_chat failed once in the batch run, which reused cached oracle results, then passed when rerun alone)

Needs Ludovic

Nothing.

🤖 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/1123 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/book-title-edit-box` --- ### 📝 Commits (1) - [`cb20d70`](https://github.com/horizon-rust/horizon/commit/cb20d7056c9ab2516184ec743cadea3323d17d38) Book title: draw Select All's highlight, as BookSignScreen's EditBox ### 📊 Changes **5 files changed** (+47 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+1 -1) 📝 `crates/horizon-client/src/game/books.rs` (+15 -10) 📝 `crates/horizon-client/src/game/control.rs` (+22 -0) 📝 `crates/horizon-client/src/game/stations.rs` (+1 -1) 📝 `crates/horizon-client/src/ui.rs` (+8 -8) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What The book's title box (signing a Book and Quill) is drawn as vanilla's `BookSignScreen` EditBox: unbordered, centred, black, no text shadow, with Select All's highlight (inverted, then blue) and the blinking cursor after the value. ## Why Left over from #275 (Online5277's list; #394 did the creative search and the anvil): Ctrl/Cmd+A already selected the title (typing replaced it) but nothing showed it. The title was also centred together with its cursor, so it sat 3 px left of vanilla's and jumped as the underscore blinked; vanilla centres the value alone (`EditBox.updateTextPosition` with `setCentered(true)`). ## How - `ui::append_field` takes the text shadow with the colour (`(color, shadow)`, `setTextShadow`); the anvil and creative search keep their shadow. - game/books.rs draws the title through it at vanilla's box (x = (width - 114) / 2 - 3, y = 50, 114 wide). - horizon-ctl: `key super|cmd|meta` (the edit modifier on macOS) and `key f6`; with the edit modifier held, `key a|c|v|x` act on the open book (Select All, Copy, Paste, Cut), so the screenshot below is scripted. ## Screenshots (Mac mini, `--offscreen`, 1280x720) | Typed | After Cmd+A | |---|---| | ![](https://raw.githubusercontent.com/ludovic111/horizon/df8e90c432d92d3c3eca2de4c7be805602876876/q1/book-title-typed.png) | ![](https://raw.githubusercontent.com/ludovic111/horizon/df8e90c432d92d3c3eca2de4c7be805602876876/q1/book-title-select-all.png) | Before this PR the Cmd+A frame looked like the typed one: no highlight. Part of #275 ## Self-check (Mac mini, one integration commit of the five Q1 PRs on origin/main 2d586fac) - `cargo fmt --all --check`: clean - `set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings`: clean (no warnings, no errors) - `cargo test -p horizon-client`: lib 962 passed (14 ignored), main 84 passed, horizon-ctl 15 passed, integration tests 7 passed - `tools/parity.py --changed origin/main`: all 101 affected harnesses pass (secure_chat failed once in the batch run, which reused cached oracle results, then passed when rerun alone) ## Needs Ludovic Nothing. 🤖 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 16:01:15 +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#3069
No description provided.