mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Upgrade Ratatui to 0.30.2 (#35959)
## What changed - Upgrade `ratatui`, `ratatui-macros`, `crossterm`, and `ansi-to-tui`, and adapt the TUI to their updated rendering, backend, color-conversion, and cell APIs. - Use Ratatui's cell-width and continuation-cell metadata when mapping OSC 8 hyperlinks so links remain aligned across wrapped wide glyphs and halfwidth characters with dakuten. - Preserve explicit hyperlinks in the sign-in success screen and empty MCP state without embedding escape sequences in the text passed to Ratatui. ## Testing - Add regression coverage for hyperlink placement across wide glyphs and halfwidth dakuten, hyperlink preservation in onboarding and MCP output, and display-width handling. GitOrigin-RevId: 8460873e5a266923acd0417bc46264845eab0134
This commit is contained in:
1 parent
e1895710ad
commit
00cb5c465b
43 files changed
+1097
-303
No files matched your search
@@ -47,7 +47,6 @@ use ratatui::text::Text;
|
||||
use ratatui::widgets::Clear;
|
||||
use ratatui::widgets::Paragraph;
|
||||
use ratatui::widgets::Widget;
|
||||
use ratatui::widgets::WidgetRef;
|
||||
use ratatui::widgets::Wrap;
|
||||
|
||||
pub(crate) enum Overlay {
|
||||
@@ -113,7 +112,7 @@ fn render_key_hints(area: Rect, buf: &mut Buffer, pairs: &[(Vec<KeyBinding>, &st
|
||||
spans.push(Span::from(desc.to_string()));
|
||||
first = false;
|
||||
}
|
||||
Paragraph::new(vec![Line::from(spans).dim()]).render_ref(area, buf);
|
||||
Paragraph::new(vec![Line::from(spans).dim()]).render(area, buf);
|
||||
}
|
||||
|
||||
/// Generic widget for rendering a pager view.
|
||||
@@ -177,9 +176,9 @@ impl PagerView {
|
||||
fn render_header(&self, area: Rect, buf: &mut Buffer) {
|
||||
Span::from("/ ".repeat(area.width as usize / 2))
|
||||
.dim()
|
||||
.render_ref(area, buf);
|
||||
.render(area, buf);
|
||||
let header = format!("/ {}", self.title);
|
||||
header.dim().render_ref(area, buf);
|
||||
header.dim().render(area, buf);
|
||||
}
|
||||
|
||||
fn render_content(&self, area: Rect, buf: &mut Buffer) {
|
||||
@@ -230,7 +229,7 @@ impl PagerView {
|
||||
|
||||
Span::from("─".repeat(sep_rect.width as usize))
|
||||
.dim()
|
||||
.render_ref(sep_rect, buf);
|
||||
.render(sep_rect, buf);
|
||||
let percent = if total_len == 0 {
|
||||
100
|
||||
} else {
|
||||
@@ -247,7 +246,7 @@ impl PagerView {
|
||||
let pct_x = sep_rect.x + sep_rect.width - pct_w - 1;
|
||||
Span::from(pct_text)
|
||||
.dim()
|
||||
.render_ref(Rect::new(pct_x, sep_rect.y, pct_w, 1), buf);
|
||||
.render(Rect::new(pct_x, sep_rect.y, pct_w, 1), buf);
|
||||
}
|
||||
|
||||
fn handle_key_event(&mut self, tui: &mut tui::Tui, key_event: KeyEvent) -> Result<()> {
|
||||
|
||||
Reference in new issue
Block a user