mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:23:33 +00:00
fix(tui/history): append merge completion banner
This commit is contained in:
@@ -429,6 +429,13 @@ impl App<'_> {
|
||||
}
|
||||
AppState::Onboarding { .. } => {}
|
||||
},
|
||||
AppEvent::InsertBackgroundEventLate(message) => match &mut self.app_state {
|
||||
AppState::Chat { widget } => {
|
||||
tracing::debug!("app: InsertBackgroundEventLate len={}", message.len());
|
||||
widget.insert_background_event_late(message);
|
||||
}
|
||||
AppState::Onboarding { .. } => {}
|
||||
},
|
||||
AppEvent::RequestRedraw => {
|
||||
self.schedule_redraw();
|
||||
}
|
||||
|
||||
@@ -145,6 +145,9 @@ pub(crate) enum AppEvent {
|
||||
/// Insert a background event near the top of the current request so it
|
||||
/// appears above imminent provider output (e.g. above Exec begin).
|
||||
InsertBackgroundEventEarly(String),
|
||||
/// Insert a background event at the end of the current request so it
|
||||
/// follows previously rendered content.
|
||||
InsertBackgroundEventLate(String),
|
||||
|
||||
#[allow(dead_code)]
|
||||
StartCommitAnimation,
|
||||
|
||||
@@ -60,4 +60,10 @@ impl AppEventSender {
|
||||
self.send(AppEvent::InsertBackgroundEventEarly(message.into()));
|
||||
}
|
||||
|
||||
/// Emit a background event appended to the current request window so it
|
||||
/// shows up after previously rendered content.
|
||||
pub(crate) fn send_background_event_late(&self, message: impl Into<String>) {
|
||||
self.send(AppEvent::InsertBackgroundEventLate(message.into()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2644,6 +2644,15 @@ impl ChatWidget<'_> {
|
||||
None,
|
||||
);
|
||||
}
|
||||
/// Insert a background event at the tail of the current request.
|
||||
pub(crate) fn insert_background_event_late(&mut self, message: String) {
|
||||
self.push_system_cell(
|
||||
history_cell::new_background_event(message),
|
||||
SystemPlacement::EndOfCurrent,
|
||||
None,
|
||||
None,
|
||||
);
|
||||
}
|
||||
/// Push a cell using a synthetic key at the TOP of the NEXT request.
|
||||
fn history_push_top_next_req(&mut self, cell: impl HistoryCell + 'static) {
|
||||
let key = self.next_req_key_top();
|
||||
@@ -9336,6 +9345,10 @@ impl ChatWidget<'_> {
|
||||
tx.send_background_event(message);
|
||||
}
|
||||
|
||||
fn send_background_late(tx: &AppEventSender, message: String) {
|
||||
tx.send_background_event_late(message);
|
||||
}
|
||||
|
||||
let git_root = match codex_core::git_info::resolve_root_git_project_for_trust(&work_cwd)
|
||||
{
|
||||
Some(p) => p,
|
||||
@@ -9885,7 +9898,7 @@ impl ChatWidget<'_> {
|
||||
default_branch,
|
||||
git_root.display()
|
||||
);
|
||||
send_background(&tx, msg);
|
||||
send_background_late(&tx, msg);
|
||||
tx.send(AppEvent::SwitchCwd(git_root, None));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -7706,7 +7706,7 @@ pub(crate) fn new_plan_update(update: UpdatePlanArgs) -> PlanUpdateCell {
|
||||
Span::styled(
|
||||
step,
|
||||
Style::default()
|
||||
.fg(crate::colors::success())
|
||||
.fg(crate::colors::text_bright())
|
||||
.add_modifier(Modifier::BOLD),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user