Replace prompt() with inline textarea in review section, close modal on submit

This commit is contained in:
2026-06-13 18:04:10 -04:00
parent 48d8fb4f44
commit 9b8f527776
7 changed files with 46 additions and 6 deletions
+4 -6
View File
@@ -205,6 +205,7 @@ function renderDetail(task) {
<div class="detail-section"><h4>Review</h4>
<span class="review-badge ${reviewStatus}">${reviewStatusText}</span>
${reviewComment}
<textarea class="review-textarea" id="review-comment-${task.name}" placeholder="Optional comment..." rows="2"></textarea>
<div class="review-actions">
<button class="review-btn approve" onclick="submitReview('${task.name}', 'approved')">✅ Approve</button>
<button class="review-btn changes" onclick="submitReview('${task.name}', 'changes_requested')">❌ Request Changes</button>
@@ -333,8 +334,8 @@ function renderTimeline() {
}
async function submitReview(taskName, status) {
const comment = prompt(status === 'changes_requested' ? 'Describe what changes are needed:' : 'Optional approval comment:');
if (comment === null) return;
const textarea = document.getElementById(`review-comment-${taskName}`);
const comment = textarea ? textarea.value : '';
try {
const res = await fetch(`/api/task/${taskName}/review`, {
method: 'POST',
@@ -343,11 +344,8 @@ async function submitReview(taskName, status) {
});
const data = await res.json();
if (data.success) {
closeDetail();
await refreshData();
const task = state.tasks.find(t => t.name === taskName);
if (task && task.name === (state.selectedTask && state.selectedTask.name)) {
renderDetail(task);
}
}
} catch (err) {
console.error('Review submission failed:', err);
+2
View File
@@ -252,6 +252,8 @@ kbd {
.review-btn.changes { border-color: var(--error); color: var(--error); }
.review-btn.changes:hover { background: var(--error-bg); }
.review-comment { font-size: 12px; color: var(--text-secondary); padding: 8px; background: var(--bg-primary); border-radius: 4px; margin-top: 4px; }
.review-textarea { width: 100%; margin-top: 8px; padding: 8px; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-primary); font-size: 12px; font-family: inherit; resize: vertical; }
.review-textarea:focus { outline: none; border-color: var(--accent); }
.task-card-artifacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.artifact-badge { font-size: 10px; padding: 1px 6px; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 3px; color: var(--text-secondary); font-family: monospace; }
+3
View File
@@ -0,0 +1,3 @@
# Review
- **Status**: approved
- **Timestamp**: 2026-06-13T18:00:41.433151
+3
View File
@@ -0,0 +1,3 @@
# Review
- **Status**: approved
- **Timestamp**: 2026-06-13T18:00:48.191824
+3
View File
@@ -0,0 +1,3 @@
# Review
- **Status**: approved
- **Timestamp**: 2026-06-13T18:00:58.458316
+3
View File
@@ -0,0 +1,3 @@
# Review
- **Status**: approved
- **Timestamp**: 2026-06-13T18:01:27.011077
+28
View File
@@ -0,0 +1,28 @@
# SPEC: Replace Prompt Dialog with Inline Comment Textarea
## Overview
The review approval flow uses `prompt()` for comments, which is a jarring browser popup. Replace it with a textarea in the detail modal. After submission, close the modal and return to the board.
## Changes
### dashboard.js
- Add comment `<textarea>` in the detail panel review section
- `submitReview()` reads from textarea instead of `prompt()`
- On success, close the modal (`closeDetail()`) instead of re-rendering it
### index.html
- No structural changes needed (textarea is rendered by JS in the detail panel)
### styles.css
- Add styles for the comment textarea
## Acceptance Criteria
- [ ] Review section shows a textarea for optional comment
- [ ] Clicking Approve/Request Changes submits with textarea content
- [ ] Modal closes after successful submission
- [ ] No browser `prompt()` popup
## Notes
- Textarea is always visible in the review section
- Comment is optional (can be empty)