openclaw-windows-node icon indicating copy to clipboard operation
openclaw-windows-node copied to clipboard

[deep-review] A7: RTL and HighContrast support entirely absent (FlowDirection and HighContrast appear 0 times)

Open codemonkeychris opened this issue 6 months ago • 1 comments

Summary

Grep across the entire codebase:

  • FlowDirection — 0 matches
  • HighContrast — 0 matches
  • CultureInfo.CurrentUICulture — 0 matches in OpenClaw.Tray.WinUI/
  • 5 locales declared in Strings/ (en-us, fr-fr, nl-nl, zh-cn, zh-tw) — none of these are RTL languages, so the gap may have been masked

This is an architectural absence, not a missing-string problem. RTL is not implementable without FlowDirection; HighContrast is not implementable without responding to the system high-contrast theme change.

Where

  • XAML pages: src/OpenClaw.Tray.WinUI/Pages/*.xaml, Windows/*.xaml
  • Theme helper: src/OpenClaw.Tray.WinUI/Helpers/ThemeHelper.cs (handles dark mode only, no HC awareness)
  • Localization helper: src/OpenClaw.Tray.WinUI/Helpers/LocalizationHelper.cs

Why it matters

RTL: If the product ships into ar-SA, he-IL, or fa-IR, every page that displays text from Resources.resw will flow LTR over RTL strings. Buttons aligned right will visually drift, mirrored chevrons will face the wrong way.

HighContrast: a user with the Windows High Contrast theme enabled sees an app that ignores the theme — custom backdrops, Mica, hard-coded colors don't respond. For users who rely on HC (low vision, photosensitive epilepsy), the app may be unusable.

This is a long-running gap. The right time to address it is before locale 6 (the first RTL locale) is added, because retrofitting RTL is much harder than designing for it.

Proposed fix

Two-phase:

  1. RTL plumbing (medium):

    • At app startup, read CultureInfo.CurrentUICulture and apply FlowDirection to the root content based on TextInfo.IsRightToLeft.
    • Audit all Padding / Margin that uses asymmetric L/R values; convert to MarginLikeRTL helpers or use Padding="0,8" symmetric where possible.
    • Audit chevron / arrow / sort indicator glyphs; mark FlowDirection.LeftToRight on icon paths so they don't mirror.
    • Add a smoke test that loads each page under ar-SA and renders without exceptions.
  2. HighContrast plumbing (small to medium):

    • Subscribe to AccessibilitySettings.HighContrastChanged.
    • Use ThemeResource references for every brush instead of StaticResource hex values.
    • Define HC-aware brush resources in App.xaml's ResourceDictionary.ThemeDictionaries for HighContrast.
    • Add a UI test that toggles HC and asserts pages render without invisible text.

Sister to A6 (accessibility broadly).

Severity

High — architectural omission; blocks adoption in any locale or for any user with high-contrast vision needs.

codemonkeychris avatar May 14 '26 00:05 codemonkeychris

Closing during the post-refactor deep-review cleanup. RTL/HighContrast support is accessibility debt, consolidated into #372 for a later focused accessibility pass. This keeps the signal while reducing stale one-off issue noise.

shanselman avatar May 18 '26 00:05 shanselman