Skip to content

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

Merged
lihaoyi merged 7 commits into
com-lihaoyi:mainfrom
lihaoyi:prompt-max-length
Nov 24, 2024
Merged

Replace full-width prompt header with a variable-width-with-max prompt header#4014
lihaoyi merged 7 commits into
com-lihaoyi:mainfrom
lihaoyi:prompt-max-length

Conversation

@lihaoyi

@lihaoyi lihaoyi commented Nov 23, 2024

Copy link
Copy Markdown
Member

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

lihaoyi commented Nov 23, 2024

Copy link
Copy Markdown
Member Author

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

lefou commented Nov 23, 2024

Copy link
Copy Markdown
Member

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

lihaoyi commented Nov 24, 2024

Copy link
Copy Markdown
Member Author

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
@lefou lefou added this to the 0.12.3 milestone Nov 24, 2024
@lefou

lefou commented Dec 6, 2024

Copy link
Copy Markdown
Member

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