Add Slack-style emoji reactions to comments and issue descriptions with full-stack support: database tables, REST API endpoints, real-time WebSocket sync, optimistic UI updates, and inbox notifications. - New `comment_reaction` and `issue_reaction` tables with migrations - POST/DELETE endpoints for adding/removing reactions on both comments and issue descriptions - Real-time WS events (reaction:added/removed, issue_reaction:added/removed) - Shared ReactionBar component with quick emoji picker and full emoji-mart picker (lazy-loaded) - Optimistic add/remove with rollback on failure - Inbox notifications for comment author and issue creator when reacted to - Reactions included in timeline, comment list, and issue detail responses
14 lines
504 B
SQL
14 lines
504 B
SQL
-- name: AddIssueReaction :one
|
|
INSERT INTO issue_reaction (issue_id, workspace_id, actor_type, actor_id, emoji)
|
|
VALUES ($1, $2, $3, $4, $5)
|
|
ON CONFLICT (issue_id, actor_type, actor_id, emoji) DO UPDATE SET created_at = issue_reaction.created_at
|
|
RETURNING *;
|
|
|
|
-- name: RemoveIssueReaction :exec
|
|
DELETE FROM issue_reaction
|
|
WHERE issue_id = $1 AND actor_type = $2 AND actor_id = $3 AND emoji = $4;
|
|
|
|
-- name: ListIssueReactions :many
|
|
SELECT * FROM issue_reaction
|
|
WHERE issue_id = $1
|
|
ORDER BY created_at ASC;
|