Skip to content

Show comment count badge on Discussion tab - #16

Open
alexandramartinez wants to merge 1 commit into
bighnesh0007:masterfrom
alexandramartinez:feat/discussion-comment-count
Open

Show comment count badge on Discussion tab#16
alexandramartinez wants to merge 1 commit into
bighnesh0007:masterfrom
alexandramartinez:feat/discussion-comment-count

Conversation

@alexandramartinez

Copy link
Copy Markdown
Collaborator

Summary

Adds a count badge next to the Discussion tab label so users can tell at a glance how many comments a problem has — and decide whether to switch to the tab — without opening it first.

Changes

  • Comments accepts an optional onCountChange callback and reports comments.length up to its parent.
  • Workspace tracks the count in state and renders a Badge beside the "Discussion" tab label when the count is > 0 (hidden at 0 and while loading).
  • The comments TabsContent now uses keepMounted so the count loads on page mount rather than only after the tab is first opened (base-ui unmounts inactive panels by default).

Testing

  • npx tsc --noEmit passes.
  • Seeded 3 comments on a problem locally and confirmed the badge renders 3 next to the Discussion tab on page load, before clicking into the tab.

🤖 Generated with Claude Code

Surface the number of comments next to the "Discussion" tab label so
users can see at a glance whether there's activity worth switching to.

- Comments reports its count up via an optional onCountChange callback
- Workspace tracks the count and renders a Badge when > 0
- The comments TabsContent is kept mounted so the count loads on page
  load instead of only after the tab is first opened

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

@alexandramartinez is attempting to deploy a commit to the bighnesh's projects Team on Vercel.

A member of the Team first needs to authorize it.

@alexandramartinez

Copy link
Copy Markdown
Collaborator Author

here's a preview

image

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