Skip to content

Commit 8438930

Browse files
committed
fix(tray): preserve current session projection after rebase
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 529161b9-67ce-4fde-98b4-c96d8991faff
1 parent 039a908 commit 8438930

3 files changed

Lines changed: 1 addition & 47 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ private bool HasRelevantMcpStartupError() =>
151151
var sessionCount = _snapshot.Sessions.Length;
152152
if (sessionCount > 0)
153153
{
154-
var active = _snapshot.Sessions.Count(SessionRunState.IsWorking);
154+
var active = _snapshot.Sessions.Count(session => SessionRunState.IsWorking(session.ToSessionInfo()));
155155
parts.Add(active > 0
156156
? $"{sessionCount} {(sessionCount == 1 ? "session" : "sessions")} ({active} working)"
157157
: $"{sessionCount} {(sessionCount == 1 ? "session" : "sessions")}");

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

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -77,34 +77,6 @@ internal sealed record TrayNodeSnapshot(
7777
value.DeviceFamily);
7878
}
7979

80-
internal sealed record TraySessionPresentationSnapshot(
81-
string Title,
82-
string TitleSource,
83-
string? Subtitle,
84-
string Family,
85-
string? AgentId,
86-
string? Channel,
87-
string? AccountId,
88-
string? PeerKind,
89-
bool IsMain,
90-
bool IsBackground)
91-
{
92-
internal static TraySessionPresentationSnapshot? From(SessionPresentationInfo? value) =>
93-
value is null
94-
? null
95-
: new(
96-
value.Title,
97-
value.TitleSource,
98-
value.Subtitle,
99-
value.Family,
100-
value.AgentId,
101-
value.Channel,
102-
value.AccountId,
103-
value.PeerKind,
104-
value.IsMain,
105-
value.IsBackground);
106-
}
107-
10880
internal sealed record TraySessionWorktreeSnapshot(string? Id, string? Branch, string? RepoRoot)
10981
{
11082
internal static TraySessionWorktreeSnapshot? From(SessionWorktreeInfo? value) =>
@@ -123,7 +95,6 @@ internal sealed record TraySessionSnapshot(
12395
string? DerivedTitle,
12496
string? ExecNode,
12597
TraySessionWorktreeSnapshot? Worktree,
126-
TraySessionPresentationSnapshot? Presentation,
12798
long InputTokens,
12899
long OutputTokens,
129100
long TotalTokens,
@@ -150,7 +121,6 @@ internal sealed record TraySessionSnapshot(
150121
value.DerivedTitle,
151122
value.ExecNode,
152123
TraySessionWorktreeSnapshot.From(value.Worktree),
153-
TraySessionPresentationSnapshot.From(value.Presentation),
154124
value.InputTokens,
155125
value.OutputTokens,
156126
value.TotalTokens,
@@ -192,21 +162,6 @@ internal sealed record TraySessionSnapshot(
192162
Branch = Worktree.Branch,
193163
RepoRoot = Worktree.RepoRoot,
194164
},
195-
Presentation = Presentation is null
196-
? null
197-
: new SessionPresentationInfo
198-
{
199-
Title = Presentation.Title,
200-
TitleSource = Presentation.TitleSource,
201-
Subtitle = Presentation.Subtitle,
202-
Family = Presentation.Family,
203-
AgentId = Presentation.AgentId,
204-
Channel = Presentation.Channel,
205-
AccountId = Presentation.AccountId,
206-
PeerKind = Presentation.PeerKind,
207-
IsMain = Presentation.IsMain,
208-
IsBackground = Presentation.IsBackground,
209-
},
210165
InputTokens = InputTokens,
211166
OutputTokens = OutputTokens,
212167
TotalTokens = TotalTokens,

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,6 @@ private static TrayMenuElement Find(TrayMenuPresentation presentation, string ac
366366
null,
367367
null,
368368
null,
369-
null,
370369
8_000,
371370
4_000,
372371
12_000,

0 commit comments

Comments
 (0)