From bb065c7836910eee71b221de02ebe9b6d5a82658 Mon Sep 17 00:00:00 2001 From: Alberto Balbo Date: Mon, 26 Oct 2026 23:18:03 +0100 Subject: [PATCH] =?UTF-8?q?fix(app):=20find=20Settings=20=E2=80=BA=20About?= =?UTF-8?q?=20by=20its=20translation=20row=20only=20when=20it=20shows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The About entry of the Settings search always listed "Translation" among its keywords, and its tooltip named the translation, but that row shows only outside English. In English a search for "Translation" left About alone in the list and selected a page without such a row. The page's search words are now read at each search, so the keyword follows the language while Settings is open, and the tooltip no longer names a row that may be hidden. Also drop About from the doc comments of the update notice and the diagnostics bundle: since owner review 2, R5 only Settings › Updates and Settings › Advanced offer them. Co-Authored-By: Claude Opus 5.5 --- i18n/en/Tooltips.resx | 2 +- i18n/it/Tooltips.it.resx | 2 +- src/Chronos.App/About/UpdateFlow.cs | 2 +- .../Infrastructure/DiagnosticsBundle.cs | 2 +- src/Chronos.App/Sections/SettingsViewModel.cs | 4 +++- src/Chronos.App/Settings/SettingsRows.cs | 15 ++++++++++++--- .../Settings/SettingsLogicTests.cs | 12 ++++++++++++ .../Settings/SettingsScreenSmokeTests.cs | 2 ++ 8 files changed, 33 insertions(+), 8 deletions(-) diff --git a/i18n/en/Tooltips.resx b/i18n/en/Tooltips.resx index b04dae88..e891913f 100644 --- a/i18n/en/Tooltips.resx +++ b/i18n/en/Tooltips.resx @@ -578,7 +578,7 @@ Without this extension some formats are read only from their embedded preview, or not at all, on this PC Frames whose mean brightness is at most this share of white count as night (star fields, night presets) · Enter applies, Esc reverts Open the data folder in Explorer - Version, build, system, licence, third-party code, translation + Version, build, system, licence, third-party code Portable mode, logs, diagnostics, database backup and restore, reset Analysis width, night and star thresholds, deep analysis Archive folder, naming templates, proxy and thumbnail size, rescans diff --git a/i18n/it/Tooltips.it.resx b/i18n/it/Tooltips.it.resx index 81e70c64..1a66bb85 100644 --- a/i18n/it/Tooltips.it.resx +++ b/i18n/it/Tooltips.it.resx @@ -577,7 +577,7 @@ I fotogrammi con luminosità media al massimo pari a questa quota del bianco contano come notturni (campi stellari, preset notturni) · Invio applica, Esc annulla Apri la cartella dati in Esplora file Quando Chronos è ridotto a icona o in secondo piano, schede inserite, attività finite e messaggi del server compaiono anche come notifiche di Windows - Versione, build, sistema, licenza, codice di terze parti, traduzione + Versione, build, sistema, licenza, codice di terze parti Modalità portatile, log, diagnostica, backup e ripristino del database, valori predefiniti Larghezza di analisi, soglie di notte e stelle, analisi profonda Cartella dell'archivio, modelli dei nomi, dimensione di proxy e miniature, riscansioni diff --git a/src/Chronos.App/About/UpdateFlow.cs b/src/Chronos.App/About/UpdateFlow.cs index 75b555b1..9a024b11 100644 --- a/src/Chronos.App/About/UpdateFlow.cs +++ b/src/Chronos.App/About/UpdateFlow.cs @@ -34,7 +34,7 @@ public sealed record UpdateHost( } /// -/// The update notice of About and Settings › Updates (BRIEF §18): checks the latest release, downloads and verifies the +/// The update notice of Settings › Updates (BRIEF §18): checks the latest release, downloads and verifies the /// package that upgrades this copy (: the setup, or the portable zip for a portable copy) /// and shows it in Explorer. Running it is left to the user because BRIEF §8.6 lets Chronos only open links and show /// files. A release without that package or without SHA256SUMS only opens its page; a capture run never touches diff --git a/src/Chronos.App/Infrastructure/DiagnosticsBundle.cs b/src/Chronos.App/Infrastructure/DiagnosticsBundle.cs index cf7fd000..aa6c3f5a 100644 --- a/src/Chronos.App/Infrastructure/DiagnosticsBundle.cs +++ b/src/Chronos.App/Infrastructure/DiagnosticsBundle.cs @@ -13,7 +13,7 @@ using Chronos.Data.Sqlite; namespace Chronos.App.Infrastructure; /// -/// The diagnostics bundle of About and Settings › Advanced (BRIEF §12.9, §22 Phase 8): an environment report, the codec +/// The diagnostics bundle of Settings › Advanced (BRIEF §12.8, §12.9, §22 Phase 8): an environment report, the codec /// and encoder inventory, the settings, the latest failed jobs and the log files, zipped into a folder the user chose. /// Everything passes through (the saved server token, passwords and keys never leave the /// PC) and no photo or archive file is ever included. diff --git a/src/Chronos.App/Sections/SettingsViewModel.cs b/src/Chronos.App/Sections/SettingsViewModel.cs index c6c8f056..f70eae3c 100644 --- a/src/Chronos.App/Sections/SettingsViewModel.cs +++ b/src/Chronos.App/Sections/SettingsViewModel.cs @@ -85,7 +85,9 @@ public sealed class SettingsViewModel : SectionViewModel new(SettingsPage.Updates, ["Settings.General.CheckOnStart", "Settings.Updates.Latest", "About.Update.Check", "About.Releases"]), new(SettingsPage.Advanced, ["Settings.Advanced.DataFolder", "Settings.Advanced.Logs", "Settings.Advanced.Diagnostics", "Settings.Advanced.Backup", "Settings.Advanced.Restore", "Settings.Advanced.Reset"]), - new(SettingsPage.About, ["Shell.AppName", "About.Build", "About.Runtime", "About.System", "About.Licence", "About.ThirdParty", "About.Translation"]), + // The translation row shows outside English only, and the language changes while Settings is open. + new(SettingsPage.About, () => ["Shell.AppName", "About.Build", "About.Runtime", "About.System", "About.Licence", "About.ThirdParty", + .. Shell.About.IsTranslated ? (string[])["About.Translation"] : []]), ]; _visiblePages = AllPages; diff --git a/src/Chronos.App/Settings/SettingsRows.cs b/src/Chronos.App/Settings/SettingsRows.cs index 50a76945..fc6eb728 100644 --- a/src/Chronos.App/Settings/SettingsRows.cs +++ b/src/Chronos.App/Settings/SettingsRows.cs @@ -29,9 +29,18 @@ public enum SettingsPage About, } -/// An entry of the section list: name, tooltip (what is inside) and the words the search matches. -public sealed class SettingsPageItem(SettingsPage page, string[] keywordKeys) : ObservableObject +/// +/// An entry of the section list: name, tooltip (what is inside) and the words the search matches. The words are read at +/// each search, so a row shown only in some languages (About's translation row) is found only while it shows. +/// +public sealed class SettingsPageItem(SettingsPage page, Func> keywordKeys) : ObservableObject { + /// An entry whose rows always show. + public SettingsPageItem(SettingsPage page, string[] keywordKeys) + : this(page, () => keywordKeys) + { + } + public SettingsPage Page { get; } = page; public string Label => Loc.L("Settings.Page." + Page); @@ -42,7 +51,7 @@ public sealed class SettingsPageItem(SettingsPage page, string[] keywordKeys) : public bool Matches(string text) => Label.Contains(text, StringComparison.CurrentCultureIgnoreCase) || ToolTip.Contains(text, StringComparison.CurrentCultureIgnoreCase) - || keywordKeys.Any(k => Loc.L(k).Contains(text, StringComparison.CurrentCultureIgnoreCase)); + || keywordKeys().Any(k => Loc.L(k).Contains(text, StringComparison.CurrentCultureIgnoreCase)); internal void Refresh() => OnAllPropertiesChanged(); } diff --git a/tests/Chronos.App.Tests/Settings/SettingsLogicTests.cs b/tests/Chronos.App.Tests/Settings/SettingsLogicTests.cs index 5d5b694b..97223f09 100644 --- a/tests/Chronos.App.Tests/Settings/SettingsLogicTests.cs +++ b/tests/Chronos.App.Tests/Settings/SettingsLogicTests.cs @@ -308,6 +308,18 @@ public sealed class SettingsLogicTests Assert.Equal(("Not supported", "—", "—", false), (none.TierText, none.DecoderText, none.NeedsText, none.HasNeeds)); } + [Test] + public void ASettingsPageIsFoundOnlyByTheRowsItShows() + { + // About's translation row shows outside English only: its keyword is read at each search, not once (owner review 2). + var shown = false; + var about = new SettingsPageItem(SettingsPage.About, () => shown ? ["About.Translation"] : []); + Assert.False(about.Matches(Loc.L("About.Translation")), "a hidden row does not match"); + shown = true; + Assert.True(about.Matches(Loc.L("About.Translation"))); + Assert.True(new SettingsPageItem(SettingsPage.About, ["About.Build"]).Matches(Loc.L("About.Build"))); + } + [Test] public void EnumDrivenKeysExistInEveryRequiredLanguage() { diff --git a/tests/Chronos.App.Tests/Settings/SettingsScreenSmokeTests.cs b/tests/Chronos.App.Tests/Settings/SettingsScreenSmokeTests.cs index 3156d914..08b64790 100644 --- a/tests/Chronos.App.Tests/Settings/SettingsScreenSmokeTests.cs +++ b/tests/Chronos.App.Tests/Settings/SettingsScreenSmokeTests.cs @@ -361,6 +361,8 @@ public sealed class SettingsScreenSmokeTests Assert.Contains(settings.VisiblePages, p => p.Page == SettingsPage.About); settings.SearchText = Loc.L("About.Releases"); Assert.Contains(settings.VisiblePages, p => p.Page == SettingsPage.Updates); + settings.SearchText = Loc.L("About.Translation"); + Assert.False(settings.VisiblePages.Any(p => p.Page == SettingsPage.About), "the hidden translation row does not match"); settings.SearchText = string.Empty; });