Skip to content

Commit

Permalink
feat: 💄 show folder path in active folders fuzzy search form
Browse files Browse the repository at this point in the history
  • Loading branch information
ksalzke committed Jun 12, 2024
1 parent 64c9c33 commit 01c869b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion fuzzySearchLib.omnifocusjs/Resources/fuzzySearchLib.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,13 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
return lib.searchForm(activeTags, activeTags.map(function (t) { return t.name; }), null, null);
};
lib.activeFoldersFuzzySearchForm = function () {
var getFolderPath = function (folder) {
if (!folder.parent)
return folder.name;
return getFolderPath(folder.parent) + " > " + folder.name;
};
var activeFolders = flattenedFolders.filter(function (folder) { return folder.status === Folder.Status.Active; });
return lib.searchForm(activeFolders, activeFolders.map(function (f) { return f.name; }), null, null);
return lib.searchForm(activeFolders, activeFolders.map(getFolderPath), null, null);
};
lib.allProjectsFuzzySearchForm = function () {
return lib.searchForm(flattenedProjects, flattenedProjects.map(function (t) { return lib.getTaskPath(t); }), null, null);
Expand Down
7 changes: 6 additions & 1 deletion src/fuzzySearchLib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,13 @@ interface FuzzySearchForm extends Form {
}

lib.activeFoldersFuzzySearchForm = () => {
const getFolderPath = (folder: Folder) => {
if (!folder.parent) return folder.name
return `${getFolderPath(folder.parent)} > ${folder.name}`
}

const activeFolders = flattenedFolders.filter(folder => folder.status === Folder.Status.Active)
return lib.searchForm(activeFolders, activeFolders.map(f => f.name), null, null)
return lib.searchForm(activeFolders, activeFolders.map(getFolderPath), null, null)
}

lib.allProjectsFuzzySearchForm = () => {
Expand Down

0 comments on commit 01c869b

Please sign in to comment.