Skip to content

Feature/#9#29

Open
syuya2036 wants to merge 27 commits intodevelopfrom
feature/#9
Open

Feature/#9#29
syuya2036 wants to merge 27 commits intodevelopfrom
feature/#9

Conversation

@syuya2036
Copy link
Copy Markdown
Collaborator

No description provided.

syuya2036 and others added 27 commits December 14, 2025 11:37
…nd filtering capabilities, including new UI icons.
…ngine` to dispatch queries to either Tantivy or ripgrep.
… into the ExplorerPage, deprecating the standalone SearchPage.
…rtualized preview with line-level highlighting.
…t scroll synchronization, and improve file entry kind detection
…crollbar for the preview pane, and fix line navigation offset.
… move search/syntax highlighting into the editor component
- Phase 1: 純粋ロジック(sort, group_results, text処理)を src/core/ に移動し feature gate 解除
- Phase 2: 検索サービス(IndexManager, RipgrepBackend, FileWatcher)の統合テスト拡充
- Phase 3: ExplorerPage エンティティテスト(#[gpui::test] + TestAppContext)
- Phase 4: 検索 UI 結合テスト(SearchProvider トレイト抽出 + MockSearchProvider)
- テストファイル配置: tests/ (integration) と src/pages/*/tests.rs (entity) の2層構成
- CI: cargo test (core) → cargo test --features gui (UI) の2段階パイプライン

https://claude.ai/code/session_01JKXXsHPVcKpqrkRJp9NTR9
Phase 1: GUI非依存の型・ロジックを src/core/ に移動し、feature gate なしで
テスト可能にした。sort_entries, group_results, truncate_middle,
find_query_match_ranges 等を分離。26件の単体テスト追加。

Phase 2: 検索サービス統合テスト(IndexManager, RipgrepBackend,
SearchEngine, FileWatcher)を tests/service_tests/ に19件追加。
RipgrepBackend のバイナリ検出漏れバグを修正。

Phase 3: ExplorerPage エンティティテスト(初期状態、ナビゲーション、ソート、
カラムリサイズ等)を src/pages/explorer/tests.rs に配置。
SearchProvider トレイトを抽出し MockSearchProvider でテスト可能に。

Phase 4: 検索UI結合テスト(フロー、スコープ切替、状態遷移)を
tests/ サブディレクトリに配置。

バグ修正:
- RipgrepBackend: BinaryDetection 未設定を修正
- close_search: 重複 apply_filter() 呼び出しを修正
- apply_filter: 冗長な entries クローンを修正
- truncate_middle: max_len < 4 でのオーバーフロー防止

https://claude.ai/code/session_01Wsog3KS2F8srL4BxAcytMB
- check: cargo check + clippy
- test-core: feature gate なしテスト(core + services)
- test-gui: GUI feature 有効テスト(TestAppContext、test-core 後に実行)
- fmt: cargo fmt --check
- .gitignore から /.github を除外

https://claude.ai/code/session_01Wsog3KS2F8srL4BxAcytMB
- build_explorer で gpui_component::init() を呼び Theme グローバルを初期化
- ExplorerPage を gpui_component::Root でラップし InputState 等が正常動作するように
- add_window_view → add_window + Root::new パターンに変更
- trigger_search のアサーションを update_window_entity 内に移動
  (notify による再レンダリングで状態がリセットされる問題を回避)
- test_initial_state を空 tempdir で実行 (ensure_loaded 自動ロード対応)
- ViewMode に Debug derive 追加

全 82 テスト通過: cargo test --features gui

https://claude.ai/code/session_01Wsog3KS2F8srL4BxAcytMB
全82テストの目的・フロー・検証仕様を網羅したドキュメント。
- Phase 3/4 ExplorerPage エンティティ&検索UIテスト(26件)
- Core テスト: search_utils, sort, text(34件)
- Service テスト: indexing, ripgrep, search_engine, watcher(19件)
- 統合テスト: indexing/watcher E2E(2件)
- テスト基盤(MockSearchProvider, build_explorer)の設計説明

https://claude.ai/code/session_01Wsog3KS2F8srL4BxAcytMB
アーキテクチャ、検索フロー、バックエンド実装、UI実装を網羅的に調査し、
バグ・パフォーマンス問題・設計上の課題を優先度付きで整理した。

主要な発見:
- trigger_search が UI スレッドをブロックする致命的問題
- 検索オプション (case/word/regex/type) が UI のみで未実装
- find_all_match_lines での二重ファイル読み込み
- render 内での副作用、O(n×m) ルックアップ等のパフォーマンス問題
- PreviewEditor の主要機能が全て no-op (TODO)

https://claude.ai/code/session_012diEtdw7hKdqJVZycRq1qv
- ExplorerPageの全pubフィールドをpub(super)に変更(可視性ルール準拠)
- explorer/mod.rs (660行→366行): event.rs, preview_open.rsに分割
- indexer.rs (420行→320行): SearchBackend implをindexer_search.rsに分割
- row.rs (267行→205行): スニペット描画をrow/snippets.rsに分離
- header.rs: render()を30行に縮小、nav/actions/breadcrumbを別関数化
- file_list.rs: unsafeブロックを除去、Rc<dyn Fn>でコールバック共有
- syntax.rs: unwrap()をlet-else早期リターンに置換
- listing.rs: spawn_blocking結果のunwrap()をResult伝播に置換
- 未使用import/関数の整理

https://claude.ai/code/session_012diEtdw7hKdqJVZycRq1qv
…OXLpV

Investigate and document search feature implementation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants