From 02f556d5978f9ac1dd22faad59df9b7190825c79 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Sat, 8 Aug 2026 20:44:43 +0700 Subject: [PATCH] fix(settings): make background images findable from the settings search MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "background image" is a headline feature — the README sells solid, gradient and image backgrounds — and searching for it found nothing. Worse than nothing: typing it walked the page to About, because "background" on its own matches Download updates in the background, and the last two words then dropped the count to zero and left the reader stranded there with no badge and nothing dimmed. Background image and Image opacity now carry index entries, and the Custom themes intro gains the same keywords so the query has something to light in the state where those two rows do not exist yet — which is the state you are in before you duplicate a theme, next to the button that gets you there. The badge counts index entries, not rendered rows, so it can read (3) while one is on screen. That is how the already-indexed ANSI colors entry behaves too; not changed here. --- src/ui/i18n/en.rs | 8 +++++++- src/ui/i18n/ja.rs | 8 +++++++- src/ui/i18n/mod.rs | 2 ++ src/ui/i18n/zh.rs | 8 +++++++- src/ui/settings.rs | 17 +++++++++++++++++ 5 files changed, 40 insertions(+), 3 deletions(-) diff --git a/src/ui/i18n/en.rs b/src/ui/i18n/en.rs index 9673924f..07ffb22e 100644 --- a/src/ui/i18n/en.rs +++ b/src/ui/i18n/en.rs @@ -607,6 +607,12 @@ pub fn translate_en(key: L10nKey) -> &'static str { "proxy http https socks socks5 clash v2ray network download update" } L10nKey::SettingsSearchAnsiColorsKeywords => "palette 16 terminal colours theme", + L10nKey::SettingsSearchBackgroundImageKeywords => { + "background image wallpaper picture photo backdrop theme" + } + L10nKey::SettingsSearchImageOpacityKeywords => { + "background image opacity strength fade wallpaper" + } L10nKey::SettingsSearchArgumentsKeywords => "shell flags login args", L10nKey::SettingsSearchBlurKeywords => { "transparency translucent frosted vibrancy window background" @@ -626,7 +632,7 @@ pub fn translate_en(key: L10nKey) -> &'static str { L10nKey::SettingsSearchCursorBlinkKeywords => "caret blinking flash", L10nKey::SettingsSearchCursorShapeKeywords => "caret block bar underline beam", L10nKey::SettingsSearchCustomThemesKeywords => { - "theme duplicate edit colors folder yaml import" + "theme duplicate edit colors folder yaml import background image wallpaper" } L10nKey::SettingsSearchDetectUrlsKeywords => "links hyperlink clickable open", L10nKey::SettingsSearchDiffPreviewFromCountsKeywords => { diff --git a/src/ui/i18n/ja.rs b/src/ui/i18n/ja.rs index 54f81773..f10b38d7 100644 --- a/src/ui/i18n/ja.rs +++ b/src/ui/i18n/ja.rs @@ -608,6 +608,12 @@ pub fn translate_ja(key: L10nKey) -> Option<&'static str> { L10nKey::SettingsSearchAnsiColorsKeywords => { "パレット 16 ANSI カラー ターミナル テーマ ansi colors palette terminal theme colours" } + L10nKey::SettingsSearchBackgroundImageKeywords => { + "背景画像 壁紙 画像 写真 テーマ background image wallpaper picture theme" + } + L10nKey::SettingsSearchImageOpacityKeywords => { + "背景画像 不透明度 透明度 強さ 壁紙 background image opacity strength fade" + } L10nKey::SettingsSearchArgumentsKeywords => { "シェル フラグ ログイン 引数 arguments shell flags login args" } @@ -639,7 +645,7 @@ pub fn translate_ja(key: L10nKey) -> Option<&'static str> { "カーソル 形状 ブロック バー アンダーライン ビーム cursor shape caret block bar underline beam" } L10nKey::SettingsSearchCustomThemesKeywords => { - "テーマ 複製 編集 色 フォルダ yaml インポート custom themes duplicate edit colors folder import" + "テーマ 複製 編集 色 フォルダ 背景画像 壁紙 yaml インポート custom themes duplicate edit colors folder import background image wallpaper" } L10nKey::SettingsSearchDetectUrlsKeywords => { "リンク ハイパーリンク クリック可能 開く detect urls links hyperlink clickable open" diff --git a/src/ui/i18n/mod.rs b/src/ui/i18n/mod.rs index 7d8772ca..47e6b307 100644 --- a/src/ui/i18n/mod.rs +++ b/src/ui/i18n/mod.rs @@ -509,6 +509,8 @@ l10n_keys! { SettingsSearchCheckUpdatesOnLaunchKeywords, SettingsSearchUpdateChannelKeywords, SettingsSearchAnsiColorsKeywords, + SettingsSearchBackgroundImageKeywords, + SettingsSearchImageOpacityKeywords, SettingsSearchArgumentsKeywords, SettingsSearchBlurKeywords, SettingsSearchBoldFontKeywords, diff --git a/src/ui/i18n/zh.rs b/src/ui/i18n/zh.rs index de53b6f0..4d53d38c 100644 --- a/src/ui/i18n/zh.rs +++ b/src/ui/i18n/zh.rs @@ -539,6 +539,12 @@ pub fn translate_zh(key: L10nKey) -> Option<&'static str> { L10nKey::SettingsSearchAnsiColorsKeywords => { "ANSI颜色 调色板 终端颜色 主题 ansi colors palette terminal theme" } + L10nKey::SettingsSearchBackgroundImageKeywords => { + "背景图片 背景图 壁纸 图片 照片 主题 background image wallpaper picture theme" + } + L10nKey::SettingsSearchImageOpacityKeywords => { + "背景图片 不透明度 透明度 强度 壁纸 background image opacity strength fade" + } L10nKey::SettingsSearchArgumentsKeywords => { "参数 shell 启动参数 登录参数 arguments shell flags login args" } @@ -568,7 +574,7 @@ pub fn translate_zh(key: L10nKey) -> Option<&'static str> { "光标形状 光标 块 竖线 下划线 cursor shape caret block bar underline beam" } L10nKey::SettingsSearchCustomThemesKeywords => { - "自定义主题 复制 编辑 颜色 文件夹 yaml 导入 theme custom edit duplicate colors import" + "自定义主题 复制 编辑 颜色 文件夹 背景图片 壁纸 yaml 导入 theme custom edit duplicate colors import background image wallpaper" } L10nKey::SettingsSearchDetectUrlsKeywords => { "检测URL 链接 超链接 可点击 打开 detect urls links hyperlink open" diff --git a/src/ui/settings.rs b/src/ui/settings.rs index cf1e7a05..507d7ed8 100644 --- a/src/ui/settings.rs +++ b/src/ui/settings.rs @@ -199,6 +199,16 @@ fn settings_search_entries() -> &'static [SearchEntry] { title: SettingsAnsiColors, keywords: SettingsSearchAnsiColorsKeywords, }, + SearchEntry { + section: Appearance, + title: SettingsBackgroundImage, + keywords: SettingsSearchBackgroundImageKeywords, + }, + SearchEntry { + section: Appearance, + title: SettingsImageOpacity, + keywords: SettingsSearchImageOpacityKeywords, + }, SearchEntry { section: Terminal, title: SettingsProgram, @@ -5754,6 +5764,13 @@ mod tests { ("channel", About), ("metered", About), ("automatic", About), + // A headline feature the index had never heard of: "background + // image" matched nothing, and typing it walked the page to About + // because "background" alone hits Download updates in the + // background. + ("background image", Appearance), + ("wallpaper", Appearance), + ("image opacity", Appearance), ]; for (query, expected) in cases { assert_eq!(