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

feat(ui): render ui to alternative screen #8084

Merged
merged 6 commits into from May 9, 2024

Conversation

chris-olszewski
Copy link
Contributor

@chris-olszewski chris-olszewski commented May 3, 2024

Description

Changes our UI to render in the alternative screen (think vim or less)

This provides a few benefits:

We write the logs in a row-wise fasion as vt100 attempts to optimize performance by using cursor moves to avoid necessary writes. This creates problems when printing multiple terminal screens as the cursor move coordinates will be incorrect.

Testing Instructions

Screen.Recording.2024-05-03.at.9.52.45.AM.mov

Closes TURBO-2979

Copy link

vercel bot commented May 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-basic-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 9, 2024 4:23pm
examples-designsystem-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 9, 2024 4:23pm
examples-gatsby-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 9, 2024 4:23pm
examples-kitchensink-blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 9, 2024 4:23pm
examples-native-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 9, 2024 4:23pm
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 9, 2024 4:23pm
examples-svelte-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 9, 2024 4:23pm
examples-tailwind-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 9, 2024 4:23pm
examples-vite-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 9, 2024 4:23pm
rust-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 9, 2024 4:23pm

Copy link
Contributor

github-actions bot commented May 3, 2024

🟢 Turbopack Benchmark CI successful 🟢

Thanks

Copy link
Contributor

github-actions bot commented May 3, 2024

🟢 CI successful 🟢

Thanks

@weyert
Copy link
Contributor

weyert commented May 3, 2024

Would this make it easier to allow selection of log entries?

@chris-olszewski
Copy link
Contributor Author

Would this make it easier to allow selection of log entries?

Not sure I follow. As in easier to copy/paste from logs from tasks after turbo has exited?

@weyert
Copy link
Contributor

weyert commented May 6, 2024

Easier to select from the experimental-ui screen for logging

@chris-olszewski
Copy link
Contributor Author

Easier to select from the experimental-ui screen for logging

Ah, no. That broke due to us supporting mouse scroll for scrolling through task outputs. I might need to disable that feature and only allow keybinds. The alternative is to manually implement terminal selection and click support which isn't something I want to tackle at this moment.

Copy link
Contributor

@mehulkar mehulkar left a comment

Choose a reason for hiding this comment

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

The video looks great! Not a blocker, but could we still have colors on the group titles?

CleanShot 2024-05-08 at 11 29 16@2x

// visible_rows can never return enough rows to overflow here
let i = i.try_into().unwrap();
let mut contents = vec![];
// We don't need final cursor position as long as CRLF is used and not just LF
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this comment. Where would the CRLF or LF be coming from? is it user input? (in which case, is LF not possible on Windows?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When a terminal is in raw mode a LF only will move the cursor down a row, but not return it to the home (zero) column. This leads the string foo\nbar being printed in a raw terminal looking like

foo
   bar

where foo\r\nbar will be printed as expected

foo
bar

The comment is meant to explain why we aren't storing/restoring the final cursor position as we expect the caller to print these lines with a trailing \r\n.

### Description

Change the layout of the UI display better on smaller terminals.
- Removal of task timeline in favor of spinners and icons for finished
tasks
 - Move task list to sidebar

This PR also removes persisting writer codepaths as those are no-ops now
that we aren't using an inline view.


### Testing Instructions



https://github.com/vercel/turbo/assets/4131117/10fc9f99-8772-4e03-bc83-6ae9e267f0cd



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

Successfully merging this pull request may close these issues.

None yet

4 participants