Skip to content

Commit 5b31892

Browse files
shanselmanCopilot
andcommitted
Avoid activity snippets in tray dashboard glance
Keep the top-level tray dashboard limited to stable metadata so command, query, path, or URL activity text stays out of the glance. Co-authored-by: Copilot <[email protected]>
1 parent cd58cea commit 5b31892

2 files changed

Lines changed: 24 additions & 5 deletions

File tree

‎src/OpenClaw.Tray.WinUI/Services/TrayDashboardSummary.cs‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,11 @@ static bool IsActive(SessionInfo s) =>
211211
? (int)Math.Round(Math.Min(100.0, (double)usedTokens / contextTokens * 100.0))
212212
: 0;
213213

214-
// Detail carries model and/or current activity — the context % lives in
215-
// its own trailing chip, so don't repeat it here.
216-
var detailParts = new List<string>(2);
214+
// Detail carries only stable metadata; CurrentActivity can include
215+
// command/query/path/URL snippets and should stay out of the top-level
216+
// tray glance.
217+
var detailParts = new List<string>(1);
217218
if (!string.IsNullOrWhiteSpace(session.Model)) detailParts.Add(session.Model!);
218-
if (usedTokens <= 0 && !string.IsNullOrWhiteSpace(session.CurrentActivity))
219-
detailParts.Add(session.CurrentActivity!);
220219
var detail = detailParts.Count == 0 ? null : string.Join(" · ", detailParts);
221220

222221
return new TrayDashboardActiveSession(

‎tests/OpenClaw.Tray.Tests/Services/TrayDashboardSummaryBuilderTests.cs‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,26 @@ public void ActiveSession_DefaultsContextWindowWhenUnset()
327327
Assert.Equal(10, summary.ActiveSession!.ContextPercent);
328328
}
329329

330+
[Fact]
331+
public void ActiveSession_DoesNotExposeCurrentActivityInTopLevelGlance()
332+
{
333+
var sessions = new[]
334+
{
335+
new SessionInfo
336+
{
337+
Key = "main",
338+
IsMain = true,
339+
DisplayName = "Main",
340+
CurrentActivity = "🔧 curl https://internal.example.test/secrets"
341+
},
342+
};
343+
344+
var summary = Build(Base(sessions: sessions));
345+
346+
Assert.NotNull(summary.ActiveSession);
347+
Assert.Null(summary.ActiveSession!.Detail);
348+
}
349+
330350
// ── Edge cases: severity ordering, usage fallbacks, formatting ──
331351

332352
[Fact]

0 commit comments

Comments
 (0)