Skip to content

fix: SSR vote counts for session detail ticks and add comment count button#875

Merged
marcodejongh merged 2 commits intomainfrom
claude/fix-vote-counts-ssr-B2ZTn
Mar 1, 2026
Merged

fix: SSR vote counts for session detail ticks and add comment count button#875
marcodejongh merged 2 commits intomainfrom
claude/fix-vote-counts-ssr-B2ZTn

Conversation

@marcodejongh
Copy link
Owner

Tick-level VoteButtons were hardcoded with initialUpvotes={0} and
initialUserVote={0}, which prevented them from ever loading real vote
counts. This adds upvotes to the SessionDetailTick type and batch-fetches
tick vote counts in the backend resolver so they render correctly on
initial page load. Also replaces standalone CommentSection with
FeedCommentButton (with new defaultExpanded prop) to show the SSR'd
comment count.

https://claude.ai/code/session_015CCDzunZzCLDf2vkf4yvVW

…utton

Tick-level VoteButtons were hardcoded with initialUpvotes={0} and
initialUserVote={0}, which prevented them from ever loading real vote
counts. This adds upvotes to the SessionDetailTick type and batch-fetches
tick vote counts in the backend resolver so they render correctly on
initial page load. Also replaces standalone CommentSection with
FeedCommentButton (with new defaultExpanded prop) to show the SSR'd
comment count.

https://claude.ai/code/session_015CCDzunZzCLDf2vkf4yvVW
@vercel
Copy link

vercel bot commented Mar 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
boardsesh Building Building Preview, Comment Mar 1, 2026 9:24am

Request Review

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@claude
Copy link

claude bot commented Mar 1, 2026

Claude Review

Ready to merge - Minor test coverage gap noted below, but nothing blocking.

Issues

  1. Test doesn't verify tick upvotes are passed correctly - packages/web/app/session/__tests__/session-detail-content.test.tsx:58-61

    The VoteButton mock only captures entityType and entityId, not initialUpvotes. The test at line 272 verifies the tick VoteButton exists but doesn't verify the upvotes value (which was the bug being fixed). Consider adding data-initial-upvotes={initialUpvotes} to the mock and asserting it equals 3 (the value in makeSession).

The VoteButton mock now captures initialUpvotes, and the tick VoteButton
test asserts it equals 3 (the value from the fixture). This directly
validates the fix that was the purpose of the previous commit.

https://claude.ai/code/session_015CCDzunZzCLDf2vkf4yvVW
@claude
Copy link

claude bot commented Mar 1, 2026

Claude Review

Ready to merge - No significant issues found.

The implementation correctly adds SSR vote counts by:

  • Batch-fetching tick votes in the backend resolver with proper null coalescing
  • Extending the SessionDetailTick type consistently across GraphQL schema and TypeScript types
  • Removing the now-unnecessary initialUserVote={0} prop (VoteButton handles undefined correctly via line 53's ?? 0)
  • Adding tests that verify SSR upvotes are passed through

Tests are appropriately updated to cover the new functionality.

@marcodejongh marcodejongh merged commit ae2740f into main Mar 1, 2026
6 of 8 checks passed
@marcodejongh marcodejongh deleted the claude/fix-vote-counts-ssr-B2ZTn branch March 1, 2026 10:01
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.

2 participants