Console UX: tracing warnings tend to screw with repaints and offset superconsole
- Dominant language
- Rust
- Stars
- 4.4k
- Forks
- 394
- PR merge metrics
- No merged PRs in 30d
Description
This is a follow up to #316 and #321. Let's look at a fresh build of buck2-with-buck2 on my WSL machine, with no `buck-out/`, right after running `reindeer buckify`:
https://github.com/facebook/buck2/assets/3416/ffa099d1-97cb-4479-9ee3-05ab7c6b1d27
This is a really bad example of what #316 can cause: it basically *ruins* the UX on the first build entirely. In this case, it only ruins the *first* build because of the HTTP throttling in #316, and subsequent builds won't download and hammer https://crates.io, so it won't appear unless you like completely regenerate the `Cargo.lock` file I guess.
But, of course, #316 is just an example of what can cause this. Pretty much any `warn!()` call or things that use tracing in the codebase are going to cause this to happen. I think those warnings should probably not be silenced (or turned into buck events), but the UX *definitely* needs fixes to handle this better.
Frankly, I would much rather see the superconsole UX here split into two "draw boxes", split horizontally, the top one being the build output, and the *bottom one* being warnings, if they appear. The reason for this choice is very simple: because you will *always* see the build output appear first, and warnings will only happen *mid flight* in the middle of the build, if they happen at all. The build UX is up and running first, so it shouldn't be pushed down just because a possible transient warning happened. The UX should follow the temporal series of events, in some sense.
But really anything that could get rid of this would be nice, if you ask me.
---
There is a related bug here that I also don't like, which is that superconsole doesn't seem to detect or resize properly in WSL/Windows Terminal. Note that my console is +120 columns wide, yet even on startup, superconsole doesn't draw past 80 columns, and it doesn't resize if you change the dimensions mid-flight.
I don't know if this is a limitation on all platforms right now, or if some weird WSL/Terminal interaction that needs to be handled.
---
> **NOTE**: @cjhopman asked in #321 for a recording of my "violent repainting" where warnings would make the UX repaint harshly, which actually I think is both a combination of this and also a bug in Windows Terminal, that makes it look worse; that issue has been fixed in the latest Windows Terminal Insider build, and it also fixes related applications for me, such as `nushell`, which flickered constantly, so I just moved over to the Insider build. It may have just been evil ghosts or spirits haunting me too.
>
> Possible upstream issue that is now closed: https://github.com/microsoft/terminal/issues/13710
Contributor guide
Assessment
This issue has not been assessed yet.