From 6bf500dba74b8cb15270813e2ecefe86ec19c2fe Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Sun, 27 Sep 2026 14:36:36 +0200 Subject: [PATCH] fix(settings): action menus don't reserve a column for a tick Every settings menu kept an empty tick column, so a menu of actions (an agent's Reinstall / Reveal / Uninstall) set its labels 24px in from a 12px right edge. The column is kept only when some entry is ticked - a choice menu - and an action menu is padded evenly. --- src/ui/i18n/ja.rs | 4 +++- src/ui/settings/shell.rs | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ui/i18n/ja.rs b/src/ui/i18n/ja.rs index ca14f293..37e60811 100644 --- a/src/ui/i18n/ja.rs +++ b/src/ui/i18n/ja.rs @@ -513,7 +513,9 @@ pub fn translate_ja(key: L10nKey) -> Option<&'static str> { L10nKey::SettingsOn => "オン", L10nKey::SettingsOff => "オフ", L10nKey::SettingsShell => "シェル", - L10nKey::SettingsShellIntro => "新しいターミナルで起動するプログラム。空欄なら{default}を使います。", + L10nKey::SettingsShellIntro => { + "新しいターミナルで起動するプログラム。空欄なら{default}を使います。" + } L10nKey::SettingsProgram => "シェルプログラム", L10nKey::SettingsProgramDesc => "PATH 上の名前か絶対パス。例: zsh、fish", L10nKey::SettingsArguments => "シェル引数", diff --git a/src/ui/settings/shell.rs b/src/ui/settings/shell.rs index cbb82e5e..d7f413d7 100644 --- a/src/ui/settings/shell.rs +++ b/src/ui/settings/shell.rs @@ -158,6 +158,12 @@ impl Tty7App { ) -> Div { let tk = Tk::of(cx); let mut panel = kit::menu_panel(&tk); + // A choice menu keeps a column for its tick so the labels line up + // whichever one is picked. A menu of actions ticks nothing, and the + // same empty column left its labels 24px in from a 12px right edge. + let ticks = entries + .iter() + .any(|e| matches!(e, MenuEntry::Item { checked: true, .. })); for (i, entry) in entries.into_iter().enumerate() { panel = match entry { MenuEntry::Item { @@ -173,7 +179,8 @@ impl Tty7App { false, &tk, ) - .child(kit::check_mark(checked, &tk)) + .when(ticks, |r| r.child(kit::check_mark(checked, &tk))) + .when(!ticks, |r| r.pl(px(12.))) .child( div() .flex_1()