Preserve multiline status lines in unfocused chat panes (#61141)

## Why

Unfocused chat panes reduced status content to a single dim line, hiding rows that were visible while focused.

## What changed

- Share status measurement, wrapping, rendering, and footer row allocation between the main conversation and side chats.
- Retain structured status content in inactive side chats so native and extension status lines can use the available rows and reflow when resized.
- Keep unfocused status content dimmed with hyperlinks suppressed, while respecting space reserved for the draft and footer hints.

## Testing

Add regression coverage for status reflow across split-pane focus switches and resizing, and update extension status coverage to verify multiple dimmed rows when unfocused.

GitOrigin-RevId: f4def37259fe106d6a3fac9fe4c6cc2d4972f244
This commit is contained in:
Felipe Coury
2026-11-12 15:09:13 +00:00
committed by copyberry
parent 6aa83e5eee
commit d0edb0b1fa
23 changed files with 572 additions and 339 deletions
+18 -3
View File
@@ -21,6 +21,7 @@ use ratatui::buffer::Buffer;
use ratatui::layout::Rect;
use ratatui::layout::Size;
use ratatui::style::Modifier;
use ratatui::style::Style;
use ratatui::text::Span;
use std::ops::Range;
use syntect::highlighting::Theme;
@@ -52,7 +53,14 @@ impl PreparedUiTree {
layout(self.0.as_ref(), bounds, /*draw*/ None)
}
pub(crate) fn render(&self, area: Rect, theme: &Theme, buf: &mut Buffer) {
/// A plain style paints the same layout with theme styling and hyperlinks suppressed.
pub(crate) fn render(
&self,
area: Rect,
theme: &Theme,
buf: &mut Buffer,
plain_style: Option<Style>,
) {
let area = area.intersection(buf.area);
let mut theme = RenderTheme::new(theme);
layout(
@@ -61,8 +69,15 @@ impl PreparedUiTree {
Some(&mut |row, col, text, cells, paint| {
let x = area.x + col as u16;
let y = area.y + row as u16;
buf.set_string(x, y, text, paint.style(&mut theme));
if let Some(href) = &paint.href {
buf.set_string(
x,
y,
text,
plain_style.unwrap_or_else(|| paint.style(&mut theme)),
);
if plain_style.is_none()
&& let Some(href) = &paint.href
{
mark_hyperlink_cells(buf, Rect::new(x, y, cells as u16, 1), href);
}
}),