[PR #7286] [MERGED] Port map: chat drafts are kept and restored, so two ChatComponent rows are ported #7462

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

📋 Pull Request Information

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

Base: main ← Head: chore/vol-a-client2-010


📝 Commits (2)

  • 98330ea port_map: chat drafts are kept, so saveAsDraft is ported
  • b597fa9 port_map: createScreen is open_chat_method, and its draft gap is closed

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 tools/port_map/client2-010.tsv (+2 -2)

📄 Description

Two ChatComponent rows in tools/port_map/client2-010.tsv that called chat
drafts missing: the drafts are kept and restored in game/chat.rs.

row before after
ChatComponent.saveAsDraft missing ("Save Chat Drafts does nothing") crates/horizon-client/src/game/chat.rs::Game::keep_chat_draft
ChatComponent.createScreen Game::open_chat + "no draft is restored" gap crates/horizon-client/src/game/chat.rs::Game::open_chat_method

Citations checked in the tree

  • Game::keep_chat_draft is ChatScreen.removed's half of saveAsDraft: the
    text left in the box becomes the draft (with command: text.starts_with('/'))
    unless should_discard_draft — closed on purpose with Save Chat Drafts off, or
    sent — or the text is blank, and a draft still shown unchanged stays as it is.
  • The option behind it is real: saveChatDrafts is in options_file.rs
    (default false) and drawn as Opt::SaveChatDrafts in options_ui.rs, so the
    old note that the option does nothing is gone.
  • Game::open_chat_method is ChatComponent.createScreen: it takes the kept
    draft when it can restore it (a command draft only when the box opens with
    /), opens the box with the tab's prefix otherwise, and sets
    chat_draft_shown when the box starts on a draft.

Map check

python3 tools/port_ledger.py map-check tools/port_map/client2-010.tsv
144 rows, no problems.

Proven: both functions exist at the cited paths, cite the vanilla methods in
their own doc comments, and the map-check passes on the file.

Not proven: no chat screen was opened in game, so the draft round trip is
read from the code, not typed. ChatComponent.preserveCurrentChatScreen stays
missing: nothing keeps the chat screen across a dimension change.


🔄 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/7286 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `chore/vol-a-client2-010` --- ### 📝 Commits (2) - [`98330ea`](https://github.com/horizon-rust/horizon/commit/98330eacf23d96012c05c2f14d9e364bfd0e57a1) port_map: chat drafts are kept, so saveAsDraft is ported - [`b597fa9`](https://github.com/horizon-rust/horizon/commit/b597fa981e5a614f94d29ef961395a753c1f31bf) port_map: createScreen is open_chat_method, and its draft gap is closed ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `tools/port_map/client2-010.tsv` (+2 -2) </details> ### 📄 Description Two `ChatComponent` rows in `tools/port_map/client2-010.tsv` that called chat drafts missing: the drafts are kept and restored in `game/chat.rs`. | row | before | after | | --- | --- | --- | | `ChatComponent.saveAsDraft` | missing ("Save Chat Drafts does nothing") | `crates/horizon-client/src/game/chat.rs::Game::keep_chat_draft` | | `ChatComponent.createScreen` | `Game::open_chat` + "no draft is restored" gap | `crates/horizon-client/src/game/chat.rs::Game::open_chat_method` | **Citations checked in the tree** - `Game::keep_chat_draft` is `ChatScreen.removed`'s half of `saveAsDraft`: the text left in the box becomes the draft (with `command: text.starts_with('/')`) unless `should_discard_draft` — closed on purpose with Save Chat Drafts off, or sent — or the text is blank, and a draft still shown unchanged stays as it is. - The option behind it is real: `saveChatDrafts` is in `options_file.rs` (default `false`) and drawn as `Opt::SaveChatDrafts` in `options_ui.rs`, so the old note that the option does nothing is gone. - `Game::open_chat_method` is `ChatComponent.createScreen`: it takes the kept draft when it can restore it (a command draft only when the box opens with `/`), opens the box with the tab's prefix otherwise, and sets `chat_draft_shown` when the box starts on a draft. **Map check** ``` python3 tools/port_ledger.py map-check tools/port_map/client2-010.tsv 144 rows, no problems. ``` **Proven:** both functions exist at the cited paths, cite the vanilla methods in their own doc comments, and the map-check passes on the file. **Not proven:** no chat screen was opened in game, so the draft round trip is read from the code, not typed. `ChatComponent.preserveCurrentChatScreen` stays missing: nothing keeps the chat screen across a dimension change. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:39:51 +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#7462
No description provided.