getFoldersMatching adds root "/" even when it is not an inclusion
@jgclark 已经在做这个了。
开始于 2026年10月17日。
评估
这个 Issue 还没有评估数据。
描述
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 /.
- 主要语言
- JavaScript
- 星标
- 204
- 派生
- 81
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NotePlan/plugins 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
-
Task Sorting & Tools: support other line types可能已有人在做 @dwertheimer 于 5 天前认领。 未关闭enhancement
-
enhancement question
难度 5/5 一周以上 新手友好度 35/100
-
newMeetingNoteFromEventID always opens earliest occurrence for Google Calendar recurring events可能重新可做 @EduardMe 于 132 天前认领,目前没有进行中的 PR。 未关闭bug
-
Calendar Plugin v1.0.3: Start Day of Week可能重新可做 @EduardMe 于 90 天前认领,目前没有进行中的 PR。 未关闭
相似的 Issue
-
[Bug] Pitch Converter gives the wrong octave for B♯, C♭, B𝄪 and C𝄫可能已有人在做 @bhuvan-somisetty 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
sugarlabs/musicblocks#9765 ·
维护者通常 1 天内回复
-
documentation good first issue help wanted
难度 2/5 1-3 小时 新手友好度 82/100
adaumsilva/OrchestrAI#51 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
Jason-Vaughan/TangleClaw#2546 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
rubyjs/mini_racer#449 ·
-
area:integration enhancement good first issue help wanted
难度 2/5 1-3 小时 新手友好度 74/100