fix: backlink/unresolved パネルの fileTreeVersion 即時再スキャンを debounce 化#304
Merged
Conversation
- 即時スキャン effect の deps から fileTreeVersion を外し、workspace / ターゲット変更 (+ mount) 時のみ即時スキャン - fileTreeVersion / contentVersion 起点の再スキャンを共有 hook useDebouncedVersionRescan の 2000ms debounce に統合し、autosave 自己書込による約 2.5 秒毎の全 .md 再スキャンと二重実行を解消 - 版比較は両カウンタ (+1 単調増加) の和 1 本で判定、cancel IPC は timer 発火後の cleanup でのみ送信 - 両パネルの component test を新規追加 (計 16 件、fake timers + workspace store 直接駆動) Closes #298 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- codex-review qa-fixture の残指摘 (useDebouncedVersionRescan の rescan=null 期間中に version が進んだ後の復帰挙動が未テスト) に対応 - 復帰時は即時 scan に加え debounce 側の遅延 scan が 1 回走る (旧実装と同一挙動) を BacklinkPanel の component test で固定 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.
概要
backlink / unresolved-links パネルを開いたまま編集すると、autosave (既定 2s) の自己書込を watcher が拾い、約 2.5 秒毎にワークスペース全 .md の再読込スキャンが走り続ける問題を修正する。
fileTreeVersion起点の即時再スキャンをcontentVersion側と同じ 2000ms debounce に統合した。関連 Issue
closes #298
移行 Stage
変更内容
useDebouncedVersionRescanを新規追加:fileTreeVersion/contentVersionのどちらかが進んだら 2000ms 後に 1 回だけ rescan を呼ぶ (両カウンタとも +1 単調増加のため和 1 本で版比較)。cancel IPC は timer が発火して scan が実際に走った後の cleanup でのみ送信 (未発火時の無駄 IPC を排除)scanVersion(= fileTreeVersion) を除去し、workspace / ターゲット変更 (+ mount) 時のみ即時スキャンに変更。従来の「即時 (fileTreeVersion) + 2 秒後 (contentVersion)」の二重実行も解消bumpFileTreeVersionの発火経路 (useFileWatcher / AppLayout) と FileTree・wikilinks キャッシュの即時性は不変更 (issue の確定設計どおり)動作確認
スクリーンショット
UI 変更なし
検証エビデンス
リスク分類
tier: high — classify-risk.sh の判定理由は
agent-config: src/hooks/useDebouncedVersionRescan.ts。これは React hooks ディレクトリ (src/hooks/) をエージェント設定 (Claude hooks) とパスパターン誤マッチした false positive だが、下方修正せず high の手順 (codex-review 3 観点 + テスト + walkthrough) を実施した。実行した検証
tsc --noEmit -p tsconfig.node.json/tsconfig.web.json/tsconfig.e2e.jsonbiome check .vitest run(全件)d001845で fixed)レビュー指摘と対応
qa-fixture 初回 (3 件、全て CONFIRMED → テスト追加で fix、
623b0b7に fold):!rescan(null target) 分岐が未テストqa-fixture confirm 再実行 (5 件):
d001845) — 復帰時は即時 scan に加え遅延 scan が 1 回走る (旧実装と同一挙動) をテストで固定。skill 規定 (max 2 runs) により codex の再々実行は行わず、指摘内容の解消をテストで確認src/test-setup.tsのグローバル afterEach が全テストで real timers 復帰を保証 (リポジトリ確立済みの構成)/simplify (4 観点並列レビュー、適用済み)
useDebouncedVersionRescanhook へ抽出{tree, content}ペア ref → 単調増加カウンタの和 1 本へafterEach(vi.useRealTimers)削除 (グローバル setup と重複)🤖 Generated with Claude Code