spectreconsole / spectre.console

A .NET library that makes it easier to create beautiful console applications.
https://spectreconsole.net
MIT License
9.28k stars 479 forks source link

Improved the visual appeal of SelectionPrompt and MultiSelectionPrompt (text wrapping) #1578

Open yymqn opened 3 months ago

yymqn commented 3 months ago

fixes #1577

Changes

I've modified how SelectionPrompt<T> and MultiSelectionPrompt<T> render the prompt. Instead of using Grid with only one column, I split the row into two columns, where one is the indentation, arrow, or checkbox and the second column is the text itself. This makes the wrapping look better.

Before the change: image

After the change: image


Please upvote :+1: this pull request if you are interested in it.

yymqn commented 3 months ago

I've fixed an issue with SelectionPrompt<T> where the indentation was incorrect when using groups and nesting. Also, I've updated the code formatting to pass the analyzers.

yymqn commented 3 weeks ago

@patriksvensson Could you please take a look at my PR? There hasn't been any activity for over 2 months.

I would completely understand if this didn't get merged, as the code behind it might not be the best solution and could be written better.