mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
Standardize TUI picker presentation and fix wrapping boundaries (#46691)
## Why Menu layouts and hints vary across TUI flows, and mismatched measurement and rendering widths can clip subsequent choices when descriptions wrap. ## What changed - Apply shared picker styling across selection menus, with stable columns, descriptions hidden when space is tight, and compact hints derived from configured key bindings. - Measure rows at their actual rendering width, including caller insets, so wrapped options receive enough space. - Wrap model menu headers and shortcut capture content, and use the shared panel surface for shortcut capture. - Indicate clipped headers in non-searchable menus and show the configured `view all` shortcut only when the view supplies one. ## Testing Add regression tests and snapshots for wrapping boundaries, narrow picker layouts, configured selection and cancellation keys, and clipped approval headers. Verify that copy/export actions retain complete payloads and composer drafts. GitOrigin-RevId: 8416bcd3c66b6cd15db3f9c1804f5f005b7964c1
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
use super::*;
|
||||
use crate::app_event::TranscriptExportDestination;
|
||||
use crate::bottom_pane::popup_consts::picker_hint_line_for_keymap;
|
||||
|
||||
impl ChatWidget {
|
||||
pub(crate) fn copy_transcript_to_clipboard(&mut self, markdown: &str) {
|
||||
@@ -24,9 +25,15 @@ impl ChatWidget {
|
||||
|
||||
pub(super) fn show_transcript_export_popup(&mut self) {
|
||||
self.show_selection_view(SelectionViewParams {
|
||||
title: Some("Export conversation".to_string()),
|
||||
subtitle: Some("Save the complete conversation as Markdown".to_string()),
|
||||
footer_hint: Some(standard_popup_hint_line()),
|
||||
appearance: crate::bottom_pane::SelectionAppearance::Picker,
|
||||
header: Box::new(
|
||||
Paragraph::new(vec![
|
||||
Line::from("Export conversation".bold()),
|
||||
Line::from("Save the complete conversation as Markdown".dim()),
|
||||
])
|
||||
.wrap(Wrap { trim: false }),
|
||||
),
|
||||
footer_hint: Some(picker_hint_line_for_keymap(&self.bottom_pane.list_keymap())),
|
||||
items: vec![
|
||||
SelectionItem {
|
||||
name: "Copy to clipboard".to_string(),
|
||||
@@ -50,7 +57,7 @@ impl ChatWidget {
|
||||
..Default::default()
|
||||
},
|
||||
],
|
||||
..Default::default()
|
||||
..SelectionViewParams::picker()
|
||||
});
|
||||
self.defer_input_until_settings_applied();
|
||||
self.request_redraw();
|
||||
|
||||
Reference in New Issue
Block a user