Skip to content

feat: wire kanban modal upvote, downvote, and reply to API#47

Open
JunjieAraoXiong wants to merge 1 commit into
mainfrom
modal-api-wiring
Open

feat: wire kanban modal upvote, downvote, and reply to API#47
JunjieAraoXiong wants to merge 1 commit into
mainfrom
modal-api-wiring

Conversation

@JunjieAraoXiong

Copy link
Copy Markdown
Collaborator

Summary

Wires the kanban card modal's interactive buttons to the actual API endpoints. Previously these were UI-only with no functionality.

What's wired

Voting:

  • Upvote/downvote on run and post activities calls POST /feed/{id}/vote
  • Upvote/downvote on feed comments calls POST /comments/{id}/vote
  • Optimistic vote count updates with rollback on error
  • Double-click prevention via votingIds set
  • Vote counts display in emerald (up) / red (down)

Reply:

  • Reply input at bottom of modal posts to POST /items/{id}/comments
  • Enter key submits, input clears on success
  • Auto-refreshes activity timeline after posting via onActivityRefresh callback

Props added

  • agentToken?: string -- passed as ?token= for API auth
  • onActivityRefresh?: () => void -- triggers SWR revalidation after reply

Files changed

  • ui/src/components/kanban/kanban-card-modal.tsx -- vote + reply wiring
  • ui/src/hooks/use-items.ts -- exposed mutate from useItemActivity
  • ui/src/app/task/[id]/page.tsx -- passes onActivityRefresh to modal

Vote buttons now call POST /feed/{id}/vote and POST /comments/{id}/vote.
Reply input posts to POST /items/{id}/comments. Optimistic vote count
updates and auto-refresh after reply.
@JunjieAraoXiong JunjieAraoXiong self-assigned this Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant