Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add grid view option to --layout, implement grid view output #23

Closed
hedyhli opened this issue Jun 27, 2020 · 11 comments · Fixed by #38
Closed

Add grid view option to --layout, implement grid view output #23

hedyhli opened this issue Jun 27, 2020 · 11 comments · Fixed by #38
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers to try

Comments

@hedyhli
Copy link
Owner

hedyhli commented Jun 27, 2020

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

@hedyhli hedyhli added enhancement New feature or request Up for grabs good first issue Good for newcomers to try labels Jun 27, 2020
@willmcgugan
Copy link

You could render a grid view with the Columns class. See columns.py in the examples directory.

@hedyhli
Copy link
Owner Author

hedyhli commented Jun 27, 2020

Thank you for letting me know, I will have a look

@hedyhli hedyhli self-assigned this Jun 28, 2020
@hedyhli hedyhli removed their assignment Jun 28, 2020
@hedyhli
Copy link
Owner Author

hedyhli commented Jun 28, 2020

This issue is now available for grabs, anyone can drop in and request to be assigned :D

@hedyhli hedyhli pinned this issue Jun 28, 2020
@swellander
Copy link
Contributor

Hi there! Is this no longer up for grabs?

@hedyhli
Copy link
Owner Author

hedyhli commented Jun 30, 2020

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 😄

@hedyhli
Copy link
Owner Author

hedyhli commented Jun 30, 2020

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

@swellander
Copy link
Contributor

swellander commented Jul 5, 2020

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?

@hedyhli
Copy link
Owner Author

hedyhli commented Jul 5, 2020

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.

@swellander
Copy link
Contributor

Got it, good call. I think the ... will work well.

@hedyhli
Copy link
Owner Author

hedyhli commented Jul 7, 2020

How’s the progress? Once you open a pr I’ll add you to all-contributors list

@hedyhli hedyhli unpinned this issue Jul 7, 2020
@swellander
Copy link
Contributor

Just about done! Aiming to have the PR up later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers to try
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants