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!"); 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<CreateStorylineResult> { 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() { </div> </div> - {/* Deadline toggle */} - <label className="flex cursor-pointer items-center gap-3"> - <input - type="checkbox" - checked={hasDeadline} - onChange={(e) => setHasDeadline(e.target.checked)} - disabled={busy} - className="accent-accent h-4 w-4" - /> - <span className="text-foreground text-sm"> - Enable 72h deadline - </span> - <span className="text-muted text-xs"> - Story sunsets if no new plot within 72 hours - </span> - </label> + {/* Deadline info */} + <p className="text-muted text-xs"> + All storylines have a 7-day deadline — the story sunsets if no new plot is added within 7 days. + </p> {/* 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 </div> </div> - {!storyline.sunset && - storyline.has_deadline && - storyline.last_plot_time && ( - <DeadlineCountdown lastPlotTime={storyline.last_plot_time} /> - )} + {!storyline.sunset && storyline.last_plot_time && ( + <DeadlineCountdown lastPlotTime={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 </span> </div> - ) : storyline.has_deadline && storyline.last_plot_time ? ( + ) : storyline.last_plot_time ? ( <DeadlineCountdown lastPlotTime={storyline.last_plot_time} /> ) : null} </header> 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<number | null>(null);