From ffc02ba496942d43b869fb82ff3bb0fdd576dc9c Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 6 Sep 2024 15:36:17 +0100 Subject: [PATCH] fix(tui): update ui when push next finishes Removes the artificial pause while we wait for any CI to start before checking the CI status. Closes kemitix/git-next#160 --- crates/cli/src/repo/handlers/advance_next.rs | 3 ++- crates/cli/src/server/actor/messages.rs | 1 + crates/cli/src/tui/actor/handlers/server_update.rs | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/cli/src/repo/handlers/advance_next.rs b/crates/cli/src/repo/handlers/advance_next.rs index 2951601..53a9de5 100644 --- a/crates/cli/src/repo/handlers/advance_next.rs +++ b/crates/cli/src/repo/handlers/advance_next.rs @@ -49,7 +49,8 @@ impl Handler for RepoActor { self.message_token, ) { Ok(message_token) => { - // pause to allow any CI checks to be started + self.update_tui(RepoUpdate::NextUpdated); + // INFO: pause to allow any CI checks to be started let sleep_duration = self.sleep_duration; let log = self.log.clone(); async move { diff --git a/crates/cli/src/server/actor/messages.rs b/crates/cli/src/server/actor/messages.rs index a6ba308..2d4b4d7 100644 --- a/crates/cli/src/server/actor/messages.rs +++ b/crates/cli/src/server/actor/messages.rs @@ -92,6 +92,7 @@ pub enum RepoUpdate { }, RegisteredWebhook, Opened, + NextUpdated, } message!( diff --git a/crates/cli/src/tui/actor/handlers/server_update.rs b/crates/cli/src/tui/actor/handlers/server_update.rs index ebaee6d..9c6ade0 100644 --- a/crates/cli/src/tui/actor/handlers/server_update.rs +++ b/crates/cli/src/tui/actor/handlers/server_update.rs @@ -58,6 +58,10 @@ impl Handler for Tui { repo_state .update_message(format!("advancing next to {commit}"), ACTING); } + RepoUpdate::NextUpdated => { + // TODO: update log too + repo_state.update_message("next updated - pause while CI starts", OKAY); + } RepoUpdate::AdvancingMain { commit } => { repo_state .update_message(format!("advancing main to {commit}"), ACTING);