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 於 4 天前認領。 未關閉enhancement
-
enhancement question
難度 5/5 一週以上 新手友好度 35/100
-
newMeetingNoteFromEventID always opens earliest occurrence for Google Calendar recurring events可能重新可做 @EduardMe 於 131 天前認領,目前沒有進行中的 PR。 未關閉bug
-
Calendar Plugin v1.0.3: Start Day of Week可能重新可做 @EduardMe 於 89 天前認領,目前沒有進行中的 PR。 未關閉
相似的 Issue
-
Place search spins forever when nominatim fails可能已有人在做 @jgt87 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
anvaka/city-roads#213 ·
-
mobile UX
難度 2/5 1-3 小時 新手友好度 76/100
-
bug
難度 2/5 1-3 小時 新手友好度 69/100
jellyfin/jellyfin-web#8685 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
SchemaStore/schemastore#6535 ·
維護者通常 1 天內回覆
-
enhancement good first issue helia storage tier-1
難度 2/5 1-3 小時 新手友好度 78/100
QMeshPy/distributed-quantum#53 ·
維護者通常 1 天內回覆