diff --git a/.gitignore b/.gitignore index c50ced5..5d07cc3 100644 --- a/.gitignore +++ b/.gitignore @@ -6,9 +6,9 @@ Publish/ # publish-winapp output on case-sensitive systems *.user .vs/ -# Local development assets +# AI 協作素材不入 git For_AI/ -# CAD samples are stored locally in For_AI/ +# 客戶 CAD 料號檔不入 git(避免外流);測試模型放 For_AI/ *.stp *.step diff --git a/src/STPViewer/AboutDialog.xaml b/src/STPViewer/AboutDialog.xaml index e257666..3568ae4 100644 --- a/src/STPViewer/AboutDialog.xaml +++ b/src/STPViewer/AboutDialog.xaml @@ -35,7 +35,7 @@ - + @@ -78,7 +78,7 @@ - + -/// The About window shows application information on the left and release history on the right. -/// Add each new release at the start of Changelog. +/// 關於視窗:左 = 程式資訊 / 開發者 / 技術棧,右 = 版本紀錄(寫給一般使用者看,非技術 changelog)。 +/// 樣式參考 ETTerms 的 AboutView。發新版時在 Changelog 陣列最上面加一筆。 /// public partial class AboutDialog : Window { @@ -26,7 +26,7 @@ public partial class AboutDialog : Window private record ChangelogEntry(string Version, DateOnly Date, string Title, string[] Changes); - // Release history shown to users, newest first. + // ── 版本紀錄(新版加最上面;口吻:一般使用者看得懂,講「你會感覺到什麼」而非實作細節)── private static readonly ChangelogEntry[] Changelog = { new("0.7.1", new DateOnly(2026, 7, 12), "Ui.About.Release071.Title", diff --git a/src/STPViewer/App.xaml.cs b/src/STPViewer/App.xaml.cs index 2f087bb..8a4cfff 100644 --- a/src/STPViewer/App.xaml.cs +++ b/src/STPViewer/App.xaml.cs @@ -8,8 +8,8 @@ using STPViewer.Services; namespace STPViewer; /// -/// Log unhandled UI and background exceptions to -/// %LOCALAPPDATA%\STPViewer\error.log and show a message for UI errors. +/// 全域例外處理:UI 執行緒未攔截例外 → 記 log + 訊息框後盡量存活(不閃退); +/// 背景 Task / 非 UI 執行緒例外 → 記 log。log 位於 %LOCALAPPDATA%\STPViewer\error.log。 /// public partial class App : Application { @@ -22,7 +22,8 @@ public partial class App : Application LocalizationService.Instance.SetLanguage(SettingsService.Load().Language); base.OnStartup(e); - // Report UI exceptions and keep the window open. + // UI 執行緒(含 async void 回拋)的未攔截例外:記 log、提示、標記 Handled 讓程式存活。 + // 若後續狀態已壞使用者可自行重啟;至少量測結果 / 已載模型不會直接蒸發。 DispatcherUnhandledException += (_, args) => { LogException("DispatcherUnhandledException", args.Exception); @@ -32,14 +33,14 @@ public partial class App : Application args.Handled = true; }; - // Log unobserved task exceptions. + // 沒被 await 的背景 Task 例外(finalizer 階段才浮出):記 log 並標記已觀察,避免行程終止 TaskScheduler.UnobservedTaskException += (_, args) => { LogException("UnobservedTaskException", args.Exception); args.SetObserved(); }; - // Log fatal exceptions on non-UI threads. + // 其他非 UI 執行緒的致命例外:無法阻止終止,但至少留下記錄 AppDomain.CurrentDomain.UnhandledException += (_, args) => LogException("AppDomainUnhandledException", args.ExceptionObject as Exception); } diff --git a/src/STPViewer/Converters/EnumToBoolConverter.cs b/src/STPViewer/Converters/EnumToBoolConverter.cs index b830c59..00e0f06 100644 --- a/src/STPViewer/Converters/EnumToBoolConverter.cs +++ b/src/STPViewer/Converters/EnumToBoolConverter.cs @@ -6,8 +6,8 @@ using STPViewer.Models; namespace STPViewer.Converters; /// -/// Convert MeasureMode to ToggleButton.IsChecked using the mode name -/// in ConverterParameter. Unchecking returns to None. +/// MeasureMode ↔ ToggleButton.IsChecked。 +/// ConverterParameter 為模式名稱字串;取消勾選時回到 None。 /// public class EnumToBoolConverter : IValueConverter { diff --git a/src/STPViewer/Converters/FileNameConverter.cs b/src/STPViewer/Converters/FileNameConverter.cs index 3b0461a..924ea12 100644 --- a/src/STPViewer/Converters/FileNameConverter.cs +++ b/src/STPViewer/Converters/FileNameConverter.cs @@ -4,7 +4,7 @@ using System.Windows.Data; namespace STPViewer.Converters; -/// Show file names in the recent-files menu while retaining full paths as tooltips. +/// 完整路徑 → 檔名(選單「最近檔案」顯示用;tooltip 仍給完整路徑) public class FileNameConverter : IValueConverter { public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) => diff --git a/src/STPViewer/MainWindow.xaml b/src/STPViewer/MainWindow.xaml index 4b981b8..39d2058 100644 --- a/src/STPViewer/MainWindow.xaml +++ b/src/STPViewer/MainWindow.xaml @@ -28,7 +28,7 @@ - + - +