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(turborepo): new ui + watch mode #7962
base: main
Are you sure you want to change the base?
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @NicholasLYang and the rest of your teammates on Graphite |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
7 Ignored Deployments
|
🟢 Turbopack Benchmark CI successful 🟢Thanks |
|
0d4f68d
to
02a5e85
Compare
09b44be
to
c090c69
Compare
02a5e85
to
24a0c13
Compare
c090c69
to
2050124
Compare
8931497
to
2152b42
Compare
2050124
to
c69ac3a
Compare
2152b42
to
84b3416
Compare
c69ac3a
to
e8ceb6f
Compare
84b3416
to
232f44d
Compare
e8ceb6f
to
53a852f
Compare
cdb7ad4
to
f916053
Compare
09c0e0d
to
fd3c6d1
Compare
8b2029b
to
5c639c5
Compare
fd3c6d1
to
fe028d0
Compare
fe028d0
to
78937d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks good, primarily concerned with testing the state machine that is our UI.
self.state.start | ||
} | ||
pub fn start(self) -> Task<Running> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels off, do we want to start running tasks again vs creating a new task and having it go through the natural progression of planned -> running -> finished
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh yeah that makes more sense
@@ -77,6 +77,10 @@ impl<I> App<I> { | |||
pub fn term_size(&self) -> (u16, u16) { | |||
self.pane.term_size() | |||
} | |||
|
|||
pub fn update_tasks(&mut self, tasks: Vec<String>) { | |||
self.table = TaskTable::new(tasks.clone()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to be clearing and updating the panes in some way as well. Right now they get reused so task output from a previous run is still displayed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that bad? I kind of like seeing the previous runs, so you can understand that something got re-run. If a task completes too quickly, it could end up showing the same output which would confuse people
@@ -77,6 +77,10 @@ impl<I> App<I> { | |||
pub fn term_size(&self) -> (u16, u16) { | |||
self.pane.term_size() | |||
} | |||
|
|||
pub fn update_tasks(&mut self, tasks: Vec<String>) { | |||
self.table = TaskTable::new(tasks.clone()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to a prior hack, there should be self.next()
as otherwise the table might be out of sync with the pane. i.e. display wrong pane for selected task in table
self.scroll.select(Some(selected_idx + 1)); | ||
} | ||
} | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if a task gets restarted while it's still running it will error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's currently not possible. We purposefully make it so the same task can't be run at the same time, and we haven't implemented cancelation logic. If a change event happens in the middle of a run, we save it and wait for the run to finish before starting up a new execution.
.iter() | ||
.position(|finished_task| finished_task.name() == task) | ||
{ | ||
let finished = self.finished.remove(finished_idx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some unit tests would be a good fit here.
Co-authored-by: Chris Olszewski <chris.olszewski@vercel.com>
Description
Integrates new UI with watch mode. Pulls out the UI handle and sender outside the
Visitor
andRun
struct, so it can be owned by theWatchClient
. Also adds anEvent
for updating the task names, so on rediscovery we can keep using the same UI thread but just update the task names.Testing Instructions
Give it a shot!
Closes TURBO-2801