getFoldersMatching adds root "/" even when it is not an inclusion
@jgclark y travaille déjà.
Depuis le 17/10/2026.
Évaluation
Cette issue n'a pas encore été évaluée.
Description
Summary
getFoldersMatching() in helpers/folders.js adds the root folder / to its result whenever / is not an exclusion, even when the caller passed a non-empty inclusion list that does not contain /.
That is why a Dashboard perspective that includes only CCC and excludes Notes still lists / in perspectiveScopeUnion.json (seen via Projects + Reviews test: log perspective scope union). Root notes (a filename with no /) then match that scope.
resolvePerspectiveFolders() in jgclark.Dashboard/src/perspectiveScopeUnion.js calls getFoldersMatching() whenever a perspective has a non-empty include list, so it inherits this.
Proposed change
When the inclusion list is non-empty, include / only if / is one of the inclusions. Keep the existing special case where the only inclusion is / (return ['/'], unless / is excluded).
When the inclusion list is empty, keep today's meaning: every folder, including /, unless / is excluded. Folder pickers rely on that.
The tests in helpers/__tests__/folders.test.js currently expect / on a CCC inclusion (the case titled "does not include root folder" asserts toContain('/')). Those would need to change with this.
@dwertheimer -- does this match how you want getFoldersMatching() to treat root? In particular, should an empty inclusion list still return /?
Plugins and commands this would change
Only callers that pass a non-empty inclusion list that does not contain /.
Dashboard (jgclark.Dashboard)
Live folder filter (getCurrentlyAllowedFolders, filterParasByRelevantFolders, tag sections):
- Show Dashboard
- Show Demo Dashboard
- Explain selected item filters
- Generate Diagnostics file
- test Perspective Filter
perspectiveScopeUnion.json, via resolvePerspectiveFolders():
- showPerspective
- Add new Perspective
- Update current Perspective
- Delete Perspective
- Delete all Perspective Settings
- onUpdateOrInstall
Projects + Reviews (jgclark.Reviews)
getFilteredFolderList() calls getFoldersMatching() when foldersToInclude is set (from the active perspective when Use Perspectives is on). The union file is also read when FFlag_UseCacheOfAllPerspectives is on, and always by the two test commands:
- project lists
- start reviews
- next project review
- finish project review
- finish project review and start next
- skip project review
- weeklyProjectsProgress
- heatmaps for weekly Projects Progress
- migrate all projects
- Projects: update plugin settings
- test: log perspective scope union
- test: force rebuild allProjectsList from union
Folder pickers that pass a start folder
chooseFolder() in helpers/userInput.js passes [startFolder] as the inclusion list when a start folder is given. Those pickers would stop offering / unless the start folder is /:
- Templating (
np.Templating), when a template uses<select:SomeFolder> - shared.AI, the "Move to which directory?" prompt when
researchDirectoryis set
chooseFolder() with no start folder, and the getFolders handlers in np.Shared, dwertheimer.Forms, and dwertheimer.ReactSkeleton, pass an empty inclusion list. Under the proposal above they would still include /.
- Langage dominant
- JavaScript
- Étoiles
- 204
- Forks
- 81
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de NotePlan/plugins
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
-
Task Sorting & Tools: support other line typesPeut-être pris @dwertheimer l’a pris il y a 5 jours. Ouverteenhancement
-
Dashboard: Task "Comment"Ouverteenhancement question
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
-
newMeetingNoteFromEventID always opens earliest occurrence for Google Calendar recurring eventsPeut-être à nouveau libre @EduardMe l’a pris il y a 131 jours, et aucune pull request n’est ouverte. Ouvertebug
-
Calendar Plugin v1.0.3: Start Day of WeekPeut-être à nouveau libre @EduardMe l’a pris il y a 89 jours, et aucune pull request n’est ouverte. Ouverte
NotePlan/plugins#749 · 1 commentaire · 1 personne assignée ·
Toutes les issues de NotePlan/plugins
Issues similaires
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
521xueweihan/HelloGitHub#4073 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
c1overzz/dsh-bili-scroll#79 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 83/100
awesome-dsh-plugin/awesome-dsh-plugin#8715 ·
Les mainteneurs répondent en général sous 1 jour