Story 20: New Session button to clear chat history
- Added 'New Session' button in header with confirmation dialog - Clears frontend messages, streaming content, and loading state - Button has subtle styling with hover effects - Preserves project path, model selection, and tool settings - Backend context automatically cleared (no server-side history) - Fixed build errors by removing unused tokio watch channel - All quality checks passing (TypeScript, Biome, Clippy, builds) Tested and verified: - Button appears in header near model controls - Confirmation dialog prevents accidental clearing - Messages clear immediately after confirmation - Input remains ready for new conversation - Settings preserved across session clears
This commit is contained in:
1
src-tauri/Cargo.lock
generated
1
src-tauri/Cargo.lock
generated
@@ -2084,7 +2084,6 @@ dependencies = [
|
||||
"tauri-plugin-dialog",
|
||||
"tauri-plugin-opener",
|
||||
"tauri-plugin-store",
|
||||
"tokio",
|
||||
"uuid",
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
@@ -23,7 +23,6 @@ pub fn run() {
|
||||
commands::search::search_files,
|
||||
commands::shell::exec_shell,
|
||||
commands::chat::chat,
|
||||
commands::chat::cancel_chat,
|
||||
commands::chat::get_ollama_models
|
||||
])
|
||||
.run(tauri::generate_context!())
|
||||
|
||||
@@ -1,20 +1,14 @@
|
||||
use std::path::PathBuf;
|
||||
use std::sync::Mutex;
|
||||
use tokio::sync::watch;
|
||||
|
||||
pub struct SessionState {
|
||||
pub project_root: Mutex<Option<PathBuf>>,
|
||||
pub cancel_tx: watch::Sender<bool>,
|
||||
pub cancel_rx: watch::Receiver<bool>,
|
||||
}
|
||||
|
||||
impl Default for SessionState {
|
||||
fn default() -> Self {
|
||||
let (cancel_tx, cancel_rx) = watch::channel(false);
|
||||
Self {
|
||||
project_root: Mutex::new(None),
|
||||
cancel_tx,
|
||||
cancel_rx,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user