Add grid view option to `--layout`, implement grid view output
hedyhli opened this issue · 11 comments
Currently, for the --layout
option we have list
or table
, it would be awesome if we also have a grid
option so the output can be displayed in grid view format.
To do so we should add a function called something like grid_layout()
in starcli/layouts.py
, with one parameter repos
. This function should then be imported from starcli/__main__.py
using the same logic as list_layout
and table_layout
to be called when --layout grid
is specified. Also, don't forget to update click.Choices(["list", "table", "grid"])
in the starcli/__main__.py
, with the help argument updated and the usage copied to the README.
You can use the panel and columns functionality from rich. See this example for reference
Start a pull request when you are done (or have started the draft PR)
Edit: added columns link as to the suggestion from @willmcgugan
You could render a grid view with the Columns class. See columns.py in the examples directory.
Thank you for letting me know, I will have a look
This issue is now available for grabs, anyone can drop in and request to be assigned :D
Hi there! Is this no longer up for grabs?
Of course it’s available! Don’t worry about the label movements, I was just organising them and decided to just keep a good first issue label. Feel free to take this up if you like 😄
Just a reminder, I have done a quick clean up to the branches and the GitHub action files, so you might wanna pull these new changes to your fork as needed. And use the ‘main’ branch to start a pr
Ok, sounds good 👍 sorry for the delay. I'd love to take this one. After looking at the columns example, it seems like varying repo description lengths might throw off the grid-look. Do you think the descriptions should be left out for this type of view?
I think if the description can make a single box too big to fit then we could show parts of the description, like
Python composable command line
Interface toolkit for beginners to...
With the ...
When the description exceeds a max character constant.
However if you really think we should leave it out then it’s fine.
Got it, good call. I think the ...
will work well.
How’s the progress? Once you open a pr I’ll add you to all-contributors list
Just about done! Aiming to have the PR up later today.