Skip to content

[P9-5] Per-plot comment system with pagination #189

@realproject7

Description

@realproject7

Overview

Add a comment section to each genesis and plot page, similar to Wattpad chapter comments.

Components

CommentSection component

  • Text input with "Write a comment..." placeholder
  • Submit requires connected wallet (sign message for auth, NOT a tx)
  • Comment list with pagination (20 per page, "Show more" button)
  • Each comment shows: commenter address (truncated), content, timestamp
  • Newest first ordering

API routes

  • GET /api/comments?storylineId=X&plotIndex=Y&page=1&limit=20
    • Returns paginated comments
    • Include total count for pagination
  • POST /api/comments
    • Body: { storylineId, plotIndex, content, signature }
    • Verify wallet signature server-side
    • Rate limit: max 1 comment per address per plot per minute

Where it appears

  • Genesis page (main story page): plotIndex = 0
  • Each plot detail page: plotIndex = N

Moderation

  • Use existing hidden column in comments table
  • Admin hide/unhide routes (extend existing moderation pattern from plots)

Acceptance Criteria

  • Comment input visible on genesis and each plot page
  • Wallet connection required to comment (show CTA if disconnected)
  • Comments stored in Supabase comments table
  • Pagination with "Show more" (20 per page)
  • Comments display: address, content, relative timestamp
  • Rate limiting prevents spam
  • Hidden comments filtered from display
  • Mobile responsive 375px

Blocked by: #185 (DB schema for comments table)

Part of: Phase 9 Epic (#183)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions