diff --git a/frontend/index.html b/frontend/index.html index 2677bf3..166279c 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -178,6 +178,17 @@ textarea { resize: vertical; min-height: 120px; } .pull-sheet-header button, .pull-sheet-actions button, .pull-sheet-actions a, .pull-comment-composer button { min-height:44px; } .pull-sheet-content { overflow-wrap:anywhere; white-space:pre-wrap; } .pull-file, .pull-comment-card { margin:8px 0; padding:10px; border:1px solid #203a5c; border-radius:10px; } +.pull-file-toggle, .pull-review-file { min-height:44px; width:100%; } +.pull-file-toggle { display:flex; justify-content:space-between; align-items:center; gap:8px; text-align:left; } +.pull-review-file { margin-top:8px; } +.pull-diff { overflow-x:auto; margin:8px 0; padding:10px; background:#07111f; border-radius:8px; font-size:12px; } +.pull-diff-line { display:block; width:max-content; min-width:100%; } +.pull-diff-line.added { color:#86efac; background:#123422; } +.pull-diff-line.removed { color:#fca5a5; background:#3b161b; } +.pull-diff-line.hunk, .pull-diff-note { color:#93c5fd; } +.pull-diff-empty { margin:8px 0; padding:10px; border:1px dashed #4e6b8a; border-radius:8px; } +.pull-review-tools { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:8px 0; } +.pull-review-tools button { min-height:44px; } .pull-comment-composer textarea { width:100%; min-height:110px; resize:vertical; } .pull-sheet-actions { position:sticky; bottom:0; display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:10px 0; padding-bottom:calc(10px + env(safe-area-inset-bottom)); background:#0b1526; } .pull-sheet-actions a { display:grid; place-items:center; border:1px solid #60a5fa; border-radius:10px; font-weight:700; } @@ -449,7 +460,9 @@ textarea { resize: vertical; min-height: 120px; }
Add comment
@@ -580,6 +593,7 @@ textarea { resize: vertical; min-height: 120px; } let selectedPull = null; let pullTrigger = null; let selectedPullDetail = null; + let pullReviewState = null; let creatingIssue = false; let findingWork = false; let availablePagination = { page: 1, total: 0, has_more: false }; @@ -1085,17 +1099,67 @@ textarea { resize: vertical; min-height: 120px; } if (issueTrigger?.isConnected) issueTrigger.focus(); } + function renderPullReview(detail, focusFilename = null) { + pullReviewState = pullController.reviewState(selectedPull, detail); + qs('#pull-review-progress').textContent = pullReviewState.total ? + pullReviewState.reviewed.length + ' of ' + pullReviewState.total + ' files reviewed' : 'No changed files to review'; + qs('#next-unreviewed-pull-file').disabled = pullReviewState.complete; + const eligibility = createPullSheet.mergeEligibility(detail, pullReviewState); + qs('#pull-merge-state').textContent = eligibility.reason; + qs('#merge-pull').disabled = !eligibility.allowed; + qs('#pull-files').innerHTML = (detail.files || []).length ? detail.files.map((file, index) => + createPullSheet.renderFile(file, index, pullReviewState.reviewed.includes(file.filename), escapeHtml) + ).join('') : '' + lines + + (file.diff_truncated ? 'Preview truncated · open in Gitea for the full diff.' : '') + '' + : '