Skip to content

feat: improve session climb display with attempt details, comments, and fix likes#876

Merged
marcodejongh merged 2 commits intomainfrom
claude/improve-climb-display-PwDoJ
Mar 1, 2026
Merged

feat: improve session climb display with attempt details, comments, and fix likes#876
marcodejongh merged 2 commits intomainfrom
claude/improve-climb-display-PwDoJ

Conversation

@marcodejongh
Copy link
Owner

  • Replace cryptic "11x" with descriptive text: "on 11th attempt, 35 total"
    where total attempts = sum of attemptCount since last successful ascent
  • Add totalAttempts field to SessionDetailTick (schema, types, resolver)
  • Backend computes totalAttempts per (user, climb, board, angle) via CTE query
  • Add expanding comment button (FeedCommentButton) on each tick
  • Fix tick likes not persisting by wrapping ClimbsList with VoteSummaryProvider
    and removing hardcoded zero initial values from VoteButton

https://claude.ai/code/session_01KZDf3WEi4WBSSrZHka6cCP

@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 10:32am

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 issues noted below, but nothing blocking.

Issues

  1. Missing tests for complex backend logic - The new totalAttempts CTE query in packages/backend/src/graphql/resolvers/social/session-feed.ts:280-335 computes attempt history with multiple edge cases (no previous success, success on same day, etc.). This should have test coverage.

  2. Weak typing with as unknown as - session-feed.ts:339-346 uses unsafe type casting for the query result. Consider defining a proper type or using Drizzle's typed query helpers if available.

…nd fix likes

- Replace cryptic "11x" with descriptive text: "on 11th attempt, 35 total"
  where total attempts = sum of attemptCount since last successful ascent
- Add totalAttempts field to SessionDetailTick (schema, types, resolver)
- Backend computes totalAttempts per (user, climb, board, angle) via CTE query
- Add expanding comment button (FeedCommentButton) on each tick
- Fix tick likes not persisting by wrapping ClimbsList with VoteSummaryProvider
  and removing hardcoded zero initial values from VoteButton

https://claude.ai/code/session_01KZDf3WEi4WBSSrZHka6cCP
@marcodejongh marcodejongh force-pushed the claude/improve-climb-display-PwDoJ branch from baeb34d to 5fefa9b Compare March 1, 2026 10:17
@claude
Copy link

claude bot commented Mar 1, 2026

Claude Review

⚠️ Needs attention - Regression for unauthenticated users: upvote counts will show as 0.

Issues

  1. Unauthenticated users see 0 upvotes on all ticks (packages/web/app/session/[sessionId]/session-detail-content.tsx:385-388)

    • VoteButton no longer receives initialUpvotes={tick.upvotes}
    • VoteSummaryProvider only fetches when isAuthenticated is true
    • For logged-out users: provider doesn't fetch, but its context exists, so VoteButton skips individual fetch and defaults to 0
    • Previously, SSR-provided tick.upvotes was displayed correctly
  2. Existing test will fail (packages/web/app/session/__tests__/session-detail-content.test.tsx:272-281)

    • Test 'renders per-tick VoteButton with tick entity type and SSR upvotes' expects data-initial-upvotes='3'
    • New code doesn't pass initialUpvotes, so mock returns 0

Suggested Fix

Pass initialUpvotes={tick.upvotes} back to VoteButton. The VoteSummaryProvider will override it for authenticated users via the context, while unauthenticated users will still see the SSR counts.

- Pass initialUpvotes={tick.upvotes} to tick VoteButton so unauthenticated
  users see SSR-provided upvote counts (VoteSummaryProvider only fetches
  when authenticated, but its context presence prevents individual fetch)
- Fix FeedCommentButton test to use getAllByTestId since there are now
  both session-level and tick-level comment buttons
- Add tests for attempt text formatting (totalAttempts, flash no-text)

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

claude bot commented Mar 1, 2026

Claude Review

Ready to merge - Minor issues noted below, but nothing blocking.

Issues

  1. Test file line 300: totalAttempts: 0 is passed at session level but totalAttempts is a tick-level property. Harmless since it gets ignored, but could be removed for clarity.

    const session = makeSession({
      totalAttempts: 0, // <-- This should be removed; not a session property
      ticks: [{...
  2. packages/backend/src/graphql/resolvers/social/session-feed.ts:370-379: The type assertion on raw SQL result (as unknown as {...}) is fragile. Consider adding runtime validation or using Drizzle's typed query patterns if possible for better type safety.

Tests

  • Good coverage for the new totalAttempts display logic including edge cases (flash vs send)
  • Tests verify both the positive case (showing attempts) and negative case (no extra text for flash)

@marcodejongh marcodejongh merged commit 74ddf0e into main Mar 1, 2026
7 of 8 checks passed
@marcodejongh marcodejongh deleted the claude/improve-climb-display-PwDoJ branch March 1, 2026 10:41
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