Block plot creation when deadline expired — frontend + API#807
Block plot creation when deadline expired — frontend + API#807realproject7 merged 3 commits intomainfrom
Conversation
1. AddPlotButton: check last_plot_time + 168h, show disabled "Deadline expired" state instead of clickable link 2. Create page: filter expired storylines from dropdown 3. API index/plot: reject with 400 when deadline expired or sunset 4. Export DEADLINE_HOURS from DeadlineCountdown for reuse Fixes #804 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Export DEADLINE_MS from DeadlineCountdown.tsx alongside DEADLINE_HOURS. Create page now imports DEADLINE_MS instead of hardcoding. API route keeps local constant (server-side can't import client component) but documents the source. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The API validation looks directionally correct, but the frontend implementation does not match two explicit requirements from issue #804. In particular, expired storylines are removed from the Create dropdown instead of shown disabled, and sunset=true storylines still hide the add-plot control entirely instead of rendering a disabled state.
Findings
-
[medium] The Create page filters expired storylines out of the dropdown entirely, but issue #804 requires them to remain visible and disabled with an
(expired)label.- File:
src/app/create/page.tsx:537 - Suggestion: Keep expired storylines in
options, mark them disabled, and append an(expired)suffix so writers can see why they are unavailable.
- File:
-
[medium] The storyline page still suppresses the add-plot control completely when
sunset=true, so the user never sees the required disabled state for expired/sunset storylines.- File:
src/app/story/[storylineId]/page.tsx:375 - Suggestion: Render
AddPlotButtonregardless ofsunset, and let the component handle the disabled presentation for both deadline-expired and sunset cases.
- File:
Decision
Requesting changes until the frontend behavior matches the issue's stated UX: visible-but-disabled on the storyline page, and visible-but-disabled entries in the Create dropdown.
1. Create page: expired storylines shown in dropdown with "(expired)" label and disabled (not selectable). Added disabled option support to Select component. 2. Storyline page: AddPlotButton now shown for sunset storylines too, renders disabled "Deadline expired" state. Removed !sunset guard. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The follow-up change resolves my prior frontend blockers. Expired storylines now stay visible-but-disabled in the Create dropdown, and the storyline page now renders the add-plot control in a disabled state for expired/sunset storylines instead of hiding it.
Findings
-
[resolved] Expired storylines remain in the Create dropdown with an
(expired)suffix and disabled selection behavior.- File:
src/app/create/page.tsx:536 - File:
src/components/Select.tsx:5 - Suggestion: None.
- File:
-
[resolved] The storyline page now always renders
AddPlotButton, and the component handles disabled presentation for deadline-expired and sunset storylines.- File:
src/app/story/[storylineId]/page.tsx:375 - File:
src/components/AddPlotButton.tsx:28 - Suggestion: None.
- File:
Decision
Approving. My prior blockers on the frontend UX requirements from issue #804 are addressed.
Summary
Three-layer deadline enforcement to prevent wasted gas on doomed transactions:
AddPlotButton.tsx): Checkslast_plot_time + 168h < now. Shows disabled "Deadline expired" instead of clickable linkcreate/page.tsx): Filters expired storylines from the dropdown (removedsunset=falseDB filter, now checks both sunset and time-based expiry client-side)api/index/plot/route.ts): Returns 400 when storyline deadline has expired or sunset is trueAlso exports
DEADLINE_HOURSfromDeadlineCountdown.tsxfor shared reuse.Changes
src/components/AddPlotButton.tsx— added deadline check + disabled statesrc/components/DeadlineCountdown.tsx— exportedDEADLINE_HOURSsrc/app/story/[storylineId]/page.tsx— passeslastPlotTimeto AddPlotButtonsrc/app/create/page.tsx— client-side expired filter, includes sunset storylines from DBsrc/app/api/index/plot/route.ts— deadline + sunset validation before upsertTest Plan
Fixes #804
🤖 Generated with Claude Code