Show comment count badge on Discussion tab - #16
Open
alexandramartinez wants to merge 1 commit into
Open
Conversation
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>
|
@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. |
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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
Commentsaccepts an optionalonCountChangecallback and reportscomments.lengthup to its parent.Workspacetracks the count in state and renders aBadgebeside the "Discussion" tab label when the count is > 0 (hidden at 0 and while loading).TabsContentnow useskeepMountedso 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 --noEmitpasses.3next to the Discussion tab on page load, before clicking into the tab.🤖 Generated with Claude Code