better composer

This commit is contained in:
easong-openai
2025-09-04 19:15:36 -07:00
parent 9be247e41e
commit e5d31d5ccc
2 changed files with 8 additions and 3 deletions

View File

@@ -649,7 +649,11 @@ pub async fn run_main(_cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> a
if key.modifiers.contains(KeyModifiers::CONTROL)
&& matches!(key.code, KeyCode::Char('c') | KeyCode::Char('C'))
{
if app.apply_modal.is_some() {
if app.env_modal.is_some() {
// Close environment selector if open (dont quit composer).
app.env_modal = None;
needs_redraw = true;
} else if app.apply_modal.is_some() {
app.apply_modal = None;
app.status = "Apply canceled".to_string();
needs_redraw = true;

View File

@@ -128,13 +128,14 @@ pub fn draw_new_task_page(frame: &mut Frame, area: Rect, app: &mut App) {
frame.render_widget(block.clone(), area);
let content = block.inner(area);
// Clamp composer height between 3 and 6 rows for readability.
// Expand composer height up to (terminal height - 6), with a 3-line minimum.
let max_allowed = frame.area().height.saturating_sub(6).max(3);
let desired = app
.new_task
.as_ref()
.map(|p| p.composer.desired_height(content.width))
.unwrap_or(3)
.clamp(3, 6);
.clamp(3, max_allowed);
// Anchor the composer to the bottom-left by allocating a flexible spacer
// above it and a fixed `desired`-height area for the composer.