mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
better composer
This commit is contained in:
@@ -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 (don’t 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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user