Save Draft / restore flow for Create Contest page#14371
Merged
Conversation
|
Host Remix Contest's create flow now has a working draft path so users can step away mid-form without losing their work: - New useContestDraft hook persists the full form (title, description, video URL, cover photo URL, prizes, deadline date/time, source track ids) to localStorage, scoped per user and per contest scope (the primary track or "trackless" for the /host-contest entry). - Save Draft button manually saves the in-flight form, and a draft- restore Hint appears at the top of the page on load when a saved draft is present, with Restore Draft / Discard actions. - Debounced auto-save persists the draft 1.5s after the user stops editing — skipped while the restore banner is up (so we don't clobber the existing draft before the user decides) and when the form is empty (so Discard actually means discarded). - Drafts auto-clear on launch / cancel / delete — the contest is live, so the local snapshot would just shadow stale fields. - Edit mode is unchanged: the live event is the source of truth, so the draft hook is disabled and the Save Draft button is hidden. No backend changes — drafts live entirely in the browser. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1dd9f41 to
d99388e
Compare
Contributor
🌐 Web preview readyPreview URL: https://audius-web-preview-pr-14371.audius.workers.dev Unique preview for this PR (deployed from this branch). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
🤖 Generated with Claude Code