[PR #4797] [MERGED] Dialogs: multiline text inputs are a MultiLineEditBox #5858

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4797
Author: @levzzz5154
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: parity/U-multiline


📝 Commits (1)

  • 7e902a6 Dialog text inputs with a multiline option are a MultiLineEditBox

📊 Changes

6 files changed (+978 additions, -32 deletions)

View changed files

📝 crates/horizon-client-render/src/lib.rs (+1 -0)
➕ crates/horizon-client-render/src/multiline_edit.rs (+780 -0)
📝 crates/horizon-client-render/src/ui.rs (+1 -1)
📝 crates/horizon-client/src/dialog_screen.rs (+29 -4)
📝 crates/horizon-client/src/game/dialogs.rs (+160 -21)
📝 crates/horizon-client/src/lib.rs (+7 -6)

📄 Description

🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally.

Part of #3518

Rows

  • InputControlHandlers.TextInputHandler.addControl: a dialog text input with multiline was drawn as one 20 px EditBox and its max_lines ignored. It is now a MultiLineEditBox as tall as height, or min(9 * max_lines (4 by default) + 8, 512), with the input's max_length as the character limit and max_lines as the line limit, and the initial value set through setValue (kept empty if it overflows the line limit).

What is ported

New horizon_client::multiline_edit::MultiLineEdit (MultiLineEditBox + MultilineTextField + AbstractTextAreaWidget/AbstractScrollArea): StringSplitter.splitLines positions for wrapping, insertText/deleteText with character and line limits, seekCursor/seekCursorLine/seekCursorToPoint, previous/next word, keyPressed (Backspace/Delete, Ctrl word, Home/End, PageUp/PageDown, arrows, Enter, Ctrl+A/C/V/X), scrollToCursor, click (shift, double click), drag, wheel and the scroll bar, the selection highlight, insert and append cursors, and gui.multiLineEditBox.character_limit. game/dialogs.rs holds a Field that is either the old EditBox or this, so dialog layout (dialog_screen::text_height), draw, click, drag, release, wheel, keys and type go to the right one.

Vanilla followed

InputControlHandlers.TextInputHandler.addControl, MultiLineEditBox, MultilineTextField, AbstractTextAreaWidget, AbstractScrollArea, StringSplitter.splitLines/LineBreakFinder, TextCursorUtils.

Tests

multiline_edit::tests (wrapping, trailing newline, limits, line/column movement, selection, scrolling, clicks), dialog_screen::tests (box height). cargo clippy -p horizon-client-render -p horizon-client --all-targets -D warnings clean. Not run: the game (no IME preedit overlay, as for the other fields).

🤖 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/4797 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `parity/U-multiline` --- ### 📝 Commits (1) - [`7e902a6`](https://github.com/horizon-rust/horizon/commit/7e902a688602a93ad0b19505443de8b88413a3f1) Dialog text inputs with a multiline option are a MultiLineEditBox ### 📊 Changes **6 files changed** (+978 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/lib.rs` (+1 -0) ➕ `crates/horizon-client-render/src/multiline_edit.rs` (+780 -0) 📝 `crates/horizon-client-render/src/ui.rs` (+1 -1) 📝 `crates/horizon-client/src/dialog_screen.rs` (+29 -4) 📝 `crates/horizon-client/src/game/dialogs.rs` (+160 -21) 📝 `crates/horizon-client/src/lib.rs` (+7 -6) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally. Part of #3518 ## Rows - `InputControlHandlers.TextInputHandler.addControl`: a dialog text input with `multiline` was drawn as one 20 px `EditBox` and its `max_lines` ignored. It is now a `MultiLineEditBox` as tall as `height`, or `min(9 * max_lines (4 by default) + 8, 512)`, with the input's `max_length` as the character limit and `max_lines` as the line limit, and the initial value set through `setValue` (kept empty if it overflows the line limit). ## What is ported New `horizon_client::multiline_edit::MultiLineEdit` (`MultiLineEditBox` + `MultilineTextField` + `AbstractTextAreaWidget`/`AbstractScrollArea`): `StringSplitter.splitLines` positions for wrapping, `insertText`/`deleteText` with character and line limits, `seekCursor`/`seekCursorLine`/`seekCursorToPoint`, previous/next word, `keyPressed` (Backspace/Delete, Ctrl word, Home/End, PageUp/PageDown, arrows, Enter, Ctrl+A/C/V/X), `scrollToCursor`, click (shift, double click), drag, wheel and the scroll bar, the selection highlight, insert and append cursors, and `gui.multiLineEditBox.character_limit`. `game/dialogs.rs` holds a `Field` that is either the old `EditBox` or this, so dialog layout (`dialog_screen::text_height`), draw, click, drag, release, wheel, keys and `type` go to the right one. ## Vanilla followed `InputControlHandlers.TextInputHandler.addControl`, `MultiLineEditBox`, `MultilineTextField`, `AbstractTextAreaWidget`, `AbstractScrollArea`, `StringSplitter.splitLines/LineBreakFinder`, `TextCursorUtils`. ## Tests `multiline_edit::tests` (wrapping, trailing newline, limits, line/column movement, selection, scrolling, clicks), `dialog_screen::tests` (box height). `cargo clippy -p horizon-client-render -p horizon-client --all-targets -D warnings` clean. Not run: the game (no IME preedit overlay, as for the other fields). 🤖 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-03 05:15:29 +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#5858
No description provided.