From d7e66606ad2941541c535dfff535e5fffc66e77a Mon Sep 17 00:00:00 2001 From: David Mann Date: Fri, 6 Nov 2026 19:27:11 +0100 Subject: [PATCH] Address CodeRabbit review: Turkic I text, type-ahead language change, RTL coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - zoom field: a menu's I key drops İ/ı text whatever the UI language (the keyboard layout is not the interface language). - dropdown type-ahead: one entry per list tagged with its language, cleared on any frame in another language, so a prefix never carries over a quick switch and back. - Hebrew and Urdu: live shell test selects each catalog, checks mirroring and glyphs. - Azerbaijani restart test resets the drawing language before the restarted shell loads. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/text/direction/tests.rs | 2 +- crates/ui-egui/src/widgets/type_ahead.rs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/text/direction/tests.rs b/crates/ui-egui/src/text/direction/tests.rs index a0b5d34c82e..dda8b71f137 100644 --- a/crates/ui-egui/src/text/direction/tests.rs +++ b/crates/ui-egui/src/text/direction/tests.rs @@ -130,7 +130,7 @@ fn hebrew_and_urdu_mirror_the_shell_and_draw_their_letters() { assert!(dock_x(&h) < 600.0, "{code}: the dock moves to the left"); for label in ["File", "Help", "Layers"] { let text = i18n::tr(lang, label); - assert!(text.chars().any(|c| !c.is_ascii()), "{code}: {label} is translated"); + assert!(!text.is_ascii(), "{code}: {label} is translated"); assert!(h.ctx.fonts_mut(|f| f.has_glyphs(&egui::FontId::proportional(12.0), text)), "{code}: {text} has glyphs"); } h.state_mut().run("prefs.set", json!({"path": "interface.language", "value": "en"})).expect("back to English"); diff --git a/crates/ui-egui/src/widgets/type_ahead.rs b/crates/ui-egui/src/widgets/type_ahead.rs index a04cbd3ded2..ba693702771 100644 --- a/crates/ui-egui/src/widgets/type_ahead.rs +++ b/crates/ui-egui/src/widgets/type_ahead.rs @@ -206,10 +206,11 @@ mod tests { use egui_kittest::{Harness, kittest::Queryable}; let en = crate::i18n::Lang::EN; let de = crate::i18n::Lang::from_code("de").unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(300.0, 400.0)).build_ui_state( + // Short frames: the letters arrive well within the pause, so only the language change resets. + let mut h = Harness::builder().with_size(egui::vec2(300.0, 400.0)).with_step_dt(1.0 / 60.0).build_ui_state( |ui, (selected, lang): &mut (usize, crate::i18n::Lang)| { crate::i18n::with_language(*lang, || { - let options = [(0, "Normal"), (1, "Dissolve"), (2, "Darken")]; + let options = [(0, "Normal"), (1, "Dissolve"), (2, "Darken"), (3, "Add")]; crate::widgets::dropdown(ui, "lang-switch", "Mode", selected, &options, 120.0); }); }, @@ -224,9 +225,10 @@ mod tests { h.step(); h.state_mut().1 = en; h.step(); + assert!(super::list_open(&h.ctx), "the list stays open across the language change"); type_key(&h, egui::Key::A, "a"); h.run(); - assert_eq!(h.state().0, 1, "a alone picks nothing; the d typed before the change is gone (da would be Darken)"); + assert_eq!(h.state().0, 3, "a starts a new prefix (Add); the d typed before the change would make it da (Darken)"); } #[test]