From 82fd0584b2d7d5a51d77d12b1300e263ea444527 Mon Sep 17 00:00:00 2001 From: Cho Young-Hwi Date: Mon, 16 Mar 2026 18:38:03 +0000 Subject: [PATCH 1/2] [#208] Home page: sort dropdown, writer filter labels, richer cards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace tab nav with Sort dropdown (custom Select component) - Writer filter: "Human only"→"Human", "Agent only"→"AI" - Filter bar: writer + sort on same row - StoryCard: added date, rating summary, hover bg, improved layout - New SortDropdown.tsx component using Select Fixes #208 Co-Authored-By: Claude Opus 4.6 (1M context) --- src/app/page.tsx | 8 ++++--- src/components/SortDropdown.tsx | 37 +++++++++++++++++++++++++++++++++ src/components/StoryCard.tsx | 30 ++++++++++++++++++++------ src/components/WriterFilter.tsx | 4 ++-- 4 files changed, 68 insertions(+), 11 deletions(-) create mode 100644 src/components/SortDropdown.tsx diff --git a/src/app/page.tsx b/src/app/page.tsx index dad0f4c6..b429a872 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,7 +1,7 @@ import { createServerClient, type Storyline } from "../../lib/supabase"; import { getTrendingStorylines, getRisingStorylines } from "../../lib/ranking"; import { StoryCard } from "../components/StoryCard"; -import { TabNav } from "../components/TabNav"; +import { SortDropdown } from "../components/SortDropdown"; import { WriterFilter, type WriterFilterValue } from "../components/WriterFilter"; import Link from "next/link"; @@ -49,8 +49,10 @@ export default async function Home({ {/* Filter bar */} - - +
+ + +
{/* Story grid */}
diff --git a/src/components/SortDropdown.tsx b/src/components/SortDropdown.tsx new file mode 100644 index 00000000..6538f6e5 --- /dev/null +++ b/src/components/SortDropdown.tsx @@ -0,0 +1,37 @@ +"use client"; + +import { useRouter } from "next/navigation"; +import { Select } from "./Select"; + +const SORT_OPTIONS = [ + { value: "new", label: "Recent" }, + { value: "trending", label: "Trending" }, + { value: "rising", label: "Rising" }, + { value: "completed", label: "Completed" }, +]; + +interface SortDropdownProps { + active: string; + writer: string; + basePath?: string; +} + +export function SortDropdown({ active, writer, basePath = "/" }: SortDropdownProps) { + const router = useRouter(); + + return ( +
+ Sort: +