From 298fbef5624e7870ac02338108ea17c80a3d0134 Mon Sep 17 00:00:00 2001 From: Bhavik Patel Date: Thu, 5 Mar 2026 07:58:53 +0400 Subject: [PATCH] fix: lock task comment author to authenticated user - Remove manual Author text input from comment form (security concern) - Use authenticated currentUser.username as comment author automatically - Display 'Posting as ' read-only indicator - Add inline documentation explaining comment vs broadcast semantics - Document subscription model: auto-subscribed on create, assign, comment, @mention Fixes #167 --- src/components/panels/task-board-panel.tsx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/components/panels/task-board-panel.tsx b/src/components/panels/task-board-panel.tsx index 74a6810..95df955 100644 --- a/src/components/panels/task-board-panel.tsx +++ b/src/components/panels/task-board-panel.tsx @@ -770,13 +770,14 @@ function TaskDetailModal({ onUpdate: () => void onEdit: (task: Task) => void }) { + const { currentUser } = useMissionControl() + const commentAuthor = currentUser?.username || 'system' const resolvedProjectName = task.project_name || projects.find((project) => project.id === task.project_id)?.name const [comments, setComments] = useState([]) const [loadingComments, setLoadingComments] = useState(false) const [commentText, setCommentText] = useState('') - const [commentAuthor, setCommentAuthor] = useState('system') const [commentError, setCommentError] = useState(null) const [broadcastMessage, setBroadcastMessage] = useState('') const [broadcastStatus, setBroadcastStatus] = useState(null) @@ -1026,14 +1027,9 @@ function TaskDetailModal({ )}
-
- - setCommentAuthor(e.target.value)} - className="w-full bg-surface-1 text-foreground border border-border rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary/50" - /> +
+ Posting as + {commentAuthor}
@@ -1056,6 +1052,12 @@ function TaskDetailModal({
+
+
How notifications work
+
Comments are persisted on the task and notify all subscribers. Subscribers are auto-added when they: create the task, are assigned to it, comment on it, or are @mentioned.
+
Broadcasts send a one-time notification to all current subscribers without creating a comment record.
+
+
Broadcast to Subscribers
{broadcastStatus && (