mirror of
https://github.com/openai/codex.git
synced 2026-11-13 21:30:47 +00:00
## Why An empty composer hint row already separates activity from the input. Adding another separator wastes transcript space, especially in short terminals. ## What changed Reserve the extra separator only when copy status text, a follow control, or a fitting hint occupies the shared row and the viewport has room. Recalculate the transcript layout in the same frame when adding that separator, and use a shared timestamp for copy status visibility and expiry. ## Testing Extend snapshots for running turns with no hint, follow controls in short terminals, and copy status text at narrow widths and limited heights. Update resize assertions to check that the draft and caret remain stable relative to the terminal bottom. GitOrigin-RevId: a73894063b759ec6b9a25f720e0e8007516109c8
28 lines
793 B
Rust
28 lines
793 B
Rust
//! Reserve the owned transcript's hint row immediately above the composer.
|
|
//! The app paints its shared hints and reading controls into the per-frame layout rectangle.
|
|
|
|
use std::cell::Cell;
|
|
|
|
use ratatui::buffer::Buffer;
|
|
use ratatui::layout::Rect;
|
|
|
|
use crate::render::renderable::Renderable;
|
|
|
|
#[derive(Default)]
|
|
pub(crate) struct ComposerGap {
|
|
/// Visible text needs a separator after activity when the viewport has room for it.
|
|
pub(crate) needs_separator: bool,
|
|
/// Filled during rendering; a fresh instance prevents reusing a hidden or clipped row.
|
|
pub(crate) area: Cell<Rect>,
|
|
}
|
|
|
|
impl Renderable for ComposerGap {
|
|
fn render(&self, area: Rect, _buf: &mut Buffer) {
|
|
self.area.set(area);
|
|
}
|
|
|
|
fn desired_height(&self, _width: u16) -> u16 {
|
|
1
|
|
}
|
|
}
|