Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ leading and trailing pipe. Columns, in order:
| migration-consent-locking | authoritative | InnoMigrationConsentStore | protected consent publication and inspection while source is running | MigrationOperationLock + InnoMigrationConsentStore | consent uses a shared preparation lease and a separate exclusive writer lock | consent remains compatible with Inno runtime readers but cannot overlap exclusive Store mutation; finalization removes the writer lock before deleting the completion receipt | InnoMigrationConsentStoreTests.RuntimeReadLease_AllowsExplicitGrantAndInspection | behavioral | - |
| chat-markdown-presentation | authoritative | src/OpenClaw.Tray.WinUI/Chat/ReactorChatTimeline.cs | paragraph and heading typography, literal code-frame presentation and Copy | ChatMarkdownPresentation | timeline keeps sanitization, parser flags and inert links/images; Reactor owns default list wrapping | presentation uses public MarkdownOptions callbacks; code content is never truncated or parsed as markup | ReactorChatLayoutProofTests.CodeBlock_PreservesLiteralContentAndCopiesExactText | behavioral | - |
| chat-markdown-disclosures | authoritative | src/OpenClaw.Tray.WinUI/Chat/ReactorChatTimeline.cs | allowlisted Markdown disclosure parsing and native expansion state | ChatMarkdownDisclosures + ChatMarkdownPresentation | timeline sanitizes before parsing; disclosure bodies use the existing safe Markdown renderer | only balanced, allowlisted block wrappers become native Expanders; unsupported wrappers remain inert Markdown; a reader-toggled header is the timeline's scroll anchor, so details grow downward inside tall messages | ChatMarkdownDisclosureTests.CommonWrappers_KeepBodyMarkdownAndSurroundingOrder | behavioral | - |
| chat-markdown-selection-integration | authoritative | src/OpenClaw.Tray.WinUI/Chat/ReactorChatTimeline.cs | per-message selection opt-in, custom disclosure/code surfaces and localized copy-result feedback | ChatMarkdownMessageView + ChatMarkdownPresentation | Microsoft.UI.Reactor.Markdown owns selection document, geometry, input, scrolling, clipboard write and UI Automation | one Scope shares options across all Markdown fragments; collapsed bodies and chrome are excluded; OnCopyResult never writes clipboard | ReactorChatMarkdownContractTests.MarkdownSelection_UsesOneReactorScopeAndFeedbackOnlyCopyResults | source-shape | when native message-boundary and copy-result acceptance fully replaces the integration source guard |
| chat-markdown-selection-integration | closed | src/OpenClaw.Tray.WinUI/Chat/ReactorChatTimeline.cs | Reactor MarkdownTextSelection cross-block scope, ChatMarkdownMessageView and selection copy-result feedback | native per-block text selection in ReactorChatTimeline + ChatMarkdownPresentation | text, code, table and list blocks stay individually selectable; Copy buttons keep their own feedback | interim mitigation does not provide cross-block selection or click-out deselection parity; upstream fixes and matched long-chat latency/frame-time proof are pending | ReactorChatMarkdownContractTests.ChatMarkdown_DoesNotUseReactorCrossBlockSelection | source-shape | after upstream fixes are released and downstream selection parity and performance are verified |
| reactor-markdown-list-layout | closed | src/OpenClaw.Tray.WinUI/Chat/ReactorChatTimeline.cs | preview.12 ListItem layout replacement and StackElement shape assumption | Microsoft.UI.Reactor.Advanced default Markdown list layout (preview.16, upstream #1197) | timeline keeps sanitizer, parser safety and block presentation callbacks | ordered/unordered, nested and loose list content wraps in an Auto/Star Grid without an application-side ListItem override | ReactorChatMarkdownContractTests.AssistantMessages_UseSanitizedGitHubFlavoredMarkdown | source-shape | when upstream Markdown list layout is replaced |
| chat-model-picker-presentation | authoritative | src/OpenClaw.Tray.WinUI/Chat/ReactorChatComposer.cs, then custom Button rows in ChatModelPicker | catalog search, provider groups, native row interaction states and model metadata presentation | NativeChatModelPicker through a generated Reactor wrapper | ChatModelPicker owns flyout lifetime; composer controller owns model mutation and authorization | native single-selection navigation never writes a model until explicit activation; filtering and resizing preserve raw provider-qualified identities | ReactorChatLayoutProofTests.ModelMenu_UsesNativeSelectionStatesAndPreservesNavigationDuringResize | behavioral | - |
| chat-model-picker-button-rows-closed | closed | src/OpenClaw.Tray.WinUI/Chat/ChatModelPicker.cs | hand-built Button rows, custom selected fill/checkmark and search-box styling | NativeChatModelPicker | declarative trigger and flyout lifetime only | native AutoSuggestBox/ListView own search and row interaction visuals; no duplicate hand-styled selection path | ReactorChatLayoutProofTests.ModelMenu_UsesNativeSelectionStatesAndPreservesNavigationDuringResize | behavioral | - |
Expand Down
24 changes: 9 additions & 15 deletions docs/CHAT_VISUAL_DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -1361,21 +1361,15 @@ same resources and bounded layouts. Markdown sanitization, disabled HTML,
inert images, list measurement, timeline keys and scroll-follow remain with
their existing owners.

Assistant Markdown opts into one Reactor text-selection scope per message,
spanning paragraphs, headings, list content, tables, code and expanded
disclosures. Reactor owns pointer and keyboard selection, geometry, scrolling
and the UI Automation text provider. Neighboring message rows, code toolbar
labels and buttons, and collapsed disclosure bodies are outside the selected
document. OpenClaw registers the summary once and supplies disclosure visibility;
it does not infer selectable text from Reactor's layout tree.

Selection copy has one clipboard writer in Reactor. Its `OnCopyResult` callback
only updates native localized Copied or Copy failed feedback outside the
selection scope. Feedback resets after two seconds; content replacement and
unmount fence stale callbacks and timers. The separate whole-message and code
Copy buttons retain their existing clipboard and feedback paths. Native
acceptance for cross-block selection and recycling is required in addition to
the mounted typography and layout checks.
Assistant Markdown text, code and table blocks are individually selectable with
native WinUI text selection. Reactor preview.18's `MarkdownTextSelection` is
not used as an interim mitigation while upstream fixes and matched long-chat
typing and streaming latency/frame-time proof are pending.
This does not provide cross-block selection or click-out deselection parity.
Restore those behaviors in a separate downstream change only after the fixed
Reactor package is released and selection parity and performance are verified.
The whole-message and code Copy buttons keep their own clipboard and feedback
paths.

Assistant Markdown accepts balanced, block-level `<details>` wrappers with a
nonempty `<summary>` as an OpenClaw extension. The summary may follow the
Expand Down
26 changes: 0 additions & 26 deletions docs/GATEWAY_FIXTURE_TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,32 +343,6 @@ as well. That option enables only its own child and still rejects failed,
skipped, and zero-test runs. The ordinary UI filter continues to exclude those
keyboard-only cases; `-NativeInputProof` does not select them.

`MarkdownSelection_CopiesAcrossBlocksAndExcludesCollapsedAndNeighboringContent`
uses synthetic history in the shipped app to select and copy across paragraphs,
lists, code, a table and a native collapsed details block. It checks exact
normalized clipboard text, excludes adjacent messages and collapsed body text,
switches to a second conversation and back to verify that copying from the
focused message cannot leak another conversation's text, and exercises edge
scrolling in the production chat ItemsView. Returning to the same message may
retain its own selection. The disclosure is scrolled into view before its
expanded body is checked. This case uses native pointer, keyboard and clipboard
input, so run it only on an authorized, exclusive interactive desktop:

```powershell
$env:OPENCLAW_RUN_GATEWAY_FIXTURE_UI = '1'
$env:OPENCLAW_GATEWAY_FIXTURE_APP = (Resolve-Path $app).Path
$env:OPENCLAW_GATEWAY_FIXTURE_ARTIFACTS = Join-Path $env:TEMP 'openclaw-markdown-selection'
$env:OPENCLAW_GATEWAY_FIXTURE_SCREENSHOTS = '1'
dotnet test .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj `
-p:Platform=ARM64 -r win-arm64 `
--filter 'FullyQualifiedName~MarkdownSelection_CopiesAcrossBlocksAndExcludesCollapsedAndNeighboringContent' `
--logger 'console;verbosity=normal'
```

The test captures only its owned app window. The fixture Gateway and profile are
synthetic and disposable; this is not live Gateway, provider, or installed-app
proof.

### Saved Gateway ownership and released profiles

`GatewayManagement_UsesSavedOwnershipWithoutSetupState` renders native-only,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public SetupStepTimeline()
row.PointerExited += Row_PointerExited;
row.PointerCanceled += Row_PointerExited;
row.PointerCaptureLost += Row_PointerExited;
row.SizeChanged += (_, _) => PositionConnectors();
}
Rows.LayoutUpdated += (_, _) => PositionConnectors();
Loaded += OnLoaded;
Unloaded += OnUnloaded;
}
Expand Down
24 changes: 17 additions & 7 deletions src/OpenClaw.Tray.WinUI/Chat/ChatHistoryNavigation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ internal sealed record ChatHistoryAnchor(int RowIndex, string Key, string Sender
internal sealed class ChatHistoryNavigation(ItemsView itemsView, Action<ChatHistoryAnchor> navigate) : IDisposable
{
private AnnotatedScrollBar? _bar;
private Grid? _labelsGrid;
private IReadOnlyList<ChatHistoryAnchor> _anchors = [];
private IReadOnlyList<ChatHistoryAnchor> _ticks = [];
private int _navigationVersion;
Expand Down Expand Up @@ -70,6 +71,7 @@ public void SetScrollBar(AnnotatedScrollBar? bar)
_bar.Labels.Clear();
}
_bar = bar;
_labelsGrid = null;
_presenterCount = -1;
_firstPresenter = null;
_hoveredKey = null;
Expand Down Expand Up @@ -218,6 +220,7 @@ private void OnPointerExited(object sender, PointerRoutedEventArgs args)
private void OnUnloaded(object sender, RoutedEventArgs args)
{
CancelVisualUpdate();
_labelsGrid = null;
_presenterCount = -1;
_firstPresenter = null;
}
Expand All @@ -229,7 +232,7 @@ private void OnLayoutUpdated(object? sender, object args)
|| (_bar?.XamlRoot?.RasterizationScale ?? 1) != _scale)
Refresh();
else if (labels is not null && (labels.Children.Count != _presenterCount
|| !ReferenceEquals(labels.Children.FirstOrDefault(), _firstPresenter)))
|| (_presenterCount > 0 && !ReferenceEquals(labels.Children[0], _firstPresenter))))
QueueVisualUpdate();
}

Expand All @@ -254,7 +257,8 @@ private void CancelVisualUpdate()
_visualUpdateQueued = false;
}

private Grid? GetLabelsGrid() => GetTemplatePart<Grid>("PART_LabelsGrid");
private Grid? GetLabelsGrid() => _labelsGrid is { IsLoaded: true } labels
? labels : _labelsGrid = GetTemplatePart<Grid>("PART_LabelsGrid");

private T? GetTemplatePart<T>(string name) where T : FrameworkElement =>
_bar is not null && VisualTreeHelper.GetChildrenCount(_bar) > 0
Expand All @@ -266,17 +270,23 @@ private void CollectVisibleRows()
_visibleRows.Clear();
if (itemsView.ScrollView is not { Content: ItemsRepeater repeater } scroll)
return;
for (var index = 0; index < VisualTreeHelper.GetChildrenCount(repeater); index++)
// The repeater is the scroller's content and each realized container is its
// direct child. Reuse its scroll-space transform for all row layout positions.
var transform = repeater.TransformToVisual(scroll);
var viewportHeight = scroll.ViewportHeight;
var count = VisualTreeHelper.GetChildrenCount(repeater);
for (var index = 0; index < count; index++)
{
if (VisualTreeHelper.GetChild(repeater, index) is not FrameworkElement
{ IsLoaded: true, ActualHeight: > 0 } element)
continue;
var rowIndex = repeater.GetElementIndex(element);
if (rowIndex < 0)
continue;
var bounds = element.TransformToVisual(scroll).TransformBounds(
new global::Windows.Foundation.Rect(0, 0, element.ActualWidth, element.ActualHeight));
if (bounds.Bottom > 0 && bounds.Top < scroll.ViewportHeight)
var offset = element.ActualOffset;
var bounds = transform.TransformBounds(
new global::Windows.Foundation.Rect(offset.X, offset.Y, element.ActualWidth, element.ActualHeight));
if (bounds.Bottom > 0 && bounds.Top < viewportHeight)
_visibleRows.Add(rowIndex);
}
}
Expand Down Expand Up @@ -327,7 +337,7 @@ private void UpdateVisuals()
distance == 0 ? "Highlighted" : _visibleRows.Contains(anchor.RowIndex) ? "Visible" : "Quiet", false);
}
_presenterCount = ready ? labels.Children.Count : -1;
_firstPresenter = ready ? labels.Children.FirstOrDefault() : null;
_firstPresenter = ready && _presenterCount > 0 ? labels.Children[0] : null;
}

private void OnScrolling(AnnotatedScrollBar sender, AnnotatedScrollBarScrollingEventArgs args)
Expand Down
107 changes: 0 additions & 107 deletions src/OpenClaw.Tray.WinUI/Chat/ChatMarkdownMessageView.cs

This file was deleted.

Loading
Loading