Skip to content

Component: Smrt.Chat.UI.WinUI3

Canonical source: SmrtApps/src/Smrt.Chat.UI.WinUI3/README.md (mirrored below)


Smrt.Chat.UI.WinUI3

Overview & Responsibilities

  • Reusable WinUI 3 chat UI surfaces shared by SmrtHub host apps (primary consumers: SmrtChat and HubWindow).
  • Provides embeddable controls (starting with ChatView) and wiring points for hosts to connect chat actions.
  • UI-only: does not own config/state/secrets persistence.

Non-Responsibilities

  • No provider onboarding/credential entry UI (that lives in Settings + CloudProviders UI).
  • No vendor SDK calls and no direct HTTP to provider APIs.
  • No transcript persistence (host apps and Smrt.Chat.Core enforce metadata-only storage).

Configuration

  • This component does not define or persist configuration.
  • Host apps (e.g., SmrtChat, HubWindow) own config/state via Smrt.Config and related stores.

Operational Data (Paths)

  • This component does not write logs/config/state directly.
  • Host apps own operational data paths and must follow README.Files/System/Policies/SmrtHub-Operational-Data-Policy-v1.0.README.md.

Observability & Logging

  • UI surfaces should remain safe-by-default: never log secrets and never log or persist transcript content.
  • Host apps may log UI-safe events via SmrtHub.Logging using their own component slug.

Support Bundle

  • This component does not directly emit support bundles.
  • Host apps should rely on the platform Support Bundle tooling to include their logs and diagnostics.

Current State

  • ChatView supports an in-memory transcript UX (message entry + rendering).
  • Transcript UX is enabled by the host calling ChatView.ConfigureTranscriptRuntime(...) and providing:
    • provider config/state loaders
    • a chat state store (metadata only)
    • an IChatCompletionExecutor implementation
    • optional constraints provider (preferred vendors/profile, vision)
  • ChatView still exposes metadata-only action verbs (create session, list sessions, open settings, refresh provider status) via host-provided event handlers.
  • Transcript content is not persisted by this component.

Integration readiness

  • ChatView and ChatWindow are designed to run concurrently in the same process.
    • The transcript state is held per-instance (per ViewModel) in memory.
    • See unit tests: SmrtApps/src/Smrt.Chat.UI.WinUI3.Tests/.
  • Provider readiness and failure categories are surfaced via InfoBar guidance (no popups for core status):
    • Not configured → directs user to Settings → Providers.
    • Not authorized → directs user to Settings → Providers and re-run connection tests.
  • Privacy posture:
    • This UI does not persist transcript content (prompts/responses).
    • This UI avoids displaying raw exception details by default; hosts should also avoid logging transcript content.

Theming and DPI validation

  • This component follows the shared theming resources from Smrt.UI.
  • Manual validation checklist (recommended when making XAML changes):
    • Light/Dark + High Contrast mode rendering is readable and uses theme resources.
    • Per-monitor DPI scaling does not clip controls and preserves spacing at common scales (100%, 150%, 200%).
    • Keyboard focus visuals remain visible and consistent.

Key Integrations

  • Smrt.UI provides theming resources; consuming apps should merge Smrt.UI dictionaries at startup.
  • SmrtHub.Logging is available for UI-safe logging (avoid secrets and transcript content).

Testing & Validation

  • Build: dotnet build SmrtApps/src/Smrt.Chat.UI.WinUI3/Smrt.Chat.UI.WinUI3.csproj -c Debug -r win-x64
  • Run C# tests via repo scripts under Tools/Run-Tests/.
  • Unit tests: SmrtApps/src/Smrt.Chat.UI.WinUI3.Tests/

Policy References

  • Documentation: README.Files/System/Policies/SmrtHub-Documentation-Policy-v1.0.README.md
  • UI theming: README.Files/System/Policies/SmrtHub-UI-Theming-Policy.README.md
  • WinUI3 DPI discipline: README.Files/System/Policies/SmrtHub-WinUI3-DPI-Discipline.README.md
  • Privacy/security: README.Files/System/Policies/SmrtHub-Privacy-and-Security-Policy.README.md
  • Operational data: README.Files/System/Policies/SmrtHub-Operational-Data-Policy-v1.0.README.md
  • SmrtChat: SmrtApps/CSApps/SmrtChat/README.md
  • Chat UI plan: README.Files/SmrtHub-vNext-Architecture/Plans/Smrt.Chat.UI.WinUI3.plan.md