From 01c869beeb8d29328e76d6c54611a316afc3757e Mon Sep 17 00:00:00 2001 From: Kaitlin Salzke Date: Thu, 13 Jun 2024 00:03:39 +1000 Subject: [PATCH] feat: :lipstick: show folder path in active folders fuzzy search form --- fuzzySearchLib.omnifocusjs/Resources/fuzzySearchLib.js | 7 ++++++- src/fuzzySearchLib.ts | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/fuzzySearchLib.omnifocusjs/Resources/fuzzySearchLib.js b/fuzzySearchLib.omnifocusjs/Resources/fuzzySearchLib.js index e438e44..2a5d217 100644 --- a/fuzzySearchLib.omnifocusjs/Resources/fuzzySearchLib.js +++ b/fuzzySearchLib.omnifocusjs/Resources/fuzzySearchLib.js @@ -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); diff --git a/src/fuzzySearchLib.ts b/src/fuzzySearchLib.ts index 0aae38e..f52f828 100644 --- a/src/fuzzySearchLib.ts +++ b/src/fuzzySearchLib.ts @@ -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 = () => {