Revert "refactor transcript view to handle HistoryCells" (#3614)

Reverts openai/codex#3538
It panics on forking first message. It also calculates the index in a
wrong way.
This commit is contained in:
Ahmed Ibrahim
2025-09-14 23:39:36 -04:00
committed by GitHub
parent 6581da9b57
commit 26f1246a89
10 changed files with 391 additions and 311 deletions

View File

@@ -43,7 +43,6 @@ use ratatui::style::Stylize;
use ratatui::widgets::Paragraph;
use ratatui::widgets::WidgetRef;
use ratatui::widgets::Wrap;
use std::any::Any;
use std::collections::HashMap;
use std::io::Cursor;
use std::path::Path;
@@ -70,7 +69,7 @@ pub(crate) enum PatchEventType {
/// Represents an event to display in the conversation history. Returns its
/// `Vec<Line<'static>>` representation to make it easier to display in a
/// scrollable list.
pub(crate) trait HistoryCell: std::fmt::Debug + Send + Sync + Any {
pub(crate) trait HistoryCell: std::fmt::Debug + Send + Sync {
fn display_lines(&self, width: u16) -> Vec<Line<'static>>;
fn transcript_lines(&self) -> Vec<Line<'static>> {
@@ -90,15 +89,9 @@ pub(crate) trait HistoryCell: std::fmt::Debug + Send + Sync + Any {
}
}
impl dyn HistoryCell {
pub(crate) fn as_any(&self) -> &dyn Any {
self
}
}
#[derive(Debug)]
pub(crate) struct UserHistoryCell {
pub message: String,
message: String,
}
impl HistoryCell for UserHistoryCell {