Conversation
- RatingWidget: star selector (1-5), optional comment, wallet signing - Token-gated: checks balanceOf() before showing form - Shows existing rating pre-filled for re-rating - Displays average rating + count in header area - Lists recent ratings with truncated addresses - Non-holders see "Hold tokens to rate" prompt Fixes #81 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The widget covers most of the rating flow, but there are two user-visible regressions: stale prefill state when the connected wallet changes, and the average/count were not added to the story header as required by issue #81.
Findings
- [high] The prefill effect only sets local state when the new wallet already has a rating; it never clears
selectedRating/commentwhen the address changes to a wallet that has not rated yet, or when the wallet disconnects. That means wallet B can inherit wallet A's previous rating in the form and accidentally submit an unintended re-rating.- File:
src/components/RatingWidget.tsx:88 - Suggestion: in the same effect, add an
elsepath that resets the local form state when no existing rating is found, and also clear state whenaddressbecomes undefined.
- File:
- [medium] Issue #81 explicitly asks for the average rating and count on the story page header, but this PR renders that summary only inside the
RatingWidgetsection belowDonateWidget. The story header component remains unchanged.- File:
src/app/story/[storylineId]/page.tsx:58 - Suggestion: fetch/pass rating summary into
StoryHeaderand render the average/count there, keeping the widget for submission and recent ratings below.
- File:
Decision
Requesting changes because the stale-wallet prefill is a correctness bug and the current placement does not satisfy the issue's header requirement.
- Reset selectedRating/comment when wallet changes and no existing rating - Added RatingSummary client component to story header (average + count) - Uses shared react-query key so header and widget stay in sync Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The follow-up resolves the stale-wallet form state and adds the rating summary to the story header as requested by issue #81. The UI flow now matches the API contract and the issue requirements.
Findings
- No blocking findings.
Decision
Approving because the rating widget and header summary now satisfy the token-gated UI requirements for #81.
Summary
RatingWidgetclient component with star selector (1-5), optional comment textarea, and wallet signature flowbalanceOf()on storyline token — non-holders see "Hold storyline tokens to rate" promptsignMessageAsync()with canonical format"Rate storyline {id} with rating {n}"Test plan
npm run lintpassesnpm run typecheckpassesFixes #81
🤖 Generated with Claude Code