You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
概要
ローカルレビューモードのコメント入力と、
:FudeReviewSubmitのレビュー本文入力で、書きかけの本文をローカルの下書きとして保存できるようにする。これまでこの2経路では閉じるときにYes/Noの破棄確認しか出ず、本文を残せなかった。Closes #204
変更内容
drafts.luaに純粋関数build_draft_scope(st)を追加し、current_key/file_markers/list_draftsのキー名前空間をここに集約したstate.pr_number前提だったため、ローカルモードではキーがnilになり、下書き保存・draftインジケータ・ブラウザのdraft行がすべて無効になっていた"local:" .. worktree_root+branch(detached HEADではsession id)をキーにする。session idではなくbranchにしたのは、PR番号と同じく:FudeReviewStop→再開後も下書きを残すため。local:はGitHubのowner/repoと名前空間を分けるために付けているdrafts.jsonはそのまま読めるissue(PRレベルコメント)とreview(Submit本文)のキーをnilにした。送信先が無く、保存しても消化できない下書き行がブラウザに残るためcreate_local_comment)に、GitHub側と同じ下書きの配線(prefill、閉じるときのsave/discard、保存成功後の削除)を入れた。reply/editとコメントブラウザは、キーが取れるようになったことで既存の配線がそのまま動くrefresh_extmarksを再実行するようにした。ローカルバックエンドは下書き削除より前に再描画するので、そのままだとdraftインジケータが残っていた:FudeReviewSubmitの本文入力を下書き保存できるようにした(kindreview)qと同じく本文なしで送信するremove_if_unchangedで行う。入力は閉じた後なので、送信中に再度Submitを開いて保存した下書きを消さないようにするためテスト計画
make all)tests/fude/drafts_spec.lua、tests/fude/local_sync_spec.lua、tests/fude/commands_spec.lua:FudeReviewStop→再開後も残ること:FudeReviewSubmitで本文を下書き保存→送信されないこと→再度Submitで復元→送信成功で消えること備考
ローカルモードの行コメント下書きは行番号でキーを作るため、作業ツリーを編集して行がずれると下書きの位置もずれる。GitHubモードの下書きと同じ挙動で、今回は対象外にしている。
Generated with Claude Code