kan icon indicating copy to clipboard operation
kan copied to clipboard

feat: nested comments and replies

Open program-the-brain-not-the-heartbeat opened this issue 9 months ago • 1 comments

This pull request implements threaded (nested) comments for card activities, allowing users to reply to specific comments and view comment threads with proper indentation. It introduces a new reply-to-comment workflow, updates the UI to support nested replies, and refactors activity loading for better pagination and thread rendering.

Threaded Comments and Reply Workflow

  • Added support for nested comments by tracking parent-child relationships between comments and rendering comment threads recursively with indentation. (apps/web/src/views/card/components/ActivityList.tsx [1] [2]; apps/web/src/views/card/components/Comment.tsx [3] [4]
  • Introduced a reply-to-comment workflow, including UI for replying to comments, passing reply context, and displaying a reply form inline within comment threads. (apps/web/src/views/card/components/ActivityList.tsx [1] [2]; apps/web/src/views/card/components/NewCommentForm.tsx [3] [4]

Pagination and Activity Loading Improvements

  • Refactored activity pagination logic to use a nextCursor value from the backend instead of relying on timestamps, improving reliability when loading more activities. (apps/web/src/views/card/components/ActivityList.tsx [1] [2] [3] [4] [5]

UI and Permission Updates

  • Updated the Comment component to show a reply button (arrow icon) when the user has permission to reply, and to visually indent comments based on their depth in the thread. (apps/web/src/views/card/components/Comment.tsx [1] [2] [3]
  • Updated the NewCommentForm to support replying to a specific comment, including showing the reply target and a cancel button. (apps/web/src/views/card/components/NewCommentForm.tsx [1] [2] [3] [4]

Imports and Type Handling

  • Updated imports and type usages to support new props and maintain type safety across the affected components. (apps/web/src/views/card/components/ActivityList.tsx [1]; apps/web/src/views/card/components/Comment.tsx [2]; apps/web/src/views/card/components/NewCommentForm.tsx [3]

These changes collectively enable a much richer commenting experience on cards, supporting discussions and replies in a clear, organized manner.

Functionally this works great, but the design needs a bit more thought @program-the-brain-not-the-heartbeat

Let me take a look at some similar tools to see how they're solving this problem

hjball avatar Mar 11 '26 21:03 hjball