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

fix: adjust the window size of the help output #862

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

threepipes
Copy link
Contributor

@threepipes threepipes commented Mar 8, 2023

Checklist

=========

Internal Checklist

  • I am requesting a review from my own team as well as the owning team
  • I have a plan in place for the monitoring of the changes that I am making (this can include new monitors, logs to be aware of, etc...)

Changes

=======

  • Adjust the window size of the help output
    • Because it is broken when the terminal width is smaller than 122 characters
  • Remove the CircleCI logo on the help output when the terminal width is smaller than 86 chars
    • Because the logo size can't be adjusted

Rationale

=========

This solves #797 and #863.

Considerations

==============

These are suggested solutions at #797.

Possible solutions:

  • Don't draw this border at all.
  • Disable the border if the window size is smaller than the bounding box size
  • Allow me to disable the border

Disabling the border is already possible by passing TESTING=true(The variable name is not appropriate for public use, though).
I can also adopt the first or second solution.

Screenshots

============

Before

screenshot 2023-03-08 232428

After

85 < Terminal width < 122

screenshot 2023-03-08 232536

Terminal width <= 85

screenshot 2023-03-08 232630

Here are some helpful tips you can follow when submitting a pull request:

  1. Fork the repository and create your branch from main.
  2. Run make build in the repository root.
  3. If you've fixed a bug or added code that should be tested, add tests!
  4. Ensure the test suite passes (make test).
  5. The --debug flag is often helpful for debugging HTTP client requests and responses.
  6. Format your code with gofmt.
  7. Make sure your code lints (make lint). Note: This requires Docker to run inside a local job.

@@ -325,7 +333,7 @@ For more help, see the documentation here: %s`, short, config.Data.Links.CLIDocs
}

type helpCmd struct {
cmd *cobra.Command
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it because cmd is passed as an argument of helpTemplate, and this cmd is not used.

@threepipes threepipes marked this pull request as ready for review March 8, 2023 14:40
@threepipes threepipes requested a review from a team as a code owner March 8, 2023 14:40
@wyardley
Copy link
Contributor

🙏 Thanks for this! This would also fix #863 if you want to add that to the PR description

@wyardley
Copy link
Contributor

@elliotforbes any chance you could poke someone to look at this one as well?

@elliotforbes elliotforbes merged commit 6271ba1 into CircleCI-Public:develop Mar 23, 2023
@elliotforbes
Copy link
Contributor

@wyardley - I can't claim credit for nudging here, but I've merged it in. Hoping to land it in the next release alongside some other changes.

@wyardley
Copy link
Contributor

Thanks all! Cosmetic, I know, but really apreciated!

@threepipes
Copy link
Contributor Author

threepipes commented Mar 28, 2023

@elliotforbes Thank you for merging, and @wyardley Thank you for your assistance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants