feat(comments): collapse sub-comments by default with expand preview#5420
Conversation
Sub-comments (replies) are now collapsed by default and show a preview with up to 3 overlapping user avatars and a "View X replies" link. Clicking expands to show all replies. Main comments remain visible. Resolves ENG-515 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix prettier formatting in spec file (multi-line function params) - Replace for...of loop with reduce to satisfy no-restricted-syntax rule Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
daily.dev Bot seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
@claude Have another look please, we already added something, it should just be expanded by default, and when minimized show 3 avatars + amount of comments. |
|
Claude finished @rebelchris's task in 5m 27s —— View job Changes completed
SummaryI've updated the comment behavior to match your requirements: What changed:
Files modified:
The linter passed successfully, and changes have been pushed to the branch. --- | |
…mized - Changed default state to expanded (useState(true)) - Replaced simple button with CollapsedRepliesPreview component showing 3 avatars + count - Updated tests to reflect new behavior - Removed unused state variables Co-authored-by: Chris Bongers <rebelchris@users.noreply.github.com>
| <button | ||
| type="button" | ||
| className={classNames( | ||
| 'flex w-full cursor-pointer items-center gap-2 px-4 py-3 hover:bg-surface-hover', |
There was a problem hiding this comment.
this should also be rounded-16 make sure to follow lint rules for order.
|
|
||
| const MAX_AVATARS = 3; | ||
|
|
||
| export default function CollapsedRepliesPreview({ |
There was a problem hiding this comment.
This component should not render if no sub comments.
|
Claude finished @dailydotdevbot's task in 4m 59s —— View job Changes completed
SummaryI've addressed both review comments: 1. Added rounded-16 to button (packages/shared/src/components/comments/CollapsedRepliesPreview.tsx:48)
2. Guard clause for empty replies (packages/shared/src/components/comments/CollapsedRepliesPreview.tsx:20)
Additional fixes:
Changes have been committed and pushed to the branch. --- | View commit |
…with no replies - Add rounded-16 class to button with proper class order - Add guard clause to return null when no replies exist - Fix React hooks rules violation by moving useMemo before early return - Update test to use proper testing library methods Co-authored-by: Chris Bongers <rebelchris@users.noreply.github.com>
|
@claude I still see "Hide replies" button when there are no replies. |
|
Claude finished @rebelchris's task in 2m 54s —— View job Changes completed
SummaryFixed the issue where the "Hide replies" button was showing even when there were no replies to hide. What changed:
The "Hide replies" button will now only show when there are actually replies to hide. |
Co-authored-by: Chris Bongers <rebelchris@users.noreply.github.com>
Summary
Closes ENG-515
Created by Huginn 🐦⬛
Preview domain
https://eng-515-comments-expanded-by-def.preview.app.daily.dev