[PR #6055] [MERGED] IME: compose in chat, the options searches and the game rules screen #6630

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6055
Author: @JustKarkat
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/ime-text-input


📝 Commits (1)

  • c481ffe IME: the chat box, the options searches and the remaining boxes take composed text

📊 Changes

4 files changed (+41 additions, -1 deletions)

View changed files

📝 crates/horizon-client-render/src/options_ui.rs (+18 -0)
📝 crates/horizon-client-render/src/screen_draw.rs (+8 -0)
📝 crates/horizon-client/src/game/block_editor.rs (+5 -0)
📝 crates/horizon-client/src/game/ime.rs (+10 -1)

📄 Description

🤖 Opened by JustKarkat's AI agent (ZCode, deepseek-v4.1-flash), not by JustKarkat personally.

Fixes #4338. Completes #4347, which was merged as a partial fix.

What and why

Game::text_field_focused decides whether the window asks the OS for an input method (Window::set_ime_allowed), each frame. Four text boxes were missing from it, so no input method was enabled while they had the focus, and a Korean, Japanese or Chinese keyboard could not type in them:

Box Where Why it was out
the language list's search, the settings search, the resource pack screen's search Options OptionsUi::typing() was not in the match
the game rules' value boxes Create World → Game Rules the gate asked focused_field(), which is None while the rules screen is open (its boxes edit themselves, has_caret_field)
the value boxes of a game master block Screen::BlockEditor not in the match

The chat box — where the report typed — had a different gap. It is a screen_draw::TextField, and unlike EditBox and MultiLineEditBox it never reported its caret. flush_ime draws the composition at the caret the focused field reported and calls Window::set_ime_cursor_area with it, so with no report the composition was invisible and no candidate window was placed: even with #4347 merged, chat typing stayed blind until the commit, one syllable behind (exactly the report's Windows 11 Korean case). TextField::draw now reports its caret where it draws the cursor.

Kind

A fix (vanilla parity: KeyboardHandler.textEditing, TextInputManager.setTextInputArea).

Checked

python3 tools/pr_ready.py --quick on cachy-josh-pc, against origin/main at 486c22db0:

Check Result
Scope ✅ 5 files, +41 −1
Public tree ✅
Python tests ✅ 527 passed
rustfmt ✅
clippy ✅
tests: horizon-client, horizon-client-render ✅ 2589 passed
doc tests ✅
Parity ➖ 124 affected, run in CI

The new test options_ui::tests::only_a_focused_search_box_takes_text pins the Options half of the gate: that page asks for the keys only while a search box has the focus, so an enabled input method cannot swallow menu keys on a page without one.

Not checked

  • No input method on this machine (no Korean, Japanese or Chinese IME), so composition behaviour is untested live; the call sites and the caret report were read against vanilla, not run. A player with an IME on a nightly build is the real check.
  • python3 tools/port_ledger.py check --base origin/main was not run: this machine has the 26.3 jars but no decompiled sources (.local/minecraft/26.3/sources), and lab.py decompile was not run for this diff.

🔄 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/6055 **Author:** [@JustKarkat](https://github.com/JustKarkat) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/ime-text-input` --- ### 📝 Commits (1) - [`c481ffe`](https://github.com/horizon-rust/horizon/commit/c481ffedf28a40178ecd885fc608c3b41700d242) IME: the chat box, the options searches and the remaining boxes take composed text ### 📊 Changes **4 files changed** (+41 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/options_ui.rs` (+18 -0) 📝 `crates/horizon-client-render/src/screen_draw.rs` (+8 -0) 📝 `crates/horizon-client/src/game/block_editor.rs` (+5 -0) 📝 `crates/horizon-client/src/game/ime.rs` (+10 -1) </details> ### 📄 Description > 🤖 Opened by JustKarkat's AI agent (ZCode, deepseek-v4.1-flash), not by JustKarkat personally. Fixes #4338. Completes #4347, which was merged as a partial fix. ## What and why `Game::text_field_focused` decides whether the window asks the OS for an input method (`Window::set_ime_allowed`), each frame. Four text boxes were missing from it, so no input method was enabled while they had the focus, and a Korean, Japanese or Chinese keyboard could not type in them: | Box | Where | Why it was out | |---|---|---| | the language list's search, the settings search, the resource pack screen's search | Options | `OptionsUi::typing()` was not in the match | | the game rules' value boxes | Create World → Game Rules | the gate asked `focused_field()`, which is `None` while the rules screen is open (its boxes edit themselves, `has_caret_field`) | | the value boxes of a game master block | `Screen::BlockEditor` | not in the match | The chat box — where the report typed — had a different gap. It is a `screen_draw::TextField`, and unlike `EditBox` and `MultiLineEditBox` it never reported its caret. `flush_ime` draws the composition at the caret the focused field reported and calls `Window::set_ime_cursor_area` with it, so with no report the composition was invisible and no candidate window was placed: even with #4347 merged, chat typing stayed blind until the commit, one syllable behind (exactly the report's Windows 11 Korean case). `TextField::draw` now reports its caret where it draws the cursor. ## Kind A fix (vanilla parity: `KeyboardHandler.textEditing`, `TextInputManager.setTextInputArea`). ## Checked `python3 tools/pr_ready.py --quick` on cachy-josh-pc, against origin/main at 486c22db0: | Check | Result | | --- | --- | | Scope | ✅ 5 files, +41 −1 | | Public tree | ✅ | | Python tests | ✅ 527 passed | | rustfmt | ✅ | | clippy | ✅ | | tests: horizon-client, horizon-client-render | ✅ 2589 passed | | doc tests | ✅ | | Parity | ➖ 124 affected, run in CI | The new test `options_ui::tests::only_a_focused_search_box_takes_text` pins the Options half of the gate: that page asks for the keys only while a search box has the focus, so an enabled input method cannot swallow menu keys on a page without one. ## Not checked - No input method on this machine (no Korean, Japanese or Chinese IME), so composition behaviour is untested live; the call sites and the caret report were read against vanilla, not run. A player with an IME on a nightly build is the real check. - `python3 tools/port_ledger.py check --base origin/main` was not run: this machine has the 26.3 jars but no decompiled sources (`.local/minecraft/26.3/sources`), and `lab.py decompile` was not run for this diff. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:24:01 +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#6630
No description provided.