Skip to content

Commit d165abb

Browse files
rogeralsingclaude
andcommitted
Show filter or assembly name in live display panel header
When a filter is provided, displays it in the header like: ╭─filter "Method=RegExp" (123/456)─── Otherwise shows the assembly name. Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 32012cf commit d165abb

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/Asynkron.TestRunner/LiveDisplay.cs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,24 @@ public class LiveDisplay
2424
private readonly HashSet<string> _running = new();
2525
private string? _lastCompleted;
2626
private string? _lastStatus;
27+
private string? _filter;
28+
private string? _assemblyName;
2729

2830
public void SetTotal(int total)
2931
{
3032
lock (_lock) _total = total;
3133
}
3234

35+
public void SetFilter(string? filter)
36+
{
37+
lock (_lock) _filter = filter;
38+
}
39+
40+
public void SetAssembly(string assemblyPath)
41+
{
42+
lock (_lock) _assemblyName = Path.GetFileNameWithoutExtension(assemblyPath);
43+
}
44+
3345
public void TestStarted(string displayName)
3446
{
3547
lock (_lock) _running.Add(Truncate(displayName, ContentWidth));
@@ -132,8 +144,13 @@ public IRenderable Render()
132144
CreateRunningSection()
133145
);
134146

147+
// Build header: show filter if set, otherwise assembly name
148+
var headerText = !string.IsNullOrEmpty(_filter)
149+
? $"[dim]filter[/] [bold]\"{_filter}\"[/]"
150+
: _assemblyName ?? "Test Progress";
151+
135152
var panel = new Panel(layout)
136-
.Header($"[bold]Test Progress[/] [dim]({completed}/{_total})[/]")
153+
.Header($"{headerText} [dim]({completed}/{_total})[/]")
137154
.Border(BoxBorder.Rounded)
138155
.BorderColor(Color.Grey)
139156
.Expand();

src/Asynkron.TestRunner/TestRunner.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ private async Task RunWithRecoveryLiveAsync(string assemblyPath, List<string> al
101101

102102
var display = new LiveDisplay();
103103
display.SetTotal(allTests.Count);
104+
display.SetFilter(_filter);
105+
display.SetAssembly(assemblyPath);
104106

105107
var failureDetails = new List<(string Name, string Message, string? Stack)>();
106108

0 commit comments

Comments
 (0)