Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuzzy finder #1393

Merged
merged 45 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
50e3501
Added a fuzzy search modal
treagod Dec 14, 2021
dbd8692
Fixed indent
treagod Dec 14, 2021
021ba91
Use accent color for selection
treagod Dec 15, 2021
b51d456
Listen to git change
treagod Dec 15, 2021
eb3827d
Use async fuzzy finder and ignore paths from .gitignore
treagod Dec 16, 2021
830c45d
Resize dialog
treagod Dec 16, 2021
88adb72
Added scrolling by up/down arrows
treagod Dec 16, 2021
b1be136
Check project content on each search to get all changes
treagod Dec 18, 2021
4db8e57
Add basic debouncing and cancellation for each search query
colinkiama Dec 19, 2023
c717a35
Add cancellable checks to all loops during fuzzy search
colinkiama Dec 19, 2023
b9e419e
Increase fuzzy search results update speed
colinkiama Dec 19, 2023
b65057c
Fix long delay before fuzzy finder dialog opens
colinkiama Dec 19, 2023
aa9f61a
Fix vala-lint errors in fuzzy-search plugin directory
colinkiama Dec 19, 2023
6fbf1c6
Prevent fuzzy search dialog from opening if there are no projects opened
colinkiama Dec 19, 2023
6b89011
Clicking on fuzzy search results loads the clicked result
colinkiama Dec 19, 2023
05a3214
Fuzzy search results across multiple projects are disambiguated using…
colinkiama Dec 19, 2023
03686c4
Update fuzzy search debug logs
colinkiama Dec 19, 2023
a8c119a
Improve Fuzzy Search Accuracy
colinkiama Dec 20, 2023
a514b94
Ignore dot-prefixed directories in fuzzy search
colinkiama Dec 20, 2023
ea29d63
Update debug messaging for fuzzy search
colinkiama Dec 20, 2023
949c927
Fix code style warnings in fuzzy search plugin
colinkiama Dec 20, 2023
33be958
Update license and copyright info for Fuzzy Finder plugin
colinkiama Dec 20, 2023
b579d3a
Add end method to project path parsing async call
colinkiama Dec 20, 2023
e1989ca
Fix vala-lint errors
colinkiama Dec 20, 2023
73a9b3e
Improve fuzzy matching
colinkiama Dec 25, 2023
903505b
Change fuzzy search keyboard shortcut to 'ALT + F'
colinkiama Dec 27, 2023
8610573
Remove unused GitManager signals
colinkiama Dec 27, 2023
31936a0
Files that cannot be opened in Code are filtered out of fuzzy search
colinkiama Dec 27, 2023
09df392
Render fuzzy search items with list boxes
colinkiama Dec 27, 2023
7f82dc1
Add mouser hover styling to fuzzy search items
colinkiama Dec 27, 2023
848e461
Handle Fuzzy Search key presses with EventControllerKey
colinkiama Dec 27, 2023
243a3e5
Now using popover to show fuzzy search
colinkiama Dec 27, 2023
ad97f55
Add title label to fuzzy search popover
colinkiama Dec 27, 2023
bfd7a92
Remove unused window size and positining code
colinkiama Dec 27, 2023
dbfa10e
Prevent focus on fuzzy item results
colinkiama Dec 27, 2023
c836cbb
Fuzzy search results for current project are prioritised
colinkiama Dec 27, 2023
0c1fba8
Expose fuzzy find function and accelerator in sidebar action menu (#1…
jeremypw Jan 4, 2024
8c550d6
Associate popover with foldermanager (#1396)
jeremypw Jan 6, 2024
e973920
Add folder_item_change plugin manager hook in preparation for backgro…
colinkiama Jan 10, 2024
868d188
Allow search project parsing to be cancellable
colinkiama Jan 10, 2024
0fdcd77
Create indexer and add methods for adding and removing files and dire…
colinkiama Jan 10, 2024
a9980b2
Use fuzzy search indexer for fuzzy search results
colinkiama Jan 10, 2024
1671c89
Update indexer debug logs
colinkiama Jan 10, 2024
225b3ad
Update license info and comments in Fuzzy Search Project
colinkiama Jan 10, 2024
8b90e64
Remove old fuzzy search indexer testing logs
colinkiama Jan 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions data/Application.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,52 @@ textview.scrubber {
border: 0;
}

.fuzzy-popover {
padding-top: 0.5rem;
padding-bottom: 1rem;
}

.fuzzy-popover entry {
margin-left: 1rem;
margin-right: 1rem;
}

.fuzzy-popover scrolledwindow {
margin-top: 1rem;
}

.fuzzy-list {
background-color: transparent;
}

.fuzzy-item {
padding: 0.5rem;
margin-left: 10px;
margin-right: 10px;
background-color: transparent;
}

.fuzzy-item.preselect-fuzzy,
.fuzzy-item:hover {
border-radius: 0.5rem;
}

.fuzzy-item:hover {
background-color: @theme_unfocused_selected_bg_color;
}

.fuzzy-item.preselect-fuzzy {
background-color: @selected_bg_color;
}

.fuzzy-item .fuzzy-file-icon {
margin-right: 0.5rem;
}

.fuzzy-item label:nth-child(1) {
font-weight: 700;
}

.fuzzy-item.preselect-fuzzy label {
opacity: 0.7;
}
58 changes: 58 additions & 0 deletions plugins/fuzzy-search/file-item.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* SPDX-License-Identifier: GPL-3.0-or-later
* SPDX-FileCopyrightText: 2023 elementary, Inc. <https://elementary.io>
*
* Authored by: Marvin Ahlgrimm
* Colin Kiama <[email protected]>
*/

public class FileItem : Gtk.ListBoxRow {
private SearchResult result;

public string filepath {
get {
return result.full_path;
}
}
public FileItem (SearchResult res, bool should_distinguish_project = false) {
this.get_style_context ().add_class ("fuzzy-item");
this.get_style_context ().add_class ("flat");

result = res;
Icon icon;
var path_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 1);
path_box.valign = Gtk.Align.CENTER;

var path_label = new Gtk.Label (
@"$(should_distinguish_project ? result.project + " • " : "")$(result.relative_path)"
);

path_label.halign = Gtk.Align.START;

var filename_label = new Gtk.Label (Path.get_basename (result.relative_path));
filename_label.halign = Gtk.Align.START;

try {
var fi = File.new_for_path (result.full_path);
var info = fi.query_info ("standard::*", 0);
icon = ContentType.get_icon (info.get_content_type ());
} catch (Error e) {
icon = ContentType.get_icon ("text/plain");
}

var image = new Gtk.Image.from_gicon (icon, Gtk.IconSize.DND);
image.get_style_context ().add_class ("fuzzy-file-icon");

path_box.add (filename_label);
path_box.add (path_label);

var container_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 1) {
valign = Gtk.Align.CENTER
};

container_box.add (image);
container_box.add (path_box);

this.child = container_box;
}
}
Loading