• refactor: extract ChatOverlayLayer — real component decomposition, Commit G

    gramps released this 2026-08-31 17:48:10 +00:00

    The first true decomposition of the 4105-line god-object, not another partial
    shuffle. MainViewModel.Chat.cs 194 -> 44 lines of thin delegation; all chat
    behavior now lives in a self-contained Services/ChatOverlayLayer.cs (199):

    • Owns the message buffer (Messages), ChatBoxRenderer, fade + mock-preview
      timers, per-source preview renders, and the live-output RenderFrame path.
    • The VM keeps only the binding surface: ChatMessages delegates to
      _chatLayer.Messages (so XAML ItemsSource + LeftPanel CollectionChanged hold),
      CanAddYouTubeChat / ShowChatInactiveMessage stay computed on the VM
      (OnPropertyChanged raised from VM setters + XAML-bound), and thin forwards.
    • Scenes handed in as args (no Func seam), so the layer owns no scene graph.

    An AI reading ChatOverlayLayer.cs now sees the entire chat feature in one
    self-contained unit. Zero behavior change; build 0 warnings; 246 pass, only the
    2 known failures. Docs: ViewModels/index.md tracker updated in same commit.

    Downloads