Skip to content

Commit 75bad3a

Browse files
committed
Make progress description column multiline
This improves rendering for long lines of progress.
1 parent 3c7210b commit 75bad3a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/dotnet-retest/RetestCommand.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using NuGet.Packaging;
1414
using Spectre.Console;
1515
using Spectre.Console.Cli;
16+
using Spectre.Console.Rendering;
1617
using static Spectre.Console.AnsiConsole;
1718

1819
namespace Devlooped;
@@ -82,7 +83,7 @@ public override async Task<int> ExecuteAsync(CommandContext context, RetestSetti
8283

8384
ProgressColumn[] columns = ci ?
8485
[new TaskDescriptionColumn { Alignment = Justify.Left }] :
85-
[new SpinnerColumn(), new ElapsedTimeColumn(), new TaskDescriptionColumn { Alignment = Justify.Left }];
86+
[new SpinnerColumn(), new ElapsedTimeColumn(), new MultilineTaskDescriptionColumn()];
8687

8788
// 11 = spinner + elapsed time + padding
8889
var maxwith = AnsiConsole.Console.Profile.Width - 11;
@@ -288,4 +289,14 @@ public class RetestSettings : CommandSettings
288289

289290
#endregion
290291
}
292+
293+
class MultilineTaskDescriptionColumn : ProgressColumn
294+
{
295+
public override IRenderable Render(RenderOptions options, ProgressTask task, TimeSpan deltaTime)
296+
{
297+
return new Markup(task.Description ?? string.Empty)
298+
.Overflow(Overflow.Ellipsis)
299+
.Justify(Justify.Left);
300+
}
301+
}
291302
}

0 commit comments

Comments
 (0)