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

Right justify target and duration in terminallogger #9053

Merged
merged 5 commits into from
Dec 11, 2023

Conversation

rainersigwald
Copy link
Member

@rainersigwald rainersigwald commented Jul 19, 2023

Right-justify target and duration. To do this, I changed the localization mechanism for in-progress targets to be a bit less flexible at the translation level (the order is now fixed in code), but that allows determining a bunch of per-message length characteristics, unlocking right-justification and context-aware truncation.

right-justified-gnome-terminal

right-justified-max-width

Copy link
Member

@baronfel baronfel left a comment

Choose a reason for hiding this comment

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

I love this - the UX has got my thumbs up.

Instead of the rendered string, with its invisible control characters.
I wanted control over equality, and we don't need the auto-generated stuff.
Move cursor right (it stops at end of line), then back to justify the
output. This makes the localization less flexible since the formatting +
justification is handled in code, but makes it a lot easier to
understand. In the future reordering in translations would need to be
handled fairly carefully.

Avoid a bunch of overwrite problems by simplifiying the
should-we-do-a-fancy-overwrite decision to "is just time tick" or "just
overwrite it all".
@YuliiaKovalova
Copy link
Member

Looks good !

@rokonec rokonec self-assigned this Dec 6, 2023
@rokonec rokonec assigned rainersigwald and unassigned rokonec Dec 11, 2023
@rainersigwald rainersigwald merged commit 23b938b into dotnet:main Dec 11, 2023
8 checks passed
@rainersigwald rainersigwald deleted the right-justify branch December 11, 2023 16:27
@rainersigwald rainersigwald restored the right-justify branch December 13, 2023 15:54
@rainersigwald rainersigwald deleted the right-justify branch December 13, 2023 16:59
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.

5 participants