Review
Review pane ช่วยให้คุณเข้าใจสิ่งที่ Codex เปลี่ยนแปลง, ให้ feedback ที่เจาะจง และตัดสินใจว่าจะเก็บอะไร
ใช้ได้เฉพาะกับโปรเจกต์ที่อยู่ใน Git repository เท่านั้น
การเปลี่ยนแปลงที่แสดง
Review pane สะท้อนสถานะของ Git repository ไม่ใช่แค่สิ่งที่ Codex แก้ไข ซึ่งหมายความว่าจะแสดง:
- การเปลี่ยนแปลงที่ Codex ทำ
- การเปลี่ยนแปลงที่คุณทำเอง
- Uncommitted changes อื่นๆ ใน repo
โดยค่าเริ่มต้น review pane มุ่งเน้นที่ uncommitted changes คุณยังสามารถสลับ scope เป็น:
- All branch changes (diff กับ base branch)
- Last turn changes (เฉพาะ turn ล่าสุดของ assistant)
เมื่อทำงาน locally คุณยังสามารถสลับระหว่าง Unstaged และ Staged changes
Navigate review pane
- คลิกชื่อไฟล์เพื่อเปิดไฟล์ใน editor ที่เลือก (เปลี่ยน editor เริ่มต้นได้ใน settings)
- คลิก background ของชื่อไฟล์เพื่อ expand หรือ collapse diff
- กด
Cmdค้างขณะคลิก single line เพื่อเปิด line นั้นใน editor - Stage หรือ revert changes ที่ชอบหรือไม่ชอบ
Inline comments สำหรับ feedback
Inline comments ให้แนบ feedback โดยตรงกับ lines เฉพาะใน diff มักเป็นวิธีที่เร็วที่สุดในการนำทาง Codex ไปสู่ fix ที่ถูกต้อง
วิธีทิ้ง inline comment:
- เปิด review pane
- Hover บน line ที่ต้องการ comment
- คลิกปุ่ม
+ที่ปรากฏ - เขียน feedback และส่ง
หลังจากทิ้ง feedback แล้ว ส่งข้อความกลับไปยัง thread
Codex ถือว่า inline comments เป็น review guidance หลังจากทิ้ง comments แล้ว ส่ง follow-up message ที่ชัดเจน เช่น:
Address the inline comments and keep the scope minimal.
ผลลัพธ์ code review
หากใช้ /review เพื่อรัน code review comments จะปรากฏ inline ใน review pane โดยตรง
Pull request reviews
เมื่อ Codex มี GitHub access สำหรับ repository และโปรเจกต์ปัจจุบันอยู่บน PR branch Codex App สามารถช่วย work through PR feedback โดยไม่ต้องออกจากแอป sidebar แสดง PR context และ feedback จาก reviewers
ติดตั้ง GitHub CLI (gh) และ authenticate ด้วย gh auth login เพื่อให้ Codex โหลด PR context, review comments และ changed files
ขั้นตอนการทำงาน:
- เปิด review pane บน PR branch
- รีวิว PR context, comments และ changed files
- ขอให้ Codex แก้ไข comments ที่ต้องการจัดการ
- ตรวจสอบ diff ที่ได้ใน review pane
- Stage, commit และ push การเปลี่ยนแปลงไปยัง PR branch เมื่อพร้อม
Staging และ reverting files
Review pane มี Git actions เพื่อจัดรูปแบบ diff ก่อน commit
คุณสามารถ stage, unstage หรือ revert changes ในระดับ:
- Entire diff: ใช้ action buttons ใน review header (เช่น "Stage all" หรือ "Revert all")
- Per file: stage, unstage หรือ revert ไฟล์แต่ละไฟล์
- Per hunk: stage, unstage หรือ revert hunk เดียว
ใช้ staging เมื่อต้องการยอมรับงานบางส่วน และ revert เมื่อต้องการ discard
Staged และ unstaged states
Git สามารถแสดง staged และ unstaged changes ในไฟล์เดียวกันพร้อมกัน เมื่อเกิดขึ้น อาจดูเหมือน pane แสดง "ไฟล์เดียวกันสองครั้ง" ข้าม staged และ unstaged views ซึ่งเป็น Git behavior ปกติ