249 feature request better search results (#282)
Some checks failed
Linux / build (push) Has been cancelled
MacOS / build (push) Has been cancelled
Windows / build (push) Has been cancelled

* feat: issue 249 - fuzzy search replaced the old find explorer

* fix: forgot to upload file

* fix: removed debug
This commit is contained in:
Christian Visintin
2024-10-02 17:45:48 +02:00
committed by GitHub
parent c507d54700
commit b2a8a3041c
13 changed files with 625 additions and 226 deletions

View File

@@ -9,15 +9,15 @@ use super::super::browser::FileExplorerTab;
use super::{File, FileTransferActivity, LogLevel, SelectedFile, TransferOpts, TransferPayload};
impl FileTransferActivity {
pub(crate) fn action_local_find(&mut self, input: String) -> Result<Vec<File>, String> {
match self.host.find(input.as_str()) {
pub(crate) fn action_walkdir_local(&mut self) -> Result<Vec<File>, String> {
match self.host.find("*") {
Ok(entries) => Ok(entries),
Err(err) => Err(format!("Could not search for files: {err}")),
}
}
pub(crate) fn action_remote_find(&mut self, input: String) -> Result<Vec<File>, String> {
match self.client.as_mut().find(input.as_str()) {
pub(crate) fn action_walkdir_remote(&mut self) -> Result<Vec<File>, String> {
match self.client.as_mut().find("*") {
Ok(entries) => Ok(entries),
Err(err) => Err(format!("Could not search for files: {err}")),
}
@@ -26,6 +26,7 @@ impl FileTransferActivity {
pub(crate) fn action_find_changedir(&mut self) {
// Match entry
if let SelectedFile::One(entry) = self.get_found_selected_entries() {
debug!("Changedir to: {}", entry.name());
// Get path: if a directory, use directory path; if it is a File, get parent path
let path = if entry.is_dir() {
entry.path().to_path_buf()