Merge remote-tracking branch 'origin/main'

This commit is contained in:
xintaofei
2026-03-13 00:18:09 +08:00
2 changed files with 18 additions and 9 deletions

View File

@@ -84,6 +84,10 @@ fn list_conversations_sync(
.as_ref()
.map(|b| b.to_lowercase().contains(&query_lower))
.unwrap_or(false)
|| s.model
.as_ref()
.map(|m| m.to_lowercase().contains(&query_lower))
.unwrap_or(false)
});
}

View File

@@ -49,18 +49,23 @@ impl GeminiParser {
}
fn list_chat_files(&self) -> Vec<PathBuf> {
let tmp_dir = self.tmp_dir();
if !tmp_dir.exists() {
return Vec::new();
let mut files: Vec<PathBuf> = Vec::new();
// Scan both tmp/ (active sessions) and history/ (archived sessions)
for dir in [self.tmp_dir(), self.history_dir()] {
if !dir.exists() {
continue;
}
let found = WalkDir::new(&dir)
.into_iter()
.filter_map(|e| e.ok())
.map(|e| e.path().to_path_buf())
.filter(|p| p.is_file() && Self::is_chat_file(p));
files.extend(found);
}
let mut files: Vec<PathBuf> = WalkDir::new(&tmp_dir)
.into_iter()
.filter_map(|e| e.ok())
.map(|e| e.path().to_path_buf())
.filter(|p| p.is_file() && Self::is_chat_file(p))
.collect();
files.sort();
files.dedup();
files
}