Skip to content

test(chat): add Reactor runtime coverage for timeline behavior #1115

Description

@calebeden

Context

PR #1110 removes the retired FunctionalUI chat root, timeline, composer, virtualization infrastructure, resources, and tests that exercised that unreachable implementation. Production ChatPage and ChatWindow already mount the Reactor chat surface.

That cleanup intentionally does not add a new Reactor test suite. Mixing a large legacy-code deletion with new Reactor runtime-test design would broaden the PR beyond its purpose, make review harder, and couple removal of unreachable code to separate decisions about supported Reactor behavior.

Problem

Reactor has unit and source-contract coverage for timeline composition, stable keys, tail-navigation policy, resource usage, and selectable text. It also has a runtime proof for grouped tool activity. It does not yet have equivalent live WinUI coverage for several user-facing timeline behaviors formerly exercised through the FunctionalUI host.

The deleted tests cannot be ported mechanically. Many assertions were specific to VirtualStack, ItemsRepeater, FunctionalUI control caches and reconciliation, deleted XAML style keys, or legacy settle-timer behavior. Reactor uses ItemsView, ReactorHostControl, and a different scroll controller and rendering model.

Proposed Reactor Runtime Coverage

Add focused tests that mount ReactorChatTimeline or OpenClawReactorChatRoot through ReactorHostControl on the real UI thread and verify supported user-facing invariants:

  1. A large timeline is scrollable and ItemsView realizes only a bounded subset of rows.
  2. Initial display starts at the newest message.
  3. Appended messages and in-place thinking or streaming growth remain bottom-followed when the user is already near the bottom.
  4. A user who scrolls up is not repinned while content continues streaming, and their reading position remains stable within a reasonable tolerance.
  5. Prepending older history preserves the reader's position; an explicit scroll-to-bottom request resumes following the newest message.
  6. Define the intended Reactor selection contract, then verify selectable message text and the boundaries around code and table content.
  7. Verify tool and compaction cards resolve current Reactor/Fluent theme resources at runtime without depending on removed FunctionalUI style keys.

Non-Goals

  • Recreate FunctionalUI VirtualStack cache-count assertions.
  • Test FunctionalUI reconciler effect pruning through deleted chat components.
  • Restore assertions for removed ChatToolCardBorderStyle or ChatCompactionCardStyle resources.
  • Preserve legacy settle-timer implementation details that Reactor does not use.
  • Make these tests a prerequisite for the focused dead-code removal in PR refactor(chat): remove the retired FunctionalUI chat surface #1110.

Acceptance Criteria

  • Tests exercise the real Reactor host and WinUI controls rather than inspecting source text.
  • Assertions describe observable behavior, not private implementation structure unless required to prove platform virtualization.
  • Timing and layout waits are bounded and deterministic enough to avoid recreating the legacy virtualization test flake.
  • Tests cover both bottom-follow and scrolled-up reading modes.
  • Tests run in an isolated UI-test environment and do not read or modify real user settings.
  • Documentation identifies the new Reactor proofs as the runtime coverage owner for these invariants.

Related: #1110

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions