Skip to content

Commit 3d3e9e5

Browse files
committed
fix(chat): preserve media contracts after cleanup
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1bf3409c-6c88-4d6c-b015-7e9cbf5e02da
1 parent b0cf4a0 commit 3d3e9e5

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

‎src/OpenClaw.Tray.WinUI/Chat/ChatTimelinePresentationContext.cs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using OpenClaw.Chat;
2+
using OpenClaw.Shared;
23

34
namespace OpenClawTray.Chat;
45

@@ -22,4 +23,6 @@ public sealed record ChatTimelinePresentationContext(
2223
Func<string, Task>? OnReadAloud = null,
2324
Action? OnStopSpeaking = null,
2425
int ScrollToBottomToken = 0,
25-
Action<string, string>? OnPermissionResponse = null);
26+
Action<string, string>? OnPermissionResponse = null,
27+
Func<string, ChatMediaContentInfo, CancellationToken, Task<AssistantMediaResolutionResult>>?
28+
ResolveAssistantMediaAsync = null);

‎tests/OpenClaw.Tray.Tests/ChatAssistantMediaRendererContractTests.cs‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,15 @@ public void ImageLoader_DoesNotRenderStateFromPreviousReference()
4444
StringComparison.Ordinal);
4545
}
4646

47-
[Theory]
48-
[InlineData("ReactorChatTimeline.cs")]
49-
[InlineData("OpenClawChatTimeline.cs")]
50-
public void LocalAttachmentRenderer_UsesBoundedSharedDecoder(string fileName)
47+
[Fact]
48+
public void LocalAttachmentRenderer_UsesBoundedSharedDecoder()
5149
{
5250
var source = File.ReadAllText(Path.Combine(
5351
TestRepositoryPaths.GetRepositoryRoot(),
5452
"src",
5553
"OpenClaw.Tray.WinUI",
5654
"Chat",
57-
fileName));
55+
"ReactorChatTimeline.cs"));
5856

5957
Assert.Contains(
6058
"ChatAttachmentBitmapDecoder.TryDecode(bytes)",

‎tests/OpenClaw.Tray.Tests/ChatUserBubbleTextContractTests.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ public void UserPromptText_RendersSelectableRichTextBlockParagraph()
1111
Assert.Contains("content.Add(Text(", timeline);
1212
Assert.Contains("messageText,", timeline);
1313
Assert.Contains(".Set(text => text.IsTextSelectionEnabled = true)", timeline);
14-
Assert.Contains(".AutomationName(entry.Text ?? string.Empty)", timeline);
14+
Assert.Contains("var accessibleText = BuildAccessibleUserText(messageText, attachments)", timeline);
15+
Assert.Contains(".AutomationName(accessibleText)", timeline);
1516
}
1617

1718
private static string Read(params string[] parts)

0 commit comments

Comments
 (0)