mirror of
https://github.com/openai/codex.git
synced 2026-11-26 23:40:43 +00:00
Keep fullscreen prompts bounded and scrollable (#50109)
## Why Long drafts need to remain browsable while leaving room for the transcript. Remote image attachments also need to leave an editable prompt row visible. ## What changed - Cap the fullscreen composer, including padding and hints, at two-thirds of the screen, with a minimum of eight rows when the screen allows. - Support mouse-wheel browsing without moving the caret or changing transcript selection, search, or activity focus. Show arrows for hidden prompt rows and hide the cursor when the caret is offscreen. - Resume caret following on editor input, paste, and external edits. - Keep the selected remote image visible while reserving space for prompt text. ## Testing Add regression tests and snapshots for fullscreen scrolling, caret restoration after navigation, paste and external edits, remote image navigation and deletion, resizing at scroll boundaries, and disconnected editing. GitOrigin-RevId: 9a1e4ce14b3b3747e6d136207546327531339258
This commit is contained in:
@@ -132,12 +132,8 @@ impl ChatWidget {
|
||||
.selected_index_for_active_view(crate::app::AGENTS_OVERVIEW_VIEW_ID)
|
||||
.is_some()
|
||||
{
|
||||
return self.bottom_pane_renderable(
|
||||
/*footer*/ None,
|
||||
crate::bottom_pane::CommandPopupPlacement::AboveComposer,
|
||||
/*composer_gap*/ None,
|
||||
/*working_tip*/ None,
|
||||
);
|
||||
return self
|
||||
.bottom_pane_renderable(crate::bottom_pane::ComposerRenderOptions::default());
|
||||
}
|
||||
|
||||
let active_cell_right_reserve = self.ambient_pet_wrap_reserved_cols();
|
||||
@@ -198,15 +194,10 @@ impl ChatWidget {
|
||||
}
|
||||
flex.push(
|
||||
/*flex*/ 0,
|
||||
self.bottom_pane_renderable(
|
||||
/*footer*/ None,
|
||||
crate::bottom_pane::CommandPopupPlacement::AboveComposer,
|
||||
/*composer_gap*/ None,
|
||||
/*working_tip*/ None,
|
||||
)
|
||||
.inset(Insets::tlbr(
|
||||
/*top*/ 1, /*left*/ 0, /*bottom*/ 0, /*right*/ 0,
|
||||
)),
|
||||
self.bottom_pane_renderable(crate::bottom_pane::ComposerRenderOptions::default())
|
||||
.inset(Insets::tlbr(
|
||||
/*top*/ 1, /*left*/ 0, /*bottom*/ 0, /*right*/ 0,
|
||||
)),
|
||||
);
|
||||
RenderableItem::Owned(Box::new(flex))
|
||||
}
|
||||
@@ -217,10 +208,7 @@ impl ChatWidget {
|
||||
/// remain consistent. Owned transcripts reserve their shared hint row above the composer.
|
||||
pub(crate) fn bottom_pane_renderable<'a>(
|
||||
&'a self,
|
||||
footer: Option<&'a crate::bottom_pane::TranscriptFooter>,
|
||||
command_popup_placement: crate::bottom_pane::CommandPopupPlacement,
|
||||
composer_gap: Option<&'a crate::bottom_pane::ComposerGap>,
|
||||
working_tip: Option<&'a crate::turn_tip::TurnTip>,
|
||||
mut options: crate::bottom_pane::ComposerRenderOptions<'a>,
|
||||
) -> RenderableItem<'a> {
|
||||
if self.fork_in_progress {
|
||||
RenderableItem::Owned(Box::new(
|
||||
@@ -244,17 +232,11 @@ impl ChatWidget {
|
||||
} else {
|
||||
self.ambient_pet_wrap_reserved_cols()
|
||||
};
|
||||
self.bottom_pane
|
||||
.as_renderable_with_options(crate::bottom_pane::ComposerRenderOptions {
|
||||
composer_gap,
|
||||
working_tip,
|
||||
warning_count: self.warning_display_state.count,
|
||||
textarea_right_reserve: right_reserve,
|
||||
separate_status_line: command_popup_placement
|
||||
!= crate::bottom_pane::CommandPopupPlacement::AboveComposer,
|
||||
command_popup_placement,
|
||||
footer,
|
||||
})
|
||||
options.warning_count = self.warning_display_state.count;
|
||||
options.textarea_right_reserve = right_reserve;
|
||||
options.separate_status_line = options.command_popup_placement
|
||||
!= crate::bottom_pane::CommandPopupPlacement::AboveComposer;
|
||||
self.bottom_pane.as_renderable_with_options(options)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user