fix: 全文検索 walk と watcher で node_modules を除外#305
Merged
Conversation
- walkMdFiles の早期 skip 条件に node_modules を追加(全文検索・ ファイル名検索・wikilink/backlink スキャンの共有経路に効く) - isWatcherIgnored に node_modules のパス成分一致除外を追加 (chokidar が配下へ降下しなくなり監視コストが純減) - renderer-only e2e mock の collectMdFiles にも同じ skip を追随 (parity コメントの stale な行番号参照も修正) - テスト 4 件追加: search/watcher 両側の除外 + `node_modules.md` という名前のファイルが除外されないこと(成分完全一致のみ) Closes #299 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
全文検索系の walk (
walkMdFiles) と file watcher (isWatcherIgnored) の除外リストにnode_modulesが入っておらず、node_modules 入りのフォルダをワークスペースにすると依存パッケージの README.md / CHANGELOG.md 群が全文検索・ファイル名検索・wikilink/backlink スキャンで毎クエリ読み込まれ、watcher も配下の大量ファイルを監視してしまう。性能用ハードコード除外を 2 箇所に追加する。関連 Issue
closes #299
移行 Stage
移行 Stage 対象外(v1.0.0 前提の性能改善 #298〜#303 の一環)
変更内容
electron/main/ipc/search.ts—walkMdFilesの早期 skip 条件にnode_modulesを追加(searchFiles / searchFilenames / wikilink scan / backlink scan の共有経路に効く)electron/main/utils/watcher-pure.ts—isWatcherIgnoredにnode_modulesのパス成分完全一致除外を追加(chokidar が配下へ降下しなくなり監視コスト純減)。「FileTree には表示されるが監視されない」非対称は issue fix: 全文検索 walk と watcher で node_modules を除外 #299 リスク欄で受容済みのトレードオフとしてコメントに明記e2e/helpers/electron-api-mock.ts— renderer-only e2e mock のcollectMdFilesにも同じ skip を追随(parity コメントの stale な行番号参照も修正)node_modules.mdが除外されないこと)、watcher 側(直下・ネストの除外 +node_modules.mdの非除外)動作確認
isWatcherIgnoredユニットテストで固定)node_modules.mdのようなファイルは除外されない — ディレクトリ名成分の完全一致のみ(両側テストで固定)スクリーンショット
UI 変更なし
検証エビデンス
リスク分類
tier: medium — reasons: [](classify-risk.sh 出力)
実行した検証
./node_modules/.bin/vitest run./node_modules/.bin/biome check .tsc --noEmit(tsconfig.node / web / e2e の 3 プロジェクト)electron-e2ejob で確認)レビュー指摘と対応
codex-review security: PASS(findings 0、対応事項なし)。
参考: PR 作成前に /code-review(8 finder + 1-vote 検証)を実施済み。CONFIRMED 1 件(e2e mock parity 未追随)は本 PR 内で修正済み、PLAUSIBLE 2 件(FileTree/watcher 非対称 = issue リスク欄で受容済み → コメント明記で対応、
node_modules名プレーンファイルの watcher 除外 =.git判定と同型の理論的エッジ → 対応するなら別 issue)、REFUTED 2 件。🤖 Generated with Claude Code