Context
Currently "create storyline" (/create) and "chain plot" (/chain) are separate pages with separate nav links. This is confusing for writers — they have to figure out which page to use. Combine them into one unified Create page with tab navigation.
Also, add a quick "Add a new Plot" button on the story detail page so writers can chain directly from their story.
Task 1: Combine create + chain into one tabbed page
Design
Under the page title "Create Storyline", add a tab bar:
- New tab: current
/create page form (title, genre, language, content, deadline toggle)
- Add Plot tab: current
/chain page form (storyline selector, title, content)
Default tab: New. If navigated with ?tab=chain or ?storyline=123, auto-select Add Plot tab and pre-fill the storyline ID.
Implementation
-
Move both forms into /create/page.tsx as tab content. Extract the current create form and chain form into separate components within the same file (or inline — keep it simple).
-
Delete /chain/page.tsx — no longer needed.
-
Add redirect for backward compat: create src/app/chain/page.tsx that redirects to /create?tab=chain. Or just remove it and update links.
-
Update NavBar (src/components/NavBar.tsx:13): Remove the chain nav link. Keep only create (or rename to write).
-
Update links:
src/components/Footer.tsx — /create link stays as-is
src/app/page.tsx — "create storyline" link stays as-is
- Any link pointing to
/chain should point to /create?tab=chain
Tab bar style
Same terminal aesthetic as FilterBar tokens:
Active tab: border-accent text-accent. Inactive: border-border text-muted hover:text-foreground.
Task 2: "Add a new Plot" button on story detail page
On src/app/story/[storylineId]/page.tsx, below the "Next plot due in" countdown timer, show a small button linking to the chain form — only visible when the connected wallet matches the storyline writer.
Design
Next plot due in 6d 23h 57m 54s
[ + Add a new Plot ]
- Button style: outline, small, same as "Read the first Plot" button but smaller text
- Links to
/create?tab=chain&storyline={storylineId}
- Only rendered when
address === storyline.writer_address (needs useAccount — this section may need to become a client component, or wrap just the button in a client component)
Implementation
Create a small client component AddPlotButton:
"use client";
import { useAccount } from "wagmi";
import Link from "next/link";
export function AddPlotButton({ storylineId, writerAddress }: { storylineId: number; writerAddress: string }) {
const { address } = useAccount();
if (!address || address.toLowerCase() !== writerAddress.toLowerCase()) return null;
return (
<Link
href={`/create?tab=chain&storyline=${storylineId}`}
className="border-accent text-accent hover:bg-accent/10 mt-3 block w-full rounded border py-2 text-center text-xs font-medium transition-colors"
>
+ Add a new Plot
</Link>
);
}
Place it after DeadlineCountdown in the story detail page.
Files to Change
src/app/create/page.tsx — add tab UI, incorporate chain form
src/app/chain/page.tsx — delete or redirect to /create?tab=chain
src/components/NavBar.tsx — remove chain nav link
src/app/story/[storylineId]/page.tsx — add AddPlotButton after deadline countdown
- New:
src/components/AddPlotButton.tsx — client component for writer-only button
Acceptance Criteria
Context
Currently "create storyline" (
/create) and "chain plot" (/chain) are separate pages with separate nav links. This is confusing for writers — they have to figure out which page to use. Combine them into one unified Create page with tab navigation.Also, add a quick "Add a new Plot" button on the story detail page so writers can chain directly from their story.
Task 1: Combine create + chain into one tabbed page
Design
Under the page title "Create Storyline", add a tab bar:
/createpage form (title, genre, language, content, deadline toggle)/chainpage form (storyline selector, title, content)Default tab:
New. If navigated with?tab=chainor?storyline=123, auto-selectAdd Plottab and pre-fill the storyline ID.Implementation
Move both forms into
/create/page.tsxas tab content. Extract the current create form and chain form into separate components within the same file (or inline — keep it simple).Delete
/chain/page.tsx— no longer needed.Add redirect for backward compat: create
src/app/chain/page.tsxthat redirects to/create?tab=chain. Or just remove it and update links.Update NavBar (
src/components/NavBar.tsx:13): Remove thechainnav link. Keep onlycreate(or rename towrite).Update links:
src/components/Footer.tsx—/createlink stays as-issrc/app/page.tsx— "create storyline" link stays as-is/chainshould point to/create?tab=chainTab bar style
Same terminal aesthetic as FilterBar tokens:
Active tab:
border-accent text-accent. Inactive:border-border text-muted hover:text-foreground.Task 2: "Add a new Plot" button on story detail page
On
src/app/story/[storylineId]/page.tsx, below the "Next plot due in" countdown timer, show a small button linking to the chain form — only visible when the connected wallet matches the storyline writer.Design
/create?tab=chain&storyline={storylineId}address === storyline.writer_address(needsuseAccount— this section may need to become a client component, or wrap just the button in a client component)Implementation
Create a small client component
AddPlotButton:Place it after
DeadlineCountdownin the story detail page.Files to Change
src/app/create/page.tsx— add tab UI, incorporate chain formsrc/app/chain/page.tsx— delete or redirect to/create?tab=chainsrc/components/NavBar.tsx— removechainnav linksrc/app/story/[storylineId]/page.tsx— addAddPlotButtonafter deadline countdownsrc/components/AddPlotButton.tsx— client component for writer-only buttonAcceptance Criteria
/createpage has[New]and[Add Plot]tabs/create?tab=chain&storyline=123auto-selects Add Plot tab and pre-fills storyline ID/chainno longer exists as a standalone page (redirect or deleted)createlink (no separatechain)/create?tab=chain&storyline={id}npm run buildandnpm run typecheckpass