Skip to content

Add Upload New Version button + revision upload form#41

Merged
leotrs merged 2 commits intomainfrom
prs-eou.5
Mar 29, 2026
Merged

Add Upload New Version button + revision upload form#41
leotrs merged 2 commits intomainfrom
prs-eou.5

Conversation

@leotrs
Copy link
Copy Markdown
Contributor

@leotrs leotrs commented Mar 28, 2026

Summary

  • Adds "Upload New Version" button to each published scroll on the dashboard, linking to /upload?revises={url_hash}
  • Upload form shows a revision context box (title, current version, publish date, next version) when ?revises= is present
  • Pre-fills all metadata fields from the existing scroll; file upload zone stays empty
  • Header changes to "Upload New Version", submit button to "Preview New Version"
  • Normal upload form (no ?revises=) is unchanged
  • 9 unit tests covering dashboard button visibility, form prefill, revision context, invalid/unauthorized hashes, and normal mode

Test plan

  • Unit tests pass locally (9/9)
  • CI validates full test suite
  • E2E tests validate dashboard and upload flow in CI

🤖 Generated with Claude Code

…ariant

Dashboard shows an "Upload New Version" button for each published scroll,
linking to /upload?revises={url_hash}. The upload form detects the revises
parameter and shows a revision context box with current version info,
pre-fills metadata, and changes header/button text accordingly.

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

Deploy Preview

https://scroll-press-pr-41.fly.dev

This preview will be destroyed when the PR is closed.

@leotrs
Copy link
Copy Markdown
Contributor Author

leotrs commented Mar 28, 2026

Needs human review

What changed: Added "Upload New Version" button to published scrolls on the dashboard and a revision-mode upload form that shows context about the scroll being updated, pre-fills metadata, and relabels the header/submit button.

Review checklist:

  1. Open the deploy preview: https://scroll-press-pr-41.fly.dev
  2. Log in and navigate to the dashboard
  3. Verify each published scroll card shows an "Upload New Version" button at the bottom
  4. Confirm draft/preview scrolls do NOT show the button
  5. Click "Upload New Version" on any published scroll
  6. Verify the upload form shows:
    • Header says "Upload New Version" (not "Upload New Scroll")
    • A revision context box showing the scroll title, current version, publish date, and "This will become vN"
    • All metadata fields (title, authors, abstract, keywords, subject) pre-filled from the existing scroll
    • File upload zone is empty (not pre-filled)
    • Submit button says "Preview New Version" (not "Preview Scroll")
  7. Navigate to /upload (no ?revises= param) and confirm the normal upload form is unchanged
  8. Try /upload?revises=invalidhash and confirm it falls back to normal upload mode

What to look for:

  • Revision context box styling: left accent border, readable typography, correct version numbers
  • Dashboard button alignment and spacing on both desktop and mobile
  • The scroll card wrapper doesn't break existing card styling (borders, border-radius)
  • Mobile: "Upload New Version" button should be full-width and centered
  • Pre-filled metadata accuracy matches the original scroll exactly

@leotrs
Copy link
Copy Markdown
Contributor Author

leotrs commented Mar 28, 2026

Screenshot 2026-03-28 at 20 55 20

there's a problem in the dashboard: I see one card per version, I should see one card per scroll

Apply _latest_version_filter() to the dashboard query so only the latest
version of each scroll series is displayed. Also load scroll_series_id
in the query options so the correlated subquery can work.

Added two tests: one verifying only the latest version appears, another
verifying distinct scroll series each get their own card.

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

leotrs commented Mar 28, 2026

Needs human review

What changed: Adds an "Upload New Version" button to each published scroll card on the dashboard, and a revision-aware upload form that shows a context box (current title, version, next version) and pre-fills metadata from the existing scroll.

Review checklist:

  1. Log in and navigate to the dashboard (/dashboard)
  2. Verify each published scroll card has an "Upload New Version" button in the bottom-right action bar
  3. If you have a scroll with multiple versions, confirm only the latest version appears (no duplicates)
  4. Click "Upload New Version" on any scroll — verify you land on /upload?revises={hash}
  5. Check the revision context box appears at the top: "Updating:" label, scroll title, current version, "This will become vN"
  6. Confirm all metadata fields (title, authors, abstract, keywords, subject) are pre-filled from the existing scroll
  7. Confirm the file upload zone is empty (not pre-filled)
  8. Verify the header reads "Upload New Version" and submit button reads "Preview New Version"
  9. Visit /upload directly (no ?revises= param) — confirm normal form is unchanged: "Upload New Scroll" header, "Preview Scroll" button, no revision context box
  10. Try /upload?revises=invalidhash — should fall back to normal upload form gracefully

What to look for:

  • Upload New Version button alignment and spacing within the card wrapper on desktop and mobile
  • Revision context box: left red border accent, proper typography hierarchy, readable version info
  • Mobile responsiveness: button should go full-width on small screens, context box should not overflow
  • No visual regression on the existing scroll cards (the new wrapper div shouldn't change card appearance)
  • Confirm the scroll-card-wrapper border doesn't double up with the existing card border

🤖 Generated with Claude Code

@leotrs leotrs merged commit d45eec1 into main Mar 29, 2026
7 checks passed
@leotrs leotrs deleted the prs-eou.5 branch March 29, 2026 06:06
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.

1 participant