Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Resolve draft-removal races, stale-session callbacks, pending-comment loss, and the documentation inconsistency.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
Adds support for posting GitHub diff comments either as pending review comments or immediately as single comments.
Changes:
- Adds submission-method selection and pending-review handling.
- Adds single-comment API and draft integration.
- Updates tests and documentation.
| File | Summary |
|---|---|
tests/fude/ui_spec.lua |
Tests submission UI behavior. |
tests/fude/sync_integration_spec.lua |
Tests API synchronization. |
tests/fude/comments_spec.lua |
Tests submission options. |
tests/fude/comments_drafts_spec.lua |
Tests posting and draft handling. |
README.md |
Updates usage documentation. |
lua/fude/ui.lua |
Adds submission-method selection UI. |
lua/fude/comments/sync.lua |
Implements single-comment API handling. |
lua/fude/comments/data.lua |
Defines submission options. |
lua/fude/comments.lua |
Adds submission and single-comment workflows. |
doc/fude.txt |
Updates detailed help documentation. |
CLAUDE.md |
Updates architecture documentation. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Two unresolved moderate issues remain in callback/session safety and concurrent refresh handling.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
Resolved since last review (2)
| local draft_snapshot = drafts.get(draft_key) | ||
| sync.create_single_comment(rel_path, start_line, end_line, body, function(err) | ||
| if err then | ||
| vim.notify("fude.nvim: Failed to post " .. label:lower() .. ": " .. err, vim.log.levels.ERROR) | ||
| return | ||
| end | ||
| drafts.remove_if_unchanged(draft_key, draft_snapshot) | ||
| ui.refresh_extmarks() | ||
| vim.notify("fude.nvim: " .. label .. " posted", vim.log.levels.INFO) | ||
| end) |
There was a problem hiding this comment.
refresh_extmarks() は古いデータを持ち込まず、その時点の config.state と現在のバッファから描き直すだけなので、セッションが変わった後に走っても新しいセッションの状態で同じ表示を再描画するだけになる。セッションがない場合は state.active のガードで抜ける。draft削除も元のPR固有のkeyに対する操作なので、新しいセッションには影響しない。このため対応は見送る。

概要
:FudeReviewComment/:FudeReviewSuggestの<CR>で、pending reviewに追加するか、single commentとして即時公開するかを選べるようにする。これまではpending reviewへの追加しかできなかった。Closes #107
変更内容
<CR>押下時にvim.ui.selectでAdd single comment (post now)/Start a review (pending)を選ぶようにしたPOST /pulls/{pr}/comments)を422で拒否するため、選択肢が1つしか残らない<CR>押下時に行う。フロートを開いている間にauto-reloadでpending reviewが検出されるケースに追従するためpending_review_idに加えてpending_commentsが空でないかも見る(sync.has_pending_review)。最初のpending reviewの作成中はpending_commentsだけが先に埋まり、IDは応答が返るまで入らないためcomments/sync.luaのcreate_single_commentに追加し、既存だが未使用だったgh.create_comment/gh.create_comment_rangeを使ったopen_comment_inputの新オプションpick_submit_kindを渡すのはGitHubモードの2コマンドだけで、localモード・overview・reply・editの挙動は変えていないテスト計画
make all(lint、format-check、全テスト)がパスするtests/fude/ui_spec.lua,tests/fude/comments_spec.lua,tests/fude/comments_drafts_spec.lua,tests/fude/sync_integration_spec.lua備考
:FudeReviewStart直後など、GitHub上のpending reviewをまだ取得していない間はsingle commentを選べてしまう。この場合はAPIの422がERROR通知で表面化するGenerated with Claude Code