diff --git a/web-ui/code.js b/web-ui/code.js index 928e39a..ddfdace 100644 --- a/web-ui/code.js +++ b/web-ui/code.js @@ -3350,10 +3350,12 @@ function _showDiffBar(fileId) { const label = document.getElementById('code-diff-label'); if (!bar || !label) return; - label.textContent = '🔀 AI 제안 변경 사항'; + const pendingCount = Object.keys(codeDiffState).length; + const countNote = pendingCount > 1 ? ` (${pendingCount}개 파일 남음)` : ''; + label.textContent = '🔀 AI 제안 변경 사항' + countNote; const acceptBtn = document.getElementById('code-diff-accept'); const rejectBtn = document.getElementById('code-diff-reject'); - if (acceptBtn) { acceptBtn.textContent = '✅ 모두 적용'; acceptBtn.onclick = () => acceptAllHunks(); } + if (acceptBtn) { acceptBtn.textContent = pendingCount > 1 ? '✅ 적용 →' : '✅ 모두 적용'; acceptBtn.onclick = () => acceptAllHunks(); } if (rejectBtn) { rejectBtn.textContent = '❌ 모두 취소'; rejectBtn.onclick = () => rejectAllHunks(); } bar.style.display = 'flex'; @@ -3478,17 +3480,24 @@ function finalizeInlineDiff(fileId, save) { // Auto-save accepted changes so the on-disk file matches the editor if (save) codeSaveFileById(fileId); - // Hide diff bar + renderCodeFileTabs(); + + // If more files have pending diffs, switch to next one automatically + const nextId = Object.keys(codeDiffState)[0]; + if (nextId) { + switchCodeFile(nextId); // switchCodeFile calls _showDiffBar if codeDiffState[nextId] exists + return; + } + + // No more pending diffs — hide bar and restore focus const bar = document.getElementById('code-diff-bar'); if (bar) bar.style.display = 'none'; - // Restore normal editor focus const file = codeFiles.find(f => f.id === fileId); if (file && monacoEditor && file.id === activeCodeFileId) { monacoEditor.setModel(file.model); monacoEditor.focus(); } - renderCodeFileTabs(); } function cleanupCodeDiff(fileId) {