5 Commits
Author SHA1 Message Date
poli0981andClaude Opus 5.5 f7bbe53f96 feat(ui)!: Fluent redesign with WPF-UI 4.3
The app now follows Windows 11: Mica window with its own title bar, a
navigation pane, in-window dialogs, snackbars and the system accent color.
MaterialDesignThemes is gone.

- Shell: resizable FluentWindow (min 960x600) that remembers its size,
  position and maximized state. The title bar has a command search box
  (Ctrl+K), an admin-session indicator with "End admin session", and a More
  menu. The pane has Home, Favorites, History, Recipes, My commands and the
  catalog with its twelve categories and counts; the selection stays in sync
  with the view-model through NavigationKey.
- MainViewModel keeps the shell only; the catalog's browsing, filters,
  detail and run logic moved to CatalogViewModel. The catalog gets risk and
  admin-only filter chips, the estimated duration and an expanded command
  line in the detail panel, and a splitter between detail and console.
- One shared console for catalog, recipes and user commands: virtualized,
  batched, capped at 10,000 lines with a "N earlier lines" note, Copy all,
  Save to file, "Waiting for administrator permission…" status and Restart
  now (asks first, never while a command runs).
- Confirmation, update and bug-report dialogs are Fluent content dialogs;
  Cancel stays the default and Run appears for a Dangerous command only
  once its name or id is typed. The Legal Gate, terms viewer, crash dialog
  and command palette are Fluent windows; the Legal Gate lets you pick the
  language first.
- Theme: light, dark or system through ApplicationThemeManager, accent from
  Windows, High Contrast always wins. Font size scales every text and
  control live. Pages set the theme text color themselves (the navigation
  frame doesn't pass it down), and list text dims instead of recoloring so
  it stays readable on a selected row; search matches are bold and
  underlined.
- A finished run notifies with a snackbar (and flashes the taskbar button)
  when the console isn't visible; the taskbar shows progress while running.
- Catalog icons map to Fluent System Icons (IconMap), checked by a test.
- The presentation namespace is now CommandForge.Desktop: a namespace named
  CommandForge.Wpf hid WPF-UI's root namespace in XAML-generated code. The
  project, assembly and exe keep the name CommandForge.Wpf.
- IElevationService raises SessionChanged when the elevated helper starts or
  stops.
- Strings: about 45 new keys in all five languages; twelve unused keys
  removed. A test now scans the UI sources so every key the XAML or code
  uses must exist in every language.

BREAKING CHANGE: new look and layout; settings, history, recipes and user
commands carry over unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 22:26:42 +07:00
poli0981andClaude Opus 5.5 f781690b5f test: cover decoding, path resolution, elevation environment, storage
New tests for the output decoder (UTF-8, UTF-16LE with and without BOM,
OEM fallback, chunk boundaries), executable resolution, argument tokens,
the elevated child environment (including a real PowerShell run showing
it loads modules only from admin-only folders), crash-safe JSON files and
v1.5.1 settings, accent-insensitive search, recipe confirmations, the
update dialog, the console buffer and crash codes.

Run faults and cancellation must complete the output channel; elevation
tests have time limits; the DI test uses a scratch folder instead of the
real %AppData%; culture-switching tests run on their own; Domain and
Application may reference only the runtime (and Domain).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 21:21:25 +07:00
poli0981andClaude Opus 4.8 a941710b29 feat(i18n): add Simplified Chinese (zh-Hans) and Spanish (es) UI languages
Adds two new UI languages, bringing the total to five (EN/VI/JA/zh-Hans/es).
Both new translations are machine-translated and flagged for native review,
matching how Japanese was introduced.

- Strings.zh-Hans.resx + Strings.es.resx: full parity with EN (501 keys),
  built by transforming the English resx so every key is present (no fallback).
- SettingsViewModel: add 简体中文 and Español language options.
- MainWindow.xaml: add the two View > Language menu items.
- ISettingsService: document the new culture codes.
- ResxKeyTests: assert key parity across all satellite cultures
  (vi/ja/zh-Hans/es), driven by a single SatelliteCultures list.
- LocalizationManagerTests: theory asserting each satellite actually loads
  (a translated string, not an English fallback) via the live-switch path.

Translations: machine-generated; recommend native-speaker review before GA.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 22:58:08 +07:00
poli0981andClaude Opus 4.8 adb898702b Phase 5a fixes: "System default" language revert + dark-mode contrast
- Language: "System default" now reverts to the OS culture. SetCulture had
  overwritten CultureInfo.CurrentUICulture, so "follow OS" resolved to the
  last-picked language. LocalizationManager captures the OS culture once
  (SystemCulture) and uses it for the follow-OS option (+ test).
- Dark-mode contrast:
  - Console / command-preview boxes used MaterialDesignTextFieldBoxBackground,
    which renders light in dark mode (shadowed by MaterialDesign2.Defaults, not
    refreshed by runtime SetTheme) -> light text on light box. Switched to
    MaterialDesignToolBarBackground, which follows the theme.
  - "Confirm before Dangerous" was IsEnabled=False (dimmed to near-unreadable in
    dark mode); now non-interactive (IsHitTestVisible/Focusable=False) at full
    contrast with a lock icon.
  - Danger badge text White -> near-black for AA contrast on the badge.

Verified by launching in Dark mode and capturing the console + Settings; 59 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 12:38:56 +07:00
poli0981andClaude Opus 4.8 d49531385a Phase 5a: Settings screen, runtime theme/font/language, in-shell navigation
Foundation slice of Phase 5 (polish):
- Settings model: AppTheme/FontScale enums + 9 new ISettingsService settings
  (theme, language, font size, sidebar/badges, confirm-caution, restore point,
  auto-scroll, warn-on-cancel), persisted to config.json (string enums).
- Runtime i18n, no restart: LocalizationManager (INotifyPropertyChanged indexer) +
  LocExtension now returns a live Binding, so {res:Loc} flips language instantly;
  catalog display strings refresh in place on culture change.
- ThemeService (Light/Dark/System via MaterialDesign PaletteHelper, tracks OS) and
  FontScaleService (AppFontSize DynamicResource); applied at startup from settings.
- In-shell navigation: MainWindow content swaps between CatalogView (extracted) and
  a new SettingsView via CurrentSection; opened by the sidebar gear / View menu / Ctrl+,.
- Settings screen: Appearance (live theme/lang/font + sidebar/badges), Behavior &
  Safety (Dangerous-confirm locked on), Updates (auto-check + Check now + version),
  About (version, GPLv3/GitHub links, "no data collected"). EN/VI strings + a11y names.
- Consumption: confirmation honors ConfirmCaution (Dangerous always confirms); restore
  point, auto-scroll, warn-on-cancel, sidebar-collapse and badges read the settings.

Tests: settings round-trip + defaults, LocalizationManager culture flip, Settings UI
key coverage EN/VI. 58 tests pass; 0-warning Release build; clean startup smoke.

Diagnostics (Log Viewer/Debug/crash handler) are 5b; Home/favorites/full a11y are 5c.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 00:07:37 +07:00