feat: FudeReviewScopeNext, FudeReviewScopePrevによるscopeの前後移動でも最初のファイルを開く - #192
Conversation
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Prevent file opening from replacing floating or UI buffers when scope navigation starts there.
Review effort: Lite
Findings: None
What changed in this PR
Adds automatic opening of the first file after switching review scopes.
Changes:
- Added completion callbacks to scope navigation.
- Added
files.open_first_file()with navigation-order handling. - Updated tests and documentation.
| File | Summary |
|---|---|
tests/fude/scope_spec.lua |
Tests scope-switch callbacks. |
tests/fude/files_spec.lua |
Tests opening the first file. |
README.md |
Updated command documentation. |
lua/fude/scope.lua |
Opens a file after scope changes. |
lua/fude/files.lua |
Implements first-file opening; floating or non-empty-buffer origins need handling. |
doc/fude.txt |
Updated help documentation. |
CLAUDE.md |
Updated architecture documentation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
レビューのoverviewにあった「floating windowやUI用バッファからscope移動を始めたとき、そのバッファがファイルで置き換わる」件は 9efc886 で対応した。 |
[s, ]sによるscopeの前後移動でも最初のファイルを開く
|
削除済みファイルのstatusはGitHub APIでは"removed"で、localモードでも |
[s, ]sによるscopeの前後移動でも最初のファイルを開くFudeReviewScopeNext , FudeReviewScopePrevによるscopeの前後移動でも最初のファイルを開く
FudeReviewScopeNext , FudeReviewScopePrevによるscopeの前後移動でも最初のファイルを開くFudeReviewScopeNext, FudeReviewScopePrevによるscopeの前後移動でも最初のファイルを開く
概要
:FudeReviewScopeNext/:FudeReviewScopePrevでscopeを切り替えたときも、サイドパネルの<CR>でscopeを選んだときと同じように、新しいscopeの最初のファイルを開くようにする。変更内容
scope.next_scope/prev_scopeがapply_full_pr_scope/apply_commit_scopeにon_doneを渡すようにしたon_doneを渡していなかったため、scope切替は成功してもファイルを開く処理が呼ばれていなかったrefresh_previewがプレビュー窓を作り直して窓番号が変わるため、作り直した後のプレビュー窓にいれば開くfiles.open_first_file()を追加したsidepanel.open_first_fileはパネルが開いていてフォーカスがある前提なので、ソース窓から呼ばれる[s/]s用に別途用意した]Fなどのファイル移動と同じ(tree表示中はtree順)で、削除済みファイルは飛ばす。パネル・プレビューから呼ばれた場合はソース窓に移ってから開く動作確認
make all(lint・format-check・テスト)が通ることを確認した