Skip to content
Merged
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: 2 additions & 0 deletions src/OpenClaw.Shared/SettingsData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public record class SettingsData
public float SttSilenceTimeout { get; set; } = 2.5f;
/// <summary>Enable TTS playback of responses during voice sessions.</summary>
public bool VoiceTtsEnabled { get; set; } = true;
/// <summary>Show tool-call and usage chips inline in the chat timeline.</summary>
public bool ShowChatToolCalls { get; set; } = true;
/// <summary>Play audio feedback chimes on listen start/stop.</summary>
public bool VoiceAudioFeedback { get; set; } = true;
public bool NodeTtsEnabled { get; set; } = false;
Expand Down
3 changes: 3 additions & 0 deletions src/OpenClaw.Tray.WinUI/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,9 @@ private async Task OnLaunchedAsync(LaunchActivatedEventArgs args)

// Initialize settings before update check so skip selections can be remembered.
_settings = new SettingsManager();
// Seed chat tool-call visibility from persisted settings so the timeline
// honors the Settings > Chat "Show tool calls and usage" toggle on launch.
OpenClawTray.Chat.OpenClawChatRoot.SetToolCallsVisible(_settings.ShowChatToolCalls);
_previousSettingsSnapshot = _settings.ToSettingsData().ToConnectionSnapshot();
_openTelemetryConnection = new OpenTelemetryEndpointConnection();
await _openTelemetryConnection.ApplyAsync(
Expand Down
4 changes: 3 additions & 1 deletion src/OpenClaw.Tray.WinUI/Chat/ChannelGroup.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
namespace OpenClawTray.Chat;

public record ChannelGroup(string AgentLabel, (string Id, string Title)[] Sessions);
public record ChannelGroup(
string AgentLabel,
(string Id, string Title, string? Model, string? ModelProvider)[] Sessions);
28 changes: 18 additions & 10 deletions src/OpenClaw.Tray.WinUI/Chat/OpenClawChatRoot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ public sealed class OpenClawChatRoot : Component
private static int s_toolCallsCollapseVersion;
private static event EventHandler? ToolCallsVisibilityChanged;

/// <summary>
/// Sets whether tool-call / usage chips are shown in the chat timeline. This
/// is the single writer for the tool-call visibility state now that the
/// toggle lives in the Settings "Chat" section (previously a composer
/// toggle). Bumps the collapse version when hiding so already-expanded tool
/// chips collapse, updates the shared static, and notifies any mounted
/// <see cref="OpenClawChatRoot"/> so its timeline re-renders.
/// </summary>
public static void SetToolCallsVisible(bool visible)
{
if (!visible && s_showToolCalls)
s_toolCallsCollapseVersion++;
s_showToolCalls = visible;
ToolCallsVisibilityChanged?.Invoke(null, EventArgs.Empty);
}

private readonly IChatDataProvider _provider;
private readonly string? _initialThreadId;
private readonly Func<string, Task>? _onReadAloud;
Expand Down Expand Up @@ -530,7 +546,7 @@ Element BuildLoadingElement()
.ThenBy(g => g.Key, StringComparer.OrdinalIgnoreCase)
.Select(g => new ChannelGroup(
AgentLabel: g.Key.Length > 0 ? char.ToUpperInvariant(g.Key[0]) + g.Key[1..] : "Unknown",
Sessions: g.Select(t => (Id: t.Id, Title: t.Title!)).ToArray()))
Sessions: g.Select(t => (Id: t.Id, Title: t.Title!, Model: t.Model, ModelProvider: t.ModelProvider)).ToArray()))
.ToArray();

// If the compose-only synthetic thread isn't represented in any group
Expand All @@ -551,7 +567,7 @@ Element BuildLoadingElement()
var agentLabel = agentId.Length > 0 ? char.ToUpperInvariant(agentId[0]) + agentId[1..] : "Main";
var syntheticGroup = new ChannelGroup(
AgentLabel: agentLabel,
Sessions: new[] { (Id: effectiveThread.Id!, Title: effectiveThread.Title ?? "OpenClaw Windows Tray") });
Sessions: new[] { (Id: effectiveThread.Id!, Title: effectiveThread.Title ?? "OpenClaw Windows Tray", Model: effectiveThread.Model, ModelProvider: effectiveThread.ModelProvider) });

var augmented = new ChannelGroup[channelGroups.Length + 1];
augmented[0] = syntheticGroup;
Expand Down Expand Up @@ -607,14 +623,6 @@ Element BuildLoadingElement()
VoiceAudioLevel: voiceAudioLevel.Value,
RegisterVoiceStarter: starter => TriggerVoiceRecording = starter,
OnAttachmentPasted: att => SetPendingAttachments(pendingAttachmentsRef.Current.Concat(new[] { att }).ToArray()),
ShowToolCalls: showToolCalls.Value,
OnShowToolCallsChanged: visible =>
{
if (!visible && s_showToolCalls)
s_toolCallsCollapseVersion++;
s_showToolCalls = visible;
ToolCallsVisibilityChanged?.Invoke(null, EventArgs.Empty);
},
IsCompact: _isCompact,
AvailableCommands: snapshot.AvailableCommands,
CommandsSupported: snapshot.CommandsSupported,
Expand Down
Loading
Loading