mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
feat: reset memories button (#17937)
<img width="720" height="175" alt="Screenshot 2026-04-15 at 14 35 02" src="https://github.com/user-attachments/assets/041d73ff-8c16-42a9-8e92-c245805084f0" />
This commit is contained in:
committed by
GitHub
Unverified
parent
ec13aaac89
commit
da86cedbd4
+12
@@ -0,0 +1,12 @@
|
||||
---
|
||||
source: tui/src/chatwidget/tests/popups_and_settings.rs
|
||||
expression: popup
|
||||
---
|
||||
Reset all memories?
|
||||
|
||||
› Reset all memories Delete local memory files and rollout summaries.
|
||||
Go back Return to memory settings.
|
||||
|
||||
|
||||
|
||||
Press enter to confirm or esc to go back
|
||||
+3
-1
@@ -9,7 +9,9 @@ expression: popup
|
||||
next thread.
|
||||
[ ] Generate memories Generate memories from the following threads. Current
|
||||
thread included.
|
||||
Reset all memories Clear local memory files and summaries. Existing
|
||||
threads stay intact.
|
||||
|
||||
Learn more: https://developers.openai.com/codex/memories
|
||||
|
||||
Press space to toggle; enter to save
|
||||
Press space to toggle; enter to save or select
|
||||
|
||||
@@ -1543,6 +1543,22 @@ async fn memories_settings_popup_snapshot() {
|
||||
assert_chatwidget_snapshot!("memories_settings_popup", popup);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn memories_reset_confirmation_snapshot() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.set_feature_enabled(Feature::MemoryTool, /*enabled*/ true);
|
||||
chat.config.memories.use_memories = true;
|
||||
chat.config.memories.generate_memories = false;
|
||||
|
||||
chat.open_memories_popup();
|
||||
chat.handle_key_event(KeyEvent::from(KeyCode::Down));
|
||||
chat.handle_key_event(KeyEvent::from(KeyCode::Down));
|
||||
chat.handle_key_event(KeyEvent::from(KeyCode::Enter));
|
||||
|
||||
let popup = render_bottom_popup(&chat, /*width*/ 80);
|
||||
assert_chatwidget_snapshot!("memories_reset_confirmation", popup);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn memories_settings_toggle_saves_on_enter() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
@@ -1564,6 +1580,22 @@ async fn memories_settings_toggle_saves_on_enter() {
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn memories_reset_confirmation_sends_event_on_confirm() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.set_feature_enabled(Feature::MemoryTool, /*enabled*/ true);
|
||||
chat.config.memories.use_memories = true;
|
||||
chat.config.memories.generate_memories = false;
|
||||
|
||||
chat.open_memories_popup();
|
||||
chat.handle_key_event(KeyEvent::from(KeyCode::Down));
|
||||
chat.handle_key_event(KeyEvent::from(KeyCode::Down));
|
||||
chat.handle_key_event(KeyEvent::from(KeyCode::Enter));
|
||||
chat.handle_key_event(KeyEvent::from(KeyCode::Enter));
|
||||
|
||||
assert_matches!(rx.try_recv(), Ok(AppEvent::ResetMemories));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn model_selection_popup_snapshot() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5-codex")).await;
|
||||
|
||||
Reference in New Issue
Block a user