[PR #7548] Language: the selection key picks a language and finishes the page #7662

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7548
Author: @MSedgeMC
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/language-enter-select


📝 Commits (3)

  • 4991baf Language: the selection key picks a language and finishes the page
  • 381659f test: a language row's selection key applies and leaves the page
  • 673fa35 port_map: client2-017's language row key row is a port

📊 Changes

2 files changed (+50 additions, -6 deletions)

View changed files

📝 crates/horizon-client-render/src/options_ui.rs (+49 -5)
📝 tools/port_map/client2-017.tsv (+1 -1)

📄 Description

Vanilla

LanguageSelectScreen.LanguageSelectionList.Entry.keyPressed asks the key for isSelection() — Enter, Space or keypad Enter (InputWithModifiers.isSelection tests inputs 40, 44 and 88) — and on one of those it calls select() and then LanguageSelectScreen.onDone(), returning true. onDone applies the chosen language and closes the screen, so a keyboard user changes language with one press.

Horizon

The FocusId::Lang arm of the Enter/Space branch in OptionsUi::key_modifiers only remembered the row (language_choice = Some(code)). back, which applies the choice and pops the Language page, ran only when the same row was pressed a second time. A keyboard user therefore had to press Enter twice, and the first press left the page open with Settings::language unchanged.

The arm now sets the choice and calls back in the same press, which is select() then onDone().

Proven

the_selection_key_picks_a_language_and_finishes_the_page (options_ui.rs) focuses a LanguageRow and presses each of Enter, keypad Enter and Space:

  • without the change: Settings::language stays "en_us", no Event::Language is emitted, ui.page() stays Page::Language;
  • with the change: Settings::language is "language_0", the events hold Event::Language("language_0"), ui.page() is Page::Main.

The ledger row LanguageSelectScreen.LanguageSelectionList.Entry.keyPressed (client2-017) loses its "a second press finishes the page" gap note.

Not proven

The build VM was unreachable while this was written, so the test has not been run here: CI will run it (cargo test -p horizon-client-render --lib the_selection_key_picks).


🔄 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/7548 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/language-enter-select` --- ### 📝 Commits (3) - [`4991baf`](https://github.com/horizon-rust/horizon/commit/4991baf54e9c5a44d1ca2631781fe43ff7e8031c) Language: the selection key picks a language and finishes the page - [`381659f`](https://github.com/horizon-rust/horizon/commit/381659f209a17ff2fb83dc0314596df138d8aa2d) test: a language row's selection key applies and leaves the page - [`673fa35`](https://github.com/horizon-rust/horizon/commit/673fa35179787e41b07154f3b50fdfe7423d9798) port_map: client2-017's language row key row is a port ### 📊 Changes **2 files changed** (+50 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/options_ui.rs` (+49 -5) 📝 `tools/port_map/client2-017.tsv` (+1 -1) </details> ### 📄 Description ## Vanilla `LanguageSelectScreen.LanguageSelectionList.Entry.keyPressed` asks the key for `isSelection()` — Enter, Space or keypad Enter (`InputWithModifiers.isSelection` tests inputs 40, 44 and 88) — and on one of those it calls `select()` and then `LanguageSelectScreen.onDone()`, returning true. `onDone` applies the chosen language and closes the screen, so a keyboard user changes language with one press. ## Horizon The `FocusId::Lang` arm of the Enter/Space branch in `OptionsUi::key_modifiers` only remembered the row (`language_choice = Some(code)`). `back`, which applies the choice and pops the Language page, ran only when the same row was pressed a second time. A keyboard user therefore had to press Enter twice, and the first press left the page open with `Settings::language` unchanged. The arm now sets the choice and calls `back` in the same press, which is `select()` then `onDone()`. ## Proven `the_selection_key_picks_a_language_and_finishes_the_page` (`options_ui.rs`) focuses a `LanguageRow` and presses each of Enter, keypad Enter and Space: - without the change: `Settings::language` stays `"en_us"`, no `Event::Language` is emitted, `ui.page()` stays `Page::Language`; - with the change: `Settings::language` is `"language_0"`, the events hold `Event::Language("language_0")`, `ui.page()` is `Page::Main`. The ledger row `LanguageSelectScreen.LanguageSelectionList.Entry.keyPressed` (client2-017) loses its "a second press finishes the page" gap note. ## Not proven The build VM was unreachable while this was written, so the test has not been run here: CI will run it (`cargo test -p horizon-client-render --lib the_selection_key_picks`). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7662
No description provided.