fix(daemon): list dot-prefixed user content in managed projects - #6214
fix(daemon): list dot-prefixed user content in managed projects#6214mturac wants to merge 2 commits into
Conversation
The file and folder listing helpers skipped every entry whose basename starts with '.', so legitimate user content such as .github/, .storybook/, or a .notes.md file never appeared in @-mention autocomplete or project search. Replace the blanket filter with the explicit policy: the shared ignore list (project-ignored-dirs.ts) plus the reserved daemon state directories (.live-artifacts, .file-versions) stay hidden everywhere; other dot-prefixed entries are listed for managed projects. Imported folders (external baseDir) keep hiding hidden entries, consistent with assertVisibleForImportedProject. Fixes nexu-io#6175
|
🧪 Queued for QA validation — this PR changes a user-facing runtime path, so we’ll run a manual QA pass before merge. Nothing needed from you right now; we’ll update here once that pass is done. Thanks for the contribution! 🙏 |
| // serve hidden path segments from a user's own directory. Reserved daemon | ||
| // directories (.live-artifacts, .file-versions) stay hidden everywhere. | ||
| const skipHidden = hasExternalProjectRoot(metadata); | ||
| await collectFiles(dir, '', out, isListingSkippedDirName, dir, skipHidden); |
There was a problem hiding this comment.
This change makes .github/, .vscode/, .notes.md, etc. visible in managed projects, but buildProjectArchive() still uses collectArchiveEntries()'s unconditional e.name.startsWith('.') filter and its own comment still says the ZIP "matches what the user sees in the file panel". The result is that a managed project can now show a dot-prefixed file in the UI and autocomplete, yet Download as .zip silently drops it from the exported archive. That is a real correctness problem for backups/hand-off because visible user content disappears during export with no warning. Please either update the archive walker/tests to follow the same managed-vs-imported hidden-entry policy as listFiles, or explicitly change the surrounding contract so these newly visible files are not presented as exportable project content.
|
Hey @mturac — the current blocker on this head is the mismatch @nettee called out: managed projects can now surface dot-prefixed user content, but project archive export still drops those entries. Once the archive behavior and the surrounding contract are aligned, this should be in much better shape for the next pass. |
nettee
left a comment
There was a problem hiding this comment.
@mturac I re-checked the archive/listing parity in apps/daemon/src/projects.ts and the follow-up now lines up managed-project dotfile visibility across full archives, batch archives, and imported-folder guards. The added regression coverage around managed vs. imported projects, reserved daemon paths, and archive root handling matches the code paths this change touches. I couldn't rerun Vitest in this prepared checkout because the worktree has no node_modules, but the implementation and new tests are coherent. Nice follow-through on closing the archive mismatch.
|
Thanks for the contribution. I completed QA validation for this PR. QA Acceptance Record Scope:
Verified:
Not verified:
Risks / notes:
Conclusion:
|
Fixes #6175
Why
Hit this while keeping project notes in a
.notes.mdfile:@-mentioning it from the chat composer silently finds nothing, and the same happens for.github/or.vscode/content. The file and folder listing helpers inapps/daemon/src/projects.tsapply a blanketstartsWith('.')filter, so every dot-prefixed entry is invisible to mention autocomplete and project search — not just the internal directories the filter was meant to hide.What users will see
In managed projects,
@-mention autocomplete and project search now find dot-prefixed user content such as.github/workflows/ci.yml,.vscode/settings.json, or.notes.md. Internal directories (.git,.od,.live-artifacts,.file-versions,node_modules, …) stay hidden. Imported folders (externalbaseDir) are unchanged: hidden entries there remain unlisted, consistent with the existing rule that refuses to serve hidden path segments from a user's own directory.Surface area
Bug fix verification
apps/daemon/tests/project-hidden-files.test.tsmain, green on this branch: yes (2 failed on main — managed listing cases; 9 pass with the fix)Validation
vitest run tests/project-hidden-files.test.ts tests/live-artifacts-store.test.ts tests/project-archive.test.ts tests/folder-import-projects.test.ts tests/projects-list-files.test.ts tests/project-watchers.test.ts tests/project-file-rename.test.ts— 100 passed (100)tsc -p tsconfig.json --noEmit && tsc -p tsconfig.tests.json --noEmit— cleanpnpm guard— passOpen question
Archives intentionally keep the blanket hidden-entry exclusion (
project-archive.test.tslocks that contract), so a listed.github/workflows/ci.ymlis still rejected by batch download. If you'd rather have archive visibility follow the new listing policy for managed projects, happy to do that as a follow-up.