From e8d53e388cd5b45c504b4bec96a67db46f3f9d17 Mon Sep 17 00:00:00 2001 From: Cho Young-Hwi Date: Mon, 16 Mar 2026 15:08:11 +0000 Subject: [PATCH 1/2] [#179] Replace optional 72h deadline with mandatory 7-day deadline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - DEADLINE_HOURS: 72 → 168 in DeadlineCountdown and CLI status - Create page: remove deadline checkbox, always pass hasDeadline=true - SDK: default hasDeadline to true - Writer dashboard + story page: remove has_deadline guards, always show countdown when last_plot_time exists and not sunset - Add info text on create page about mandatory 7-day deadline Fixes #179 Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/cli/src/commands/status.ts | 2 +- packages/sdk/src/client.ts | 4 ++-- src/app/create/page.tsx | 22 +++++----------------- src/app/dashboard/writer/page.tsx | 8 +++----- src/app/story/[storylineId]/page.tsx | 2 +- src/components/DeadlineCountdown.tsx | 2 +- 6 files changed, 13 insertions(+), 27 deletions(-) diff --git a/packages/cli/src/commands/status.ts b/packages/cli/src/commands/status.ts index ae9a15e5..62cc346c 100644 --- a/packages/cli/src/commands/status.ts +++ b/packages/cli/src/commands/status.ts @@ -134,7 +134,7 @@ export function registerStatus(program: Command): void { // Deadline remaining (72h from last plot) if (dbRow.has_deadline && dbRow.last_plot_time && !dbRow.sunset) { - const DEADLINE_HOURS = 72; + const DEADLINE_HOURS = 168; const deadlineMs = new Date(dbRow.last_plot_time).getTime() + DEADLINE_HOURS * 60 * 60 * 1000; const remainingMs = deadlineMs - Date.now(); diff --git a/packages/sdk/src/client.ts b/packages/sdk/src/client.ts index 8e1b8481..d0df7320 100644 --- a/packages/sdk/src/client.ts +++ b/packages/sdk/src/client.ts @@ -194,14 +194,14 @@ export class PlotLink { * @param title - Storyline title * @param content - Opening plot content (plain text) * @param genre - Genre label (stored off-chain; used for agent URI composition) - * @param hasDeadline - Whether the storyline has a sunset deadline (default: false) + * @param hasDeadline - Whether the storyline has a sunset deadline (default: true, mandatory 7-day) * @returns The storyline ID, transaction hash, and IPFS CID */ async createStoryline( title: string, content: string, genre: string, - hasDeadline = false, + hasDeadline = true, ): Promise { this.requireFilebase(); validateNonEmpty("title", title); diff --git a/src/app/create/page.tsx b/src/app/create/page.tsx index e54f60f1..3e1c1554 100644 --- a/src/app/create/page.tsx +++ b/src/app/create/page.tsx @@ -27,7 +27,7 @@ export default function CreateStorylinePage() { const { isConnected } = useAccount(); const [title, setTitle] = useState(""); const [content, setContent] = useState(""); - const [hasDeadline, setHasDeadline] = useState(false); + const hasDeadline = true; // mandatory 7-day deadline for all storylines const { state, error, execute, reset } = usePublish(); const { valid, charCount } = validateContentLength(content); @@ -134,22 +134,10 @@ export default function CreateStorylinePage() { - {/* Deadline toggle */} - + {/* Deadline info */} +

+ All storylines have a 7-day deadline — the story sunsets if no new plot is added within 7 days. +

{/* Status */} {state === "error" && ( diff --git a/src/app/dashboard/writer/page.tsx b/src/app/dashboard/writer/page.tsx index 678e2785..03f5fe2b 100644 --- a/src/app/dashboard/writer/page.tsx +++ b/src/app/dashboard/writer/page.tsx @@ -131,11 +131,9 @@ function StorylineDetail({ storyline, writerAddress }: { storyline: Storyline; w - {!storyline.sunset && - storyline.has_deadline && - storyline.last_plot_time && ( - - )} + {!storyline.sunset && storyline.last_plot_time && ( + + )} {storyline.token_address && ( <> diff --git a/src/app/story/[storylineId]/page.tsx b/src/app/story/[storylineId]/page.tsx index e25828eb..2f2ac8f9 100644 --- a/src/app/story/[storylineId]/page.tsx +++ b/src/app/story/[storylineId]/page.tsx @@ -217,7 +217,7 @@ function StoryHeader({ {storyline.plot_count} {storyline.plot_count === 1 ? "plot" : "plots"} total - ) : storyline.has_deadline && storyline.last_plot_time ? ( + ) : storyline.last_plot_time ? ( ) : null} diff --git a/src/components/DeadlineCountdown.tsx b/src/components/DeadlineCountdown.tsx index 07cb5a9b..133423d8 100644 --- a/src/components/DeadlineCountdown.tsx +++ b/src/components/DeadlineCountdown.tsx @@ -2,7 +2,7 @@ import { useState, useEffect } from "react"; -const DEADLINE_HOURS = 72; +const DEADLINE_HOURS = 168; export function DeadlineCountdown({ lastPlotTime }: { lastPlotTime: string }) { const [remaining, setRemaining] = useState(null); From 8f28b37bedc2a1a0a7d1e9d73c0b5172fd4076a7 Mon Sep 17 00:00:00 2001 From: Cho Young-Hwi Date: Mon, 16 Mar 2026 15:11:11 +0000 Subject: [PATCH 2/2] [#179] Remove --deadline flag from CLI create command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Always pass hasDeadline=true — no opt-out path. Mandatory 7-day deadline is now enforced across all creation surfaces. Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/cli/src/commands/create.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/commands/create.ts b/packages/cli/src/commands/create.ts index 59146969..b171a7e5 100644 --- a/packages/cli/src/commands/create.ts +++ b/packages/cli/src/commands/create.ts @@ -9,18 +9,17 @@ export function registerCreate(program: Command): void { .requiredOption("-t, --title ", "Storyline title") .requiredOption("-f, --file <path>", "Path to content file (plain text)") .requiredOption("-g, --genre <genre>", "Genre label") - .option("-d, --deadline", "Enable sunset deadline", false) - .action(async (opts: { title: string; file: string; genre: string; deadline: boolean }) => { + .action(async (opts: { title: string; file: string; genre: string }) => { try { const content = readFileSync(opts.file, "utf-8"); const client = buildClient({ ipfs: true }); - console.log(`Creating storyline "${opts.title}"...`); + console.log(`Creating storyline "${opts.title}" (7-day deadline)...`); const result = await client.createStoryline( opts.title, content, opts.genre, - opts.deadline, + true, ); console.log("Storyline created!");