From 62a3d899edb17546d165e7044ee70a34f3f5c746 Mon Sep 17 00:00:00 2001 From: Cho Young-Hwi Date: Wed, 18 Mar 2026 09:04:47 +0000 Subject: [PATCH 1/2] [#289] Book-cover style story cards on home page - StoryCard redesigned as portrait 2:3 aspect ratio book cover with genre tag (top), title (center), author (bottom) - Metadata row (plot count, TVL, rating) moved below the card - Grid: 2 columns on mobile, 3 on desktop - Flat outline aesthetic preserved, no gradients or shadows Fixes #289 Co-Authored-By: Claude Opus 4.6 (1M context) --- src/app/page.tsx | 2 +- src/components/StoryCard.tsx | 99 ++++++++++++++++-------------------- 2 files changed, 45 insertions(+), 56 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 9e38be24..0b5cb4ac 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -81,7 +81,7 @@ export default async function Home({ {/* Story grid */} -
+
{storylines.map((s) => ( ))} diff --git a/src/components/StoryCard.tsx b/src/components/StoryCard.tsx index 3bd53a57..977c61e5 100644 --- a/src/components/StoryCard.tsx +++ b/src/components/StoryCard.tsx @@ -4,78 +4,67 @@ import { AgentBadge } from "./AgentBadge"; import { WriterIdentityClient } from "./WriterIdentityClient"; import { RatingSummary } from "./RatingSummary"; import { StoryCardStats } from "./StoryCardStats"; -import { ViewCount } from "./ViewCount"; export function StoryCard({ storyline, genre, - preview, }: { storyline: Storyline; genre?: string; preview?: string; }) { - const dateStr = storyline.block_timestamp - ? new Date(storyline.block_timestamp).toLocaleDateString("en-US", { - month: "short", - day: "numeric", - }) - : null; + const displayGenre = genre || storyline.genre; return ( - - {/* Title + completion badge */} -
-

- {storyline.title} -

- {storyline.sunset && ( - - complete +
+ {/* Book cover */} + + {/* Top: genre tag + completion badge */} +
+ + {displayGenre || "Uncategorized"} - )} -
- - {/* Author + meta */} -
- By: - - {storyline.plot_count} {storyline.plot_count === 1 ? "plot" : "plots"} - - - {dateStr && {dateStr}} - - {genre || storyline.genre || Uncategorized} - - {storyline.language && storyline.language !== "English" && ( - - {storyline.language} - - )} - {storyline.writer_type === 1 && } -
+ {storyline.sunset && ( + + complete + + )} +
- {/* Stats row: price, TVL */} - {storyline.token_address && ( -
- + {/* Center: title */} +
+

+ {storyline.title} +

+ {storyline.language && storyline.language !== "English" && ( + + {storyline.language} + + )}
- )} - {/* Genesis preview */} - {preview && ( -

- {preview} -

- )} + {/* Bottom: author */} +
+ + {storyline.writer_type === 1 && } +
+ - {/* Rating */} -
+ {/* Metadata row below card */} +
+
+ + {storyline.plot_count} {storyline.plot_count === 1 ? "plot" : "plots"} + + {storyline.token_address && ( + + )} +
- +
); } From 84389bca6b312886fe845bc7c47aafd99123ecab Mon Sep 17 00:00:00 2001 From: Cho Young-Hwi Date: Wed, 18 Mar 2026 09:06:41 +0000 Subject: [PATCH 2/2] [#289] Remove unused preview prop and genesis plot fetch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Book cover cards don't display previews — remove the dead code path and the extra Supabase query. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/app/page.tsx | 16 +--------------- src/components/StoryCard.tsx | 1 - 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 0b5cb4ac..8bcb0e20 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -38,22 +38,8 @@ export default async function Home({ const supabase = createServerClient(); let storylines: Storyline[] = []; - const previews: Record = {}; if (supabase) { storylines = await queryTab(supabase, tab, writer, page, genre, lang); - // Fetch genesis plot previews - if (storylines.length > 0) { - const { data: plots } = await supabase.from("plots") - .select("storyline_id, content") - .in("storyline_id", storylines.map((s) => s.storyline_id)) - .eq("plot_index", 0) - .eq("contract_address", STORY_FACTORY.toLowerCase()); - if (plots) { - for (const p of plots as { storyline_id: number; content: string }[]) { - previews[p.storyline_id] = p.content.slice(0, 120); - } - } - } } const extraParams = writer !== "all" ? { writer } : undefined; @@ -83,7 +69,7 @@ export default async function Home({ {/* Story grid */}
{storylines.map((s) => ( - + ))}
diff --git a/src/components/StoryCard.tsx b/src/components/StoryCard.tsx index 977c61e5..784c82df 100644 --- a/src/components/StoryCard.tsx +++ b/src/components/StoryCard.tsx @@ -11,7 +11,6 @@ export function StoryCard({ }: { storyline: Storyline; genre?: string; - preview?: string; }) { const displayGenre = genre || storyline.genre;