Re-add markdown streaming (#2029)

Wait for newlines, then render markdown on a line by line basis. Word wrap it for the current terminal size and then spit it out line by line into the UI. Also adds tests and fixes some UI regressions.
This commit is contained in:
easong-openai
2025-08-12 17:37:28 -07:00
committed by GitHub
parent 97a27ffc77
commit 6340acd885
42 changed files with 35887 additions and 1026 deletions

View File

@@ -35,8 +35,6 @@ pub(crate) enum ApprovalRequest {
Exec {
id: String,
command: Vec<String>,
#[allow(dead_code)]
cwd: PathBuf,
reason: Option<String>,
},
ApplyPatch {
@@ -394,7 +392,6 @@ mod tests {
use crossterm::event::KeyCode;
use crossterm::event::KeyEvent;
use crossterm::event::KeyModifiers;
use std::path::PathBuf;
use std::sync::mpsc::channel;
#[test]
@@ -404,7 +401,6 @@ mod tests {
let req = ApprovalRequest::Exec {
id: "1".to_string(),
command: vec!["echo".to_string()],
cwd: PathBuf::new(),
reason: None,
};
let mut widget = UserApprovalWidget::new(req, tx);
@@ -427,7 +423,6 @@ mod tests {
let req = ApprovalRequest::Exec {
id: "2".to_string(),
command: vec!["echo".to_string()],
cwd: PathBuf::new(),
reason: None,
};
let mut widget = UserApprovalWidget::new(req, tx);