Repository: openai/codex
File: codex-rs/tui2/src/history_cell.rs (Rust)

Code before:
            return Vec::new();
        };

        let make_row = |spans: Vec<Span<'static>>| Line::from(spans);

        // Title line rendered inside the box: ">_ OpenAI Codex (vX)"
        let title_spans: Vec<Span<'static>> = vec![
            Span::from(">_ ").dim(),
            Span::from("OpenAI Codex").bold(),
            Span::from(" ").dim(),
            Span::from(format!("(v{})", self.version)).dim(),
        ];

        const CHANGE_MODEL_HINT_COMMAND: &str = "/model";
        const CHANGE_MODEL_HINT_EXPLANATION: &str = " to change";
        const CHANGE_MODE_HINT_EXPLANATION: &str = " to change mode";
        const DIR_LABEL: &str = "directory:";
        let label_width = DIR_LABEL.len();
        let model_spans: Vec<Span<'static>> = if self.is_collaboration {
            let collab_label = format!(
                "{collab_label:<label_width$}",
                collab_label = "mode:",
                label_width = label_width
            );
            let mut spans = vec![Span::from(format!("{collab_label} ")).dim()];
            if self.model == "loading" {
                spans.push(Span::styled(self.model.clone(), self.model_style));
            } else if let Some(mode_label) = self.collaboration_mode_label() {
                spans.push(Span::styled(mode_label.to_string(), self.model_style));
            } else {
                spans.push(Span::styled("Custom", self.model_style));
            }
            spans.push("   ".dim());
            let shift_tab_span: Span<'static> = key_hint::shift(KeyCode::Tab).into();
            spans.push(shift_tab_span.cyan());
            spans.push(CHANGE_MODE_HINT_EXPLANATION.dim());
            spans
        } else {
            let model_label = format!(
                "{model_label:<label_width$}",
                model_label = "model:",
                label_width = label_width
            );
            let reasoning_label = self.reasoning_label();
            let mut spans = vec![
                Span::from(format!("{model_label} ")).dim(),
                Span::styled(self.model.clone(), self.model_style),
            ];
            if let Some(reasoning) = reasoning_label {
                spans.push(Span::from(" "));
                spans.push(Span::from(reasoning));

Review comment (suggestion):
Placeholder detection in collaboration headers relies on the literal "loading". If DEFAULT_MODEL_DISPLAY_NAME ever changes, placeholders will silently fall back to showing a mode
label instead of “loading.” Consider sharing the constant or passing an explicit placeholder flag.

Code after:
        let Some(inner_width) = card_inner_width(width, SESSION_HEADER_MAX_INNER_WIDTH) else {
            return Vec::new();
        };

        let make_row = |spans: Vec<Span<'static>>| Line::from(spans);

        // Title line rendered inside the box: ">_ OpenAI Codex (vX)"
        let title_spans: Vec<Span<'static>> = vec![
            Span::from(">_ ").dim(),
            Span::from("OpenAI Codex").bold(),
            Span::from(" ").dim(),
            Span::from(format!("(v{})", self.version)).dim(),
        ];

        const CHANGE_MODEL_HINT_COMMAND: &str = "/model";
        const CHANGE_MODEL_HINT_EXPLANATION: &str = " to change";
        const CHANGE_MODE_HINT_EXPLANATION: &str = " to change mode";
        const DIR_LABEL: &str = "directory:";
        let label_width = DIR_LABEL.len();
        let model_spans: Vec<Span<'static>> = if self.is_collaboration {
            let collab_label = format!(
                "{collab_label:<label_width$}",
                collab_label = "mode:",
                label_width = label_width
            );
            let mut spans = vec![Span::from(format!("{collab_label} ")).dim()];
            if self.model == DEFAULT_MODEL_DISPLAY_NAME {
                spans.push(Span::styled(self.model.clone(), self.model_style));
            } else if let Some(mode_label) = self.collaboration_mode_label() {
                spans.push(Span::styled(mode_label.to_string(), self.model_style));
            } else {
                spans.push(Span::styled("Custom", self.model_style));
            }
            spans.push("   ".dim());
            let shift_tab_span: Span<'static> = key_hint::shift(KeyCode::Tab).into();
            spans.push(shift_tab_span.cyan());
            spans.push(CHANGE_MODE_HINT_EXPLANATION.dim());
            spans
        } else {
            let model_label = format!(
                "{model_label:<label_width$}",
                model_label = "model:",
                label_width = label_width
            );
            let reasoning_label = self.reasoning_label();
            let mut spans = vec![
                Span::from(format!("{model_label} ")).dim(),
                Span::styled(self.model.clone(), self.model_style),
            ];
            if let Some(reasoning) = reasoning_label {
                spans.push(Span::from(" "));