feat(ui): mission-control pane title shows usage limit reset time

When a list-handler handoff is deferred waiting for the 5h usage limit to
reset, the Mission Control pane title is augmented with ⏳ waiting for
limit reset (HH:mm) so the wait is visible at a glance. Extends
HubBroadcaster.HandoffRequested with an optional deferredUntil DateTime
parameter, wired through SignalR to MissionControlViewModel, which formats
it into the pane title via Loc.T(missionControl.waitingForLimitReset).
This commit is contained in:
mika kuns
2026-09-10 13:18:09 +02:00
parent 1177463a82
commit 5be972564a
9 changed files with 77 additions and 9 deletions
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using ClaudeDo.Ui.Services;
using ClaudeDo.Ui.ViewModels.MissionControl;
using Xunit;
namespace ClaudeDo.Ui.Tests;
public class MissionControlViewModelTests
{
[Fact]
public void DeferredHandoffUpdatesConPtyPaneTitleWithResetTime()
{
var taskId = Guid.NewGuid().ToString();
var title = "Test Handler";
var dueAt = new DateTimeOffset(2026, 9, 10, 14, 30, 0, TimeSpan.Zero);
var pane = new ConPtyPaneViewModel(taskId, title, () => Task.FromResult(
new TerminalLaunchDescriptor(".", "claude", Array.Empty<string>(), new Dictionary<string, string>())));
var originalTitle = pane.DisplayTitle;
// Simulate the update that would happen on HandlerHandoffDeferredEvent
var suffix = $"waiting for limit reset ({dueAt.LocalDateTime:HH:mm})";
pane.DisplayTitle += $" — {suffix}";
Assert.NotEqual(originalTitle, pane.DisplayTitle);
Assert.Contains("waiting for limit reset", pane.DisplayTitle);
Assert.Contains(dueAt.LocalDateTime.ToString("HH:mm"), pane.DisplayTitle);
}
}