tui: refactor ChatWidget and BottomPane to use Renderables (#5565)

- introduce RenderableItem to support both owned and borrowed children
in composite Renderables
- refactor some of our gnarlier manual layouts, BottomPane and
ChatWidget, to use ColumnRenderable
- Renderable and friends now handle cursor_pos()
This commit is contained in:
Jeremy Rose
2025-11-05 09:50:40 -08:00
committed by GitHub
parent 9a10e80ab7
commit 62474a30e8
27 changed files with 512 additions and 440 deletions

View File

@@ -7,13 +7,13 @@
use crossterm::event::KeyEvent;
use ratatui::buffer::Buffer;
use ratatui::layout::Rect;
use ratatui::widgets::WidgetRef;
use std::time::Duration;
use crate::app_event::AppEvent;
use crate::app_event_sender::AppEventSender;
use crate::bottom_pane::ChatComposer;
use crate::bottom_pane::InputResult;
use crate::render::renderable::Renderable;
/// Action returned from feeding a key event into the ComposerInput.
pub enum ComposerAction {
@@ -94,7 +94,7 @@ impl ComposerInput {
/// Render the input into the provided buffer at `area`.
pub fn render_ref(&self, area: Rect, buf: &mut Buffer) {
WidgetRef::render_ref(&self.inner, area, buf);
self.inner.render(area, buf);
}
/// Return true if a paste-burst detection is currently active.