From ed14f0cefff6004b60dd6ee1700cb65cc81c9f1d Mon Sep 17 00:00:00 2001
From: Cho Young-Hwi
Date: Mon, 16 Mar 2026 21:35:48 +0000
Subject: [PATCH 1/2] [#189] Add per-plot comment system with pagination
CommentSection component:
- Wallet signature auth for posting (not a transaction)
- 20 comments per page with "Show more" pagination
- Each comment: truncated address, content, relative timestamp
- Rate limit handled server-side (1 per address per plot per minute)
- Max 1000 chars, live counter
- Connect wallet prompt for unauthenticated users
Integrated into:
- Story page (genesis plot comments)
- Plot detail pages (per-chapter comments)
Fixes #189
Co-Authored-By: Claude Opus 4.6 (1M context)
---
.../story/[storylineId]/[plotIndex]/page.tsx | 4 +
src/app/story/[storylineId]/page.tsx | 6 +-
src/components/CommentSection.tsx | 191 ++++++++++++++++++
3 files changed, 200 insertions(+), 1 deletion(-)
create mode 100644 src/components/CommentSection.tsx
diff --git a/src/app/story/[storylineId]/[plotIndex]/page.tsx b/src/app/story/[storylineId]/[plotIndex]/page.tsx
index e257082b..8329d024 100644
--- a/src/app/story/[storylineId]/[plotIndex]/page.tsx
+++ b/src/app/story/[storylineId]/[plotIndex]/page.tsx
@@ -3,6 +3,7 @@ import { redirect } from "next/navigation";
import { createServerClient, type Storyline, type Plot } from "../../../../../lib/supabase";
import { truncateAddress } from "../../../../../lib/utils";
import { ViewTracker } from "../../../../components/ViewCount";
+import { CommentSection } from "../../../../components/CommentSection";
import Link from "next/link";
type Params = Promise<{ storylineId: string; plotIndex: string }>;
@@ -126,6 +127,9 @@ export default async function PlotDetailPage({ params }: { params: Params }) {
)}
+ {/* Comments */}
+
+
{/* Navigation */}