From a92120fb0d77d8049e4c71752fa969da72e1232f Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 3 Oct 2026 17:22:42 +0000 Subject: [PATCH] fix(app): shell follows RTL from startup; welcome keeps the keyboard; accessible dialogs and errors - The rail grows with the longest label (128-200 px); the first-run dialog disables the shell behind it and focuses its chosen option; toasts stay above it; F6 reaches the newest toast. - Confirm and login dialogs are named by their heading, focus the safe button, announce sign-in errors. - Error toasts say what happened only for catalog sentences (ErrorText); other details stay in the log. - Window title, queued-jobs text (plural) and the pause button name come from resources. - Logs, paths and templates in the client styles stay left to right. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC --- i18n/en/Shell.resx | 4 ++ i18n/it/Shell.it.resx | 4 ++ src/Titano.App/Infrastructure/UiLanguage.cs | 12 +++--- src/Titano.App/Shell/AppStyles.xaml | 24 +++--------- src/Titano.App/Shell/ConfirmDialog.xaml | 11 ++++-- src/Titano.App/Shell/ConfirmDialog.xaml.cs | 6 ++- src/Titano.App/Shell/ErrorText.cs | 37 +++++++++++++++++++ src/Titano.App/Shell/LoginDialog.xaml | 4 +- src/Titano.App/Shell/LoginDialog.xaml.cs | 8 +++- src/Titano.App/Shell/MainWindow.xaml | 36 +++++++++++++----- src/Titano.App/Shell/MainWindow.xaml.cs | 41 +++++++++++++++++++-- src/Titano.App/Shell/ShellViewModel.cs | 16 +++++--- 12 files changed, 150 insertions(+), 53 deletions(-) create mode 100644 src/Titano.App/Shell/ErrorText.cs diff --git a/i18n/en/Shell.resx b/i18n/en/Shell.resx index a2ff72aa..af382003 100644 --- a/i18n/en/Shell.resx +++ b/i18n/en/Shell.resx @@ -6,7 +6,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Titanoinvariant Ready + Pause job Ready · {0} jobs queued + Ready · {0} job queued{0} count + Ready · {0} jobs queued{0} count About Archive Import @@ -37,4 +40,5 @@ Connect to a server {0} on this network · {1} Welcome to Titano + {0} — {1}{0} program name; {1} screen title diff --git a/i18n/it/Shell.it.resx b/i18n/it/Shell.it.resx index 6da87848..cea2f212 100644 --- a/i18n/it/Shell.it.resx +++ b/i18n/it/Shell.it.resx @@ -5,7 +5,10 @@ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Pronto + Pausa attività Pronto · {0} attività in coda + Pronto · {0} attività in coda + Pronto · {0} attività in coda Informazioni Archivio Importa @@ -36,4 +39,5 @@ Connettiti a un server {0} in questa rete · {1} Benvenuto in Titano + {0} — {1} diff --git a/src/Titano.App/Infrastructure/UiLanguage.cs b/src/Titano.App/Infrastructure/UiLanguage.cs index e2a5f783..e13df355 100644 --- a/src/Titano.App/Infrastructure/UiLanguage.cs +++ b/src/Titano.App/Infrastructure/UiLanguage.cs @@ -1,10 +1,13 @@ using System.Globalization; -using System.Windows; using Titano.Core.Localization; namespace Titano.App.Infrastructure; -/// Switches the UI language at run time without restart (BRIEF §16), mirroring right-to-left languages. +/// +/// Switches the UI language at run time without restart (BRIEF §16). A takes +/// the language's direction when it is created and follows each switch, so right-to-left languages mirror windows +/// opened before and after this call alike. +/// public static class UiLanguage { /// Applies (or the OS language when null) and returns the culture in use. @@ -23,11 +26,6 @@ public static class UiLanguage CultureInfo.DefaultThreadCurrentUICulture = culture; CultureInfo.CurrentUICulture = culture; Loc.SetCulture(culture); - if (Application.Current is { } app) - { - foreach (Window window in app.Windows) - window.FlowDirection = Loc.IsRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight; - } return culture; } } diff --git a/src/Titano.App/Shell/AppStyles.xaml b/src/Titano.App/Shell/AppStyles.xaml index 9538252a..82913741 100644 --- a/src/Titano.App/Shell/AppStyles.xaml +++ b/src/Titano.App/Shell/AppStyles.xaml @@ -43,8 +43,9 @@ - + - - - - - diff --git a/src/Titano.App/Shell/ConfirmDialog.xaml b/src/Titano.App/Shell/ConfirmDialog.xaml index 934a8896..3e05b8cf 100644 --- a/src/Titano.App/Shell/ConfirmDialog.xaml +++ b/src/Titano.App/Shell/ConfirmDialog.xaml @@ -5,14 +5,17 @@ xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui" Title="{l:Loc Shell.AppName}" IsDialog="True" ResizeMode="NoResize" SizeToContent="Height" Width="460" - WindowStartupLocation="CenterOwner" ShowInTaskbar="False"> - + WindowStartupLocation="CenterOwner" ShowInTaskbar="False" + AutomationProperties.Name="{Binding Heading}" AutomationProperties.HelpText="{Binding Message}"> + - + @@ -20,7 +23,7 @@ AutomationProperties.Name="{Binding TypedPrompt}" TextChanged="OnTyped" /> -