Fixed Spectre UI

This commit is contained in:
Alexander Shabarshov 2026-05-16 19:10:31 +01:00
parent 5955fb2d29
commit ac58534438

View File

@ -173,7 +173,7 @@ public sealed class SpectreConsoleLogger : ILogger, IDisposable
var layout = new Layout("root")
.SplitRows(
new Layout("progress") { Size = Math.Max(3, numberOfProcessesSnapshot + 2) },
new Layout("progress") { Size = Math.Max(3, numberOfProcessesSnapshot + 4) },
new Layout("log")
//new Layout("buttons") { Size = 3 }
);
@ -228,8 +228,8 @@ public sealed class SpectreConsoleLogger : ILogger, IDisposable
foreach (var log in slice)
{
var time = log.Timestamp.ToString("HH:mm:ss");
var timeColor = "deepskyblue1"; // dark-ish blue
var prefixColor = "lightpink1"; // light magenta
var timeColor = "deepskyblue1";
var prefixColor = "lightpink1";
var msgColor = MapConsoleColor(log.Color);
var line =
@ -240,38 +240,10 @@ public sealed class SpectreConsoleLogger : ILogger, IDisposable
rows.Add(new Markup(line));
}
IRenderable content =
rows.Count == 0
? new Markup("[grey]No log messages yet.[/]")
: new Rows(rows);
if (rows.Count == 0)
return new Markup("[grey]No log messages yet.[/]");
var panel = new Panel(content)
{
Header = new PanelHeader("Log", Justify.Left),
Border = BoxBorder.Rounded,
Expand = true
};
return panel;
}
private static IRenderable BuildButtonsPanel()
{
// Visual [ Cancel ] button; key handling is in RunInputLoopAsync
var text = new Markup("[bold white on red] Cancel [/]");
var grid = new Grid();
grid.AddColumn(new GridColumn().Centered());
grid.AddRow(text);
var panel = new Panel(grid)
{
Border = BoxBorder.Rounded,
Header = new PanelHeader("Actions", Justify.Left),
Expand = true
};
return panel;
return new Rows(rows);
}
// ---- Helpers ----