[PR #2997] [MERGED] fix(client): the link prompt has ConfirmLinkScreen's Copy to Clipboard button #4748

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

📋 Pull Request Information

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

Base: main ← Head: feat/link-prompt-copy


📝 Commits (1)

  • 5c14d18 fix(client): the link prompt has ConfirmLinkScreen's Copy to Clipboard button

📊 Changes

2 files changed (+143 additions, -36 deletions)

View changed files

📝 crates/horizon-client/src/confirm_screen.rs (+119 -25)
📝 crates/horizon-client/src/game/chat.rs (+24 -11)

📄 Description

What and why

The confirm-link prompt had Yes and No only. Vanilla's ConfirmLinkScreen for an untrusted link has three buttons, Yes, Copy to Clipboard and No, 100 wide each. Copy puts the link on the clipboard and answers no (back to the chat or book it came from). That's handy where opening a browser isn't what the player wants.

  • confirm_screen::Choice: ConfirmScreen's layout with a row of count buttons width wide, 4 apart, and pressed_at for the index hit. Confirm now builds on it and keeps its two 150-wide buttons in the same place (checked in the test).
  • chat.rs: the link prompt uses Choice with Yes / chat.copy / No.

Vanilla reference

  • ConfirmLinkScreen(callback, url, false): yesButtonComponent = GUI_YES, noButtonComponent = GUI_NO, showWarning = true.
  • ConfirmLinkScreen.addButtons: yes, GUI_COPY_TO_CLIPBOARD (copyToClipboard() then callback.accept(false)), no, each .width(100).
  • Screen.clickUrlAction: the prompt only when chatLinksPrompt is on (unchanged).

No harness: client screen layout; confirm_screen has a unit test for the button row.

Self-check

cargo fmt and cargo check -p horizon-client are clean. I didn't run the full pr_ready.py locally (it is slow on this machine); CI's verify covers it.


🔄 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/2997 **Author:** [@feeldev12](https://github.com/feeldev12) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/link-prompt-copy` --- ### 📝 Commits (1) - [`5c14d18`](https://github.com/horizon-rust/horizon/commit/5c14d18141b149a808a52752459716991d145a7d) fix(client): the link prompt has ConfirmLinkScreen's Copy to Clipboard button ### 📊 Changes **2 files changed** (+143 additions, -36 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/confirm_screen.rs` (+119 -25) 📝 `crates/horizon-client/src/game/chat.rs` (+24 -11) </details> ### 📄 Description ## What and why The confirm-link prompt had Yes and No only. Vanilla's `ConfirmLinkScreen` for an untrusted link has three buttons, **Yes**, **Copy to Clipboard** and **No**, 100 wide each. Copy puts the link on the clipboard and answers no (back to the chat or book it came from). That's handy where opening a browser isn't what the player wants. - `confirm_screen::Choice`: `ConfirmScreen`'s layout with a row of `count` buttons `width` wide, 4 apart, and `pressed_at` for the index hit. `Confirm` now builds on it and keeps its two 150-wide buttons in the same place (checked in the test). - `chat.rs`: the link prompt uses `Choice` with Yes / `chat.copy` / No. ## Vanilla reference - `ConfirmLinkScreen(callback, url, false)`: `yesButtonComponent = GUI_YES`, `noButtonComponent = GUI_NO`, `showWarning = true`. - `ConfirmLinkScreen.addButtons`: yes, `GUI_COPY_TO_CLIPBOARD` (`copyToClipboard()` then `callback.accept(false)`), no, each `.width(100)`. - `Screen.clickUrlAction`: the prompt only when `chatLinksPrompt` is on (unchanged). No harness: client screen layout; `confirm_screen` has a unit test for the button row. ## Self-check `cargo fmt` and `cargo check -p horizon-client` are clean. I didn't run the full `pr_ready.py` locally (it is slow on this machine); CI's `verify` covers it. --- <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:38 +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#4748
No description provided.