[PR #2476] [MERGED] Open chat links from open_url click events #4351

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2476
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/chat-links


📝 Commits (7)

  • 8517898 Open chat links from open_url click events
  • cdafcd7 Open links and page links in written books
  • 2929bb6 open_url: accept the http and https schemes in any case
  • c352c80 Books: save a plain page as a string, as ComponentSerialization does
  • 36c18fd Merge main into fix branch (resolves the conflict with main)
  • ce94056 Merge main into fix/chat-links
  • f2070ce Merge main into fix/chat-links

📊 Changes

7 files changed (+230 additions, -31 deletions)

View changed files

📝 crates/horizon-client-core/src/component.rs (+16 -0)
📝 crates/horizon-client-core/src/text.rs (+6 -0)
📝 crates/horizon-client/src/game.rs (+16 -0)
📝 crates/horizon-client/src/game/books.rs (+84 -20)
📝 crates/horizon-client/src/game/chat.rs (+67 -1)
📝 crates/horizon-client/src/item_data.rs (+33 -5)
📝 crates/horizon-client/src/lan/guest.rs (+8 -5)

📄 Description

What and why

A click_event with the open_url action (from /tellraw, a server's chat or a book) did nothing: Horizon's ClickEvent had no OpenUrl. Clicking such a chat line now follows the Web Links option (nothing when off) and then, unless Prompt on Links is off, asks "Are you sure you want to open the following website?" with the link and the warning; yes opens it in the system browser, no or Escape goes back to the chat. Only http and https links are accepted, as in vanilla's codec.

The prompt has Yes and No only; vanilla's third button, Copy to Clipboard, is not there.

Vanilla reference

ClickEvent.OpenUrl / ExtraCodecs.UNTRUSTED_URI, Screen.defaultHandleClickEvent and Screen.clickUrlAction (chatLinks, chatLinksPrompt), and ConfirmLinkScreen. Vanilla does not turn plain URLs in chat into links, so this does not either.

Self-check

cargo check -p horizon-client passes.


🔄 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/2476 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/chat-links` --- ### 📝 Commits (7) - [`8517898`](https://github.com/horizon-rust/horizon/commit/851789830a7fbf4b325963f5252273fc5281627a) Open chat links from open_url click events - [`cdafcd7`](https://github.com/horizon-rust/horizon/commit/cdafcd756f1c436a9a41cceaa7fee118982bbe11) Open links and page links in written books - [`2929bb6`](https://github.com/horizon-rust/horizon/commit/2929bb6dbabbcd337753febc0c69d0055c5c08f4) open_url: accept the http and https schemes in any case - [`c352c80`](https://github.com/horizon-rust/horizon/commit/c352c80c9645bd333f630a28dceda2e9035117fc) Books: save a plain page as a string, as ComponentSerialization does - [`36c18fd`](https://github.com/horizon-rust/horizon/commit/36c18fd8ea07b88c33d3ec7b2e553d1f445a0c19) Merge main into fix branch (resolves the conflict with main) - [`ce94056`](https://github.com/horizon-rust/horizon/commit/ce940569860faf2afd411bbc4748902321760730) Merge main into fix/chat-links - [`f2070ce`](https://github.com/horizon-rust/horizon/commit/f2070cef54362fd64126349246b26bf7b212ed69) Merge main into fix/chat-links ### 📊 Changes **7 files changed** (+230 additions, -31 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-core/src/component.rs` (+16 -0) 📝 `crates/horizon-client-core/src/text.rs` (+6 -0) 📝 `crates/horizon-client/src/game.rs` (+16 -0) 📝 `crates/horizon-client/src/game/books.rs` (+84 -20) 📝 `crates/horizon-client/src/game/chat.rs` (+67 -1) 📝 `crates/horizon-client/src/item_data.rs` (+33 -5) 📝 `crates/horizon-client/src/lan/guest.rs` (+8 -5) </details> ### 📄 Description ## What and why A `click_event` with the `open_url` action (from `/tellraw`, a server's chat or a book) did nothing: Horizon's `ClickEvent` had no `OpenUrl`. Clicking such a chat line now follows the Web Links option (nothing when off) and then, unless Prompt on Links is off, asks "Are you sure you want to open the following website?" with the link and the warning; yes opens it in the system browser, no or Escape goes back to the chat. Only http and https links are accepted, as in vanilla's codec. The prompt has Yes and No only; vanilla's third button, Copy to Clipboard, is not there. ## Vanilla reference `ClickEvent.OpenUrl` / `ExtraCodecs.UNTRUSTED_URI`, `Screen.defaultHandleClickEvent` and `Screen.clickUrlAction` (`chatLinks`, `chatLinksPrompt`), and `ConfirmLinkScreen`. Vanilla does not turn plain URLs in chat into links, so this does not either. ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:16:32 +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#4351
No description provided.