Skip to content

Conversation

harkabeeparolus
Copy link

@harkabeeparolus harkabeeparolus commented Dec 20, 2024

Provide an option for using Rich Panel.fit() aka Panel(expand=False) for help panels and errors. This was mentioned in discussion #607 and #680. To opt into this new, non-default behavior, just use:

app = typer.Typer(rich_expand=False)

I think this can look nicer on very wide terminals, especially for CLIs with few parameters, or short parameter descriptions, so I would prefer to have the option to choose this style sometimes.

Status

  • The code worked fine on all the examples I tried from the Typer tutorial
  • The documentation I added is perhaps a little sparse.
    • I don't know yet how to capture command output for the Typer docs, and I think an example is needed. Help?
  • I'm not sure how to write tests for this. Suggestions are welcome!

Example

rich_expand_example

Copy link
Contributor

@svlandeg svlandeg added the feature New feature, enhancement or request label Dec 26, 2024
Copy link
Contributor

@mshonichev
Copy link

Any chances to merge this PR soon? Can someone please restart CI?

Copy link
Contributor

github-actions bot commented Apr 8, 2025

@harkabeeparolus
Copy link
Author

harkabeeparolus commented Apr 9, 2025

Any chances to merge this PR soon?

I believe what's missing is test coverage for my new code and logic, which is not my strong suit. I would appreciate any help or suggestions on how to approach writing tests for this.

@github-actions github-actions bot added the conflicts Automatically generated when a PR has a merge conflict label Sep 1, 2025
Copy link
Contributor

github-actions bot commented Sep 1, 2025

This pull request has a merge conflict that needs to be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflicts Automatically generated when a PR has a merge conflict feature New feature, enhancement or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants