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

Replace full-width prompt header with a variable-width-with-max prompt header #4014

Merged
merged 7 commits into from
Nov 24, 2024

Conversation

lihaoyi
Copy link
Member

@lihaoyi lihaoyi commented Nov 23, 2024

The previous full-width prompt header looks really weird on wide screens, even a full-width laptop screen is enough to make it awkward. This PR replaces it with a variable-width prompt header with some heuristics for shortening the = bars and the title text as necessary.

Covered by existing tests, added some more thorough tests in PromptLoggerUtilTests.scala to exercise the edge cases in the new shortening heuristics

@lihaoyi
Copy link
Member Author

lihaoyi commented Nov 23, 2024

CC @lefou I think we discussed something like this before

@lihaoyi lihaoyi marked this pull request as ready for review November 23, 2024 15:04
@lefou
Copy link
Member

lefou commented Nov 23, 2024

I don't need the dashes at all. Also I accidentally thought some time ago that you changed the progress logger to have the seconds before the task name and I really liked it. (Then I realized, I was looking at some evaluator command running anonymous tasks with with extra ticker output.) Nevertheless, If we move the timing between the progress and the task name, we could end up with a condensed consistent output:

Before:

[15624/16847] ================================== __.compile ========================================== 14s
[15133] main.client.compile 3s
[15397] scalanativelib.worker-api.compile 1s
[15404] scalajslib.worker-api.compile 1s
[15612] kotlinlib.worker.test.resolvedIvyDeps
[15613] javascriptlib.test.resolvedIvyDeps
[15614] main.api.test.resolvedIvyDeps
[15615] contrib.versionfile.test.resolvedIvyDeps
[15616] contrib.sonatypecentral.test.resolvedIvyDeps
[15617] contrib.scoverage.worker2.test.resolvedIvyDeps
[15618] contrib.scoverage.api.test.resolvedIvyDeps
[15619] contrib.playlib.worker[3.0].test.resolvedIvyDeps
[15620] contrib.playlib.worker[2.9].test.resolvedIvyDeps
[15621] contrib.playlib.worker[2.8].test.resolvedIvyDeps
[15608] main.eval.test.resolvedIvyDeps
[15611] main.codesig.test.resolvedIvyDeps
[15173] contrib.testng.compile 2s

After (mocked):

[15624/16847]  14s  ==> __.compile
[15133]  3s  main.client.compile
[15397]  1s  scalanativelib.worker-api.compile
[15404]  1s  scalajslib.worker-api.compile
[15612]      kotlinlib.worker.test.resolvedIvyDeps
[15613]      javascriptlib.test.resolvedIvyDeps
[15614]      main.api.test.resolvedIvyDeps
[15615]      contrib.versionfile.test.resolvedIvyDeps
[15616]      contrib.sonatypecentral.test.resolvedIvyDeps
[15617]      contrib.scoverage.worker2.test.resolvedIvyDeps
[15618]      contrib.scoverage.api.test.resolvedIvyDeps
[15619]      contrib.playlib.worker[3.0].test.resolvedIvyDeps
[15620]      contrib.playlib.worker[2.9].test.resolvedIvyDeps
[15621]      contrib.playlib.worker[2.8].test.resolvedIvyDeps
[15608]      main.eval.test.resolvedIvyDeps
[15611]      main.codesig.test.resolvedIvyDeps
[15173]  2s  contrib.testng.compile

@lihaoyi
Copy link
Member Author

lihaoyi commented Nov 24, 2024

For me I need some kind of dashes, otherwise i find the lack of separation makes it visually hard to distinguish log lines from prompt lines.

The timing on the left thing is possible, but one issue is the timing string is variable width, from zero to four digits wide (to give an arbitrary upper limit). So either we would need to reserve a pretty wide gutter, or we would have un-aligned task selectors, or we would have task selectors moving left and right as the longest lived tasks complete. Might be possible to find a compromise but may need more thought

@lihaoyi lihaoyi merged commit 5dbfd67 into com-lihaoyi:main Nov 24, 2024
25 of 27 checks passed
@lefou lefou added this to the 0.12.3 milestone Nov 24, 2024
@lefou
Copy link
Member

lefou commented Dec 6, 2024

but one issue is the timing string is variable width, from zero to four digits wide

We could use a mm:ss format for the timing.

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.

2 participants