mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
Persist local workspace side chats and add tab close controls (#60152)
## What changed - Save side chats as attachments to their parent conversation when local workspace history supports them, and let users reopen them from the sidebar after a restart. - Show chat names or first-prompt previews in sidebar labels, and allow saved side chats to be renamed with `/rename`. - Add tab close buttons, middle-click closing, and the configurable `close_sidebar_tab` shortcut, defaulting to `Ctrl-X W`. Closing a saved chat keeps it available in the picker; archiving removes it from Side chats. - Confirm actions that stop running work, discard unsent input, or lose temporary history. Delete saved TUI side chats when deleting their parent conversation. ## Testing Add coverage for reopening saved side chats after restart, archive handling, close confirmations, and preventing close-confirmation keys from accepting a replacement approval dialog. GitOrigin-RevId: 3d47533d007286a7354660c08df13a83dd48d5d7
This commit is contained in:
@@ -108,6 +108,7 @@ pub(crate) struct AppKeymap {
|
||||
pub(crate) focus_sidebar_content: Vec<KeyBinding>,
|
||||
pub(crate) focus_sidebar_tabs: Vec<KeyBinding>,
|
||||
pub(crate) hide_pane: Vec<KeyBinding>,
|
||||
pub(crate) close_sidebar_tab: Vec<KeyBinding>,
|
||||
pub(crate) focus_pane_left: Vec<KeyBinding>,
|
||||
pub(crate) focus_pane_right: Vec<KeyBinding>,
|
||||
pub(crate) minimize_pane_width: Vec<KeyBinding>,
|
||||
@@ -710,6 +711,7 @@ impl RuntimeKeymap {
|
||||
classic_keymap.global.focus_sidebar_content = None;
|
||||
classic_keymap.global.focus_sidebar_tabs = None;
|
||||
classic_keymap.global.hide_pane = None;
|
||||
classic_keymap.global.close_sidebar_tab = None;
|
||||
classic_keymap.global.focus_pane_left = None;
|
||||
classic_keymap.global.focus_pane_right = None;
|
||||
&classic_keymap
|
||||
@@ -785,6 +787,11 @@ impl RuntimeKeymap {
|
||||
&[],
|
||||
"tui.keymap.global.hide_pane",
|
||||
)?,
|
||||
close_sidebar_tab: resolve_bindings(
|
||||
keymap.global.close_sidebar_tab.as_ref(),
|
||||
&[],
|
||||
"tui.keymap.global.close_sidebar_tab",
|
||||
)?,
|
||||
focus_pane_left: resolve_bindings(
|
||||
keymap.global.focus_pane_left.as_ref(),
|
||||
&[],
|
||||
@@ -1809,6 +1816,7 @@ impl RuntimeKeymap {
|
||||
focus_sidebar_content: Vec::new(),
|
||||
focus_sidebar_tabs: Vec::new(),
|
||||
hide_pane: Vec::new(),
|
||||
close_sidebar_tab: Vec::new(),
|
||||
focus_pane_left: Vec::new(),
|
||||
focus_pane_right: Vec::new(),
|
||||
minimize_pane_width: Vec::new(),
|
||||
@@ -2189,6 +2197,7 @@ impl RuntimeKeymap {
|
||||
("global.move_divider_right", &self.app.move_divider_right),
|
||||
("global.toggle_pane_zoom", &self.app.toggle_pane_zoom),
|
||||
("global.hide_pane", &self.app.hide_pane),
|
||||
("global.close_sidebar_tab", &self.app.close_sidebar_tab),
|
||||
("chat.open_presets", &self.chat.open_presets),
|
||||
("chat.toggle_voice", &self.chat.toggle_voice),
|
||||
] {
|
||||
@@ -2239,6 +2248,7 @@ impl RuntimeKeymap {
|
||||
("move_divider_right", divider_right),
|
||||
("toggle_pane_zoom", self.app.toggle_pane_zoom.as_slice()),
|
||||
("hide_pane", self.app.hide_pane.as_slice()),
|
||||
("close_sidebar_tab", self.app.close_sidebar_tab.as_slice()),
|
||||
("open_agents", self.app.open_agents.as_slice()),
|
||||
("open_transcript", self.app.open_transcript.as_slice()),
|
||||
("find_transcript", self.app.find_transcript.as_slice()),
|
||||
@@ -2426,6 +2436,7 @@ impl RuntimeKeymap {
|
||||
("move_divider_right", divider_right),
|
||||
("toggle_pane_zoom", self.app.toggle_pane_zoom.as_slice()),
|
||||
("hide_pane", self.app.hide_pane.as_slice()),
|
||||
("close_sidebar_tab", self.app.close_sidebar_tab.as_slice()),
|
||||
("open_agents", self.app.open_agents.as_slice()),
|
||||
("open_transcript", self.app.open_transcript.as_slice()),
|
||||
("find_transcript", self.app.find_transcript.as_slice()),
|
||||
@@ -2582,6 +2593,10 @@ impl RuntimeKeymap {
|
||||
self.app.toggle_pane_zoom.as_slice(),
|
||||
),
|
||||
("global.hide_pane", self.app.hide_pane.as_slice()),
|
||||
(
|
||||
"global.close_sidebar_tab",
|
||||
self.app.close_sidebar_tab.as_slice(),
|
||||
),
|
||||
(
|
||||
"global.select_transcript",
|
||||
self.app.select_transcript.as_slice(),
|
||||
@@ -2645,6 +2660,10 @@ impl RuntimeKeymap {
|
||||
self.app.toggle_pane_zoom.as_slice(),
|
||||
),
|
||||
("global.hide_pane", self.app.hide_pane.as_slice()),
|
||||
(
|
||||
"global.close_sidebar_tab",
|
||||
self.app.close_sidebar_tab.as_slice(),
|
||||
),
|
||||
("global.focus_activity", self.app.focus_activity.as_slice()),
|
||||
(
|
||||
"global.find_transcript",
|
||||
|
||||
Reference in New Issue
Block a user