fix(app): find Settings › About by its translation row only when it shows
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 <noreply@anthropic.com>
This commit is contained in:
1 parent
a34b33d50b
commit
bb065c7836
8 files changed
+33
-8
No files matched your search
@@ -34,7 +34,7 @@ public sealed record UpdateHost(
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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 (<see cref="UpdateDownload"/>: 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 <c>SHA256SUMS</c> only opens its page; a capture run never touches
|
||||
|
||||
@@ -13,7 +13,7 @@ using Chronos.Data.Sqlite;
|
||||
namespace Chronos.App.Infrastructure;
|
||||
|
||||
/// <summary>
|
||||
/// 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 <see cref="SecretScrubber"/> (the saved server token, passwords and keys never leave the
|
||||
/// PC) and no photo or archive file is ever included.
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -29,9 +29,18 @@ public enum SettingsPage
|
||||
About,
|
||||
}
|
||||
|
||||
/// <summary>An entry of the section list: name, tooltip (what is inside) and the words the search matches.</summary>
|
||||
public sealed class SettingsPageItem(SettingsPage page, string[] keywordKeys) : ObservableObject
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
public sealed class SettingsPageItem(SettingsPage page, Func<IEnumerable<string>> keywordKeys) : ObservableObject
|
||||
{
|
||||
/// <summary>An entry whose rows always show.</summary>
|
||||
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();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user