You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4518dd8
Browse filesBrowse the repository at this point in the historyBrowse files
improve(chat): make prose and simple lists one selectable text block (#997)
* Render chat bubbles through per-message RichTextBlock for continuous selection
Chat prose was rendered as many separate TextBlocks, so a user could not drag-select text across paragraphs of one message. Add a poolable RichTextBlock primitive to the in-house FunctionalUI reconciler and route both assistant and user message text through one RichTextBlock per message (a Paragraph per block), giving each message a single continuous, selection-friendly text scope while keeping chat virtualizable.
- FunctionalUI: RichTextBlockElement record, RichTextBlock() factory, Set(Action<RichTextBlock>), reconciler arm, ConfigureRichTextBlock (leaves Blocks to the setter), ApplyModifiers case.
- ChatMarkdownRenderer: coalesce consecutive paragraph/heading blocks into one RichTextBlock; lone text blocks stay TextBlocks; lists/code/tables/etc stay separate selectable siblings. Structural block-run cache preserves active selection across re-renders independent of AST-cache eviction. Inert posture preserved (AppendInlines only).
- OpenClawChatTimeline: user bubble renders as a single-Paragraph RichTextBlock preserving font, foreground, wrap and SelectionHighlightColor.
- Tests: FunctionalUI primitive tests, renderer coalescing tests, updated user-bubble contract + virtualization proof text collection.
Co-authored-by: Copilot App <[email protected]>
* Coalesce simple lists into the selectable RichTextBlock
Extend the assistant-bubble text coalescing so simple (text-only,
possibly nested) bullet/ordered/task lists flow into the same per-message
RichTextBlock as surrounding prose, making paragraphs + headings + list
items one continuous drag-selection scope. Lists whose items carry a code
block, table, blockquote, thematic break, or raw block stay as their own
Grid-based selectable island (RenderList), preserving that chrome.
List items render as hanging-indent Paragraphs inside the shared
RichTextBlock: a per-item marker (task box, ordered number, bullet),
fixed hanging indent so wrapped lines / continuation paragraphs align at
the content column, per-level indentation for nesting, and heading
formatting preserved for heading list items.
Extend the selection-preservation cache (BlockEqual) with structural
ListEqual so the bounded AST cache evicting and re-parsing an unchanged
message does not force a Blocks rebuild that would wipe the active
selection.
Update MarkdownRendererCoalesceTests / MarkdownRendererListTests: simple
lists now assert RichTextBlock coalescing; the issue #636 Grid wrap
guards retarget to complex (blockquote-bearing) lists that still use the
Grid island path.
Co-authored-by: Copilot App <[email protected]>
* test(chat): prove selection-scope contract on the live WinUI renderer
Add a deterministic UI-thread proof that mounts the shipping
OpenClawChatTimeline through the real FunctionalUI reconciler and renders
one assistant message mixing prose paragraphs, a bullet list, a trailing
paragraph, a fenced code block, and a table. It asserts prose + list +
trailing coalesce into a single RichTextBlock (one continuous selection
scope) while the code block and table remain their own island TextBlocks.
This closes the record-level gap where headless WinRT could not activate
FontFamily for code/table islands, and serves as the automated stand-in
for the interactive native drag-select recording requested in review.
Co-authored-by: Copilot App <[email protected]>
---------
Co-authored-by: Copilot App <[email protected]>
0 commit comments