auto-sync: 2026-05-20 10:26:42

This commit is contained in:
cfdaily
2026-05-20 10:26:42 +08:00
parent 764924818e
commit a421cb7860
+49
View File
@@ -434,6 +434,55 @@ export default function TaskModal() {
</div>
)}
{/* 评论输入框 */}
<div style={{ marginBottom: 16 }}>
<SectionLabel icon="✍️" title="发表评论" />
<div style={{ display: 'flex', gap: 6, alignItems: 'flex-start' }}>
<select id="comment-type-select" style={{
fontSize: 11, padding: '6px 8px', borderRadius: 6,
border: '1px solid var(--line)', background: 'var(--panel2)',
color: 'var(--fg)', cursor: 'pointer', flexShrink: 0,
}}>
<option value="general">💬 </option>
<option value="handoff">🤝 </option>
<option value="progress">📊 </option>
<option value="observation">👁 </option>
</select>
<input
id="comment-body-input"
type="text"
placeholder="输入评论内容..."
style={{
flex: 1, padding: '6px 10px', borderRadius: 6,
border: '1px solid var(--line)', background: 'var(--panel2)',
color: 'var(--fg)', fontSize: 12, outline: 'none',
}}
onKeyDown={(e) => {
if (e.key === 'Enter') {
const body = (e.target as HTMLInputElement).value.trim();
const typeEl = document.getElementById('comment-type-select') as HTMLSelectElement;
if (!body || !task) return;
const pid = selectedProjectId;
if (!pid) return;
fetch(`/api/projects/${pid}/tasks/${task.id}/comments`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ author: 'user', body, comment_type: typeEl?.value || 'general' }),
}).then(r => r.json()).then(r => {
if (r.ok) {
(e.target as HTMLInputElement).value = '';
loadV2TaskDetail(task.id);
toast('评论已发送', 'ok');
} else {
toast(r.error || '评论失败', 'err');
}
}).catch(() => toast('评论失败', 'err'));
}
}}
/>
</div>
</div>
{/* 决策记录 */}
{decisions.length > 0 && (
<div style={{ marginBottom: 16 }}>