mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
Preserve clickable URLs in TUI approval headers (#51439)
## What changed Render command, permission, patch, and MCP elicitation approval headers with `HyperlinkText`, which annotates web URLs and preserves their full destinations across wrapping and clipping. ## Testing Add a regression test covering wrapped URL destinations in all four header types, plus a snapshot of the wrapped command approval header. GitOrigin-RevId: 7f6b79484c9297cd03514da2d6805b0d239fee63
This commit is contained in:
@@ -3,11 +3,10 @@
|
||||
use super::approval_overlay::ApplyPatchApprovalRequest;
|
||||
use crate::diff_model::FileChange;
|
||||
use crate::render::renderable::Renderable;
|
||||
use crate::terminal_hyperlinks::HyperlinkText;
|
||||
use codex_utils_path_uri::LegacyAppPathString;
|
||||
use ratatui::style::Stylize;
|
||||
use ratatui::text::Line;
|
||||
use ratatui::widgets::Paragraph;
|
||||
use ratatui::widgets::Wrap;
|
||||
|
||||
pub(super) fn build_header(request: &ApplyPatchApprovalRequest) -> Box<dyn Renderable> {
|
||||
let mut header = Vec::new();
|
||||
@@ -70,5 +69,5 @@ pub(super) fn build_header(request: &ApplyPatchApprovalRequest) -> Box<dyn Rende
|
||||
destination.bold(),
|
||||
]));
|
||||
}
|
||||
Box::new(Paragraph::new(header).wrap(Wrap { trim: false }))
|
||||
Box::new(HyperlinkText::new(header))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user