feat: R2 image upload for recipe cover photos#272
Open
czearing wants to merge 5 commits into
Open
Conversation
- Presigned URL upload flow (bypasses Vercel 4.5MB limit)
- Files land in uploads/pending/{userId}/, confirmed to uploads/public/
- Rate limited 20 uploads/hour via MongoDB TTL collection
- Auth enforced on both presign and confirm endpoints
- Client-side magic bytes validation + WebP compression
- Cover overlay buttons positioned top-right (avoids emoji overlap)
- Fix PUT /api/recipes/[id] to allow clearing imageURL with empty string
- 30 new tests across 3 files, 324 passing total
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…positioning - Replace custom <button> elements with existing <Button> component (variant ghost/destructive, size sm) - Replace inline error banner with sonner toast.error() calls - Remove error status from UploadState — errors are ephemeral, not stateful - Reposition controls to bottom-center with hover reveal (fixes emoji overlap bug) - Strip all custom button/error CSS; only layout styles remain - Update tests: mock sonner and assert toast.error calls instead of DOM text Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…de emoji - Break cover out of AppShell padding via --page-x-padding/--page-y-padding CSS variables - Increase cover height to clamp(280px, 38vh, 440px) for more editorial presence - Add dark frosted-glass backdrop (rgba 0,0,0,0.48 + backdrop-filter blur) to hover controls - Override design tokens locally so Button children render white on the dark backdrop - Hide RecipeEmoji when imageURL exists (cover and emoji are interchangeable) - Add mainHasCover padding-top so title has breathing room below full-bleed cover Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace separate change/remove buttons with a single camera icon that opens a Menu dropdown (Change cover / Remove cover) - Use forwardRef on RecipeCoverUpload so RecipeHeader can trigger the file input via an "Add cover" ghost button in the header area - Hide emoji when a cover image is present (interchangeable display) - Full-bleed cover: negative margin + width calc using --page-x-padding CSS variables from AppShell - Frosted-glass overlay (opacity 0 → 1 on hover/focus-within) with overridden design tokens for white button text on dark backdrop - Progress bar during XHR upload; all errors go to sonner toast - Update tests: mock Menu components to avoid Radix pointer-event complexity; assert toast.error calls instead of DOM error text Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Was centered (left: 50% + translateX(-50%)), now anchored to bottom-right. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Buttoncomponent (variant="ghost"/"destructive",size="sm") andsonnertoast for errors — no custom UI primitivesTest plan
yarn test)yarn lint)toast.errorfires with correct messagetoast.errorfires🤖 Generated with Claude Code