Skip to content

[#177] Add story edit panel: cover image, genre, language, NSFW#178

Merged
realproject7 merged 5 commits into
mainfrom
task/177-story-edit-panel
May 9, 2026
Merged

[#177] Add story edit panel: cover image, genre, language, NSFW#178
realproject7 merged 5 commits into
mainfrom
task/177-story-edit-panel

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Fixes #177

Summary

  • Add uploadCoverImage() and updateStoryline() helpers in app/lib/publish.ts using createOwsAccount for wallet signing with exact PlotLink message formats
  • Add POST /api/publish/upload-cover and POST /api/publish/update-storyline route handlers with file validation (500KB max, image type check)
  • Add edit panel UI in PreviewPanel for published genesis files: cover image upload with preview, genre/language dropdowns, NSFW toggle, save button
  • Wire walletAddress from StoriesPage to PreviewPanel so edit button only shows for OWS wallet authors
  • Update AGENTS.md post-publishing guidance to reference in-app edit panel
  • Bump version to 1.1.0

Test plan

  • Verify edit panel appears only for published genesis files when wallet exists
  • Test cover image upload with valid image (WebP/JPEG under 500KB)
  • Test cover image validation rejects files over 500KB and non-image files
  • Test genre, language, NSFW update via signed API call
  • Verify message formats match PlotLink API expectations
  • Check responsive layout on mobile views
  • Verify npm run typecheck and npm run lint pass (confirmed)
  • Verify npm run app:build succeeds (confirmed)

realproject7 and others added 2 commits May 9, 2026 13:46
- Add uploadCoverImage() and updateStoryline() helpers in publish.ts
  using createOwsAccount for wallet signing with exact PlotLink message formats
- Add POST /api/publish/upload-cover and /api/publish/update-storyline routes
  with file validation (500KB, image type) and wallet authentication
- Add edit panel UI in PreviewPanel for published genesis files:
  cover image upload with preview, genre/language dropdowns, NSFW toggle
- Wire walletAddress from StoriesPage to PreviewPanel for authorship check
- Update AGENTS.md post-publishing guidance to reference in-app edit panel
- Bump version to 1.1.0

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Initialize genre, language, and NSFW fields from the storyline's
current values on PlotLink so saving with only a cover change
doesn't silently overwrite existing metadata to defaults.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

The signed upload/update helpers and route plumbing are in place, and CI is passing. However, the edit panel can silently overwrite existing storyline metadata with defaults during unrelated edits, so the feature is not safe to ship yet.

Findings

  • [high] Cover-only saves overwrite genre/language/NSFW with hard-coded defaults

    • File: app/web/components/PreviewPanel.tsx:47
    • Suggestion: Do not initialize the edit metadata controls to global defaults unless those are the actual current story values. Either load the current PlotLink metadata before showing the panel, derive the initial values from stored publish metadata/structure where reliable, or send only fields the user explicitly changed. As written, editGenre, editLanguage, and editNsfw start as Romance, English, and false, and handleEditSave always includes them in the update payload (app/web/components/PreviewPanel.tsx:184). A user who only uploads a cover for a Fantasy/Korean/NSFW story will unintentionally change its metadata.
  • [medium] Edit button is gated on wallet existence, not confirmed authorship

    • File: app/web/components/PreviewPanel.tsx:490
    • Suggestion: Gate the UI on a stored/verified author address matching the current OWS wallet, or otherwise verify the selected published file was authored by the current OWS wallet. The current check only requires walletAddress and storylineId, so after wallet rotation or imported/local status data the panel can appear for stories the current OWS wallet cannot edit, which misses the acceptance criterion that the panel is visible only for published stories authored by the OWS wallet.

Decision

Requesting changes because the metadata overwrite bug can corrupt user-facing storyline details during a normal cover upload flow. lint-and-typecheck passed.

realproject7 and others added 2 commits May 9, 2026 13:50
Store authorAddress in publish status when publishing. Edit button
now only shows when the current wallet matches the stored author
address (case-insensitive), with backwards compat for pre-existing
published stories that lack the field.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Minor version bump (1.1.0) requires T1 approval. Using patch bump
for now; minor bump recommended for operator decision.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

The authorship field and version bump fixes are moving in the right direction, but the metadata overwrite blocker is still not fully fixed. The edit panel still starts from defaults and can save before current metadata has loaded, or after the metadata fetch fails silently.

Findings

  • [high] Metadata defaults can still overwrite current story values
    • File: app/web/components/PreviewPanel.tsx:218
    • Suggestion: Track metadata loading/error state and prevent Save Changes until current metadata is successfully initialized, or send only fields the user explicitly changed. The new effect fetches current metadata after the edit panel opens, but the controls remain initialized to GENRES[0], LANGUAGES[0], and false (app/web/components/PreviewPanel.tsx:48) and handleEditSave still always sends those values (app/web/components/PreviewPanel.tsx:185). Because the fetch is async and errors are ignored, a quick cover-only save, a failed/CORS-blocked fetch, or an unrecognized metadata value can still change the story to Romance / English / not NSFW.

Decision

Requesting changes because the main data-corruption risk from the first review remains possible in normal failure/race cases. Latest lint-and-typecheck was still pending when I rechecked.

Disable Save Changes button until the PlotLink metadata fetch
completes successfully. Shows loading state and surfaces errors
if the fetch fails, preventing race conditions where defaults
could overwrite existing storyline metadata.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The remaining metadata overwrite blocker is resolved: the edit form now disables saving until current PlotLink metadata loads successfully, and failed metadata loads surface an error while keeping save disabled. The authorship gating and version bump fixes are also in place.

Findings

  • None.

Decision

Approving. Note: latest lint-and-typecheck was still pending when I rechecked the newest head, so I could not confirm the final CI result from the review CLI output.

@realproject7 realproject7 merged commit b2dc1fe into main May 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add story edit panel: cover image upload, genre, language, NSFW

2 participants