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

Shorten tty output when terminal is too small #10168

Merged
merged 1 commit into from Jan 12, 2023

Conversation

laurazard
Copy link
Member

@laurazard laurazard commented Jan 12, 2023

Signed-off-by: Laura Brehm laurabrehm@hey.com

We've had lots of complaints about the new TUI breaking when output exceeds terminal height. Related discussion can be found in these issues:

The issue was partly addressed by the changes to detect when multiple services use the same images in #9173, but the root issue persists. Whenever have more lines to write than the terminal height, we're unable to scroll back far enough to rewrite the buffer, and leave dangling lines behind, filling up the terminal scrollback and resulting in bad UX.

What I did

Detect when the number of events we have to display is > than terminal height, and adjust the output to omit child events when that's the case. This isn't a perfect solution (if the number of services > terminal height we will still run into issues, and the shortened output isn't very explicit), but it only kicks in in cases where the output would otherwise be worse, so it's an improvement over the current situation.

Before:

Screen.Recording.2023-01-12.at.01.20.16.mov

After:

Screen.Recording.2023-01-12.at.01.22.00.mov

(not mandatory) A picture of a cute animal, if possible in relation to what you did

IMG_20221224_193236

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
@laurazard laurazard requested review from a team, nicksieger, ndeloof, StefanScherer, ulyssessouza, glours and milas and removed request for a team January 12, 2023 00:27
@codecov
Copy link

codecov bot commented Jan 12, 2023

Codecov Report

Base: 73.89% // Head: 73.89% // No change to project coverage 👍

Coverage data is based on head (3a1910e) compared to base (3e12a7c).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##               v2   #10168   +/-   ##
=======================================
  Coverage   73.89%   73.89%           
=======================================
  Files           2        2           
  Lines         272      272           
=======================================
  Hits          201      201           
  Misses         60       60           
  Partials       11       11           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ndeloof
Copy link
Contributor

ndeloof commented Jan 12, 2023

Nice !! 🥳

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.

None yet

2 participants