feat: Add share buttons to RoastCard & improve AI roast prompt#1
Open
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Open
feat: Add share buttons to RoastCard & improve AI roast prompt#1devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Conversation
- Capture roast ID from Supabase insert response in page.tsx using .select('id').single()
- Pass roastId prop to RoastCard component
- Add Share Link button that copies https://kooked.vercel.app/roast/[id] to clipboard
- Add Share as Image button using html-to-image that exports card as PNG
- Exported image includes grade badge, roast text, saving grace, and Kooked branding footer
- Also pass roastId on roast/[id] detail page for consistency
Co-Authored-By: oviren.human <oviren.human@gmail.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Enforce 1-3 sentences max per roast point (no paragraphs) - Each roast must target a different angle (design, content, UX) - Require specific references to actual site elements, not generic insults - Make Saving Grace backhanded - Grade harshly (most sites D or F) - Use dark humor and slang naturally without forcing it Co-Authored-By: oviren.human <oviren.human@gmail.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
Share Features (RoastCard)
Adds two sharing features to the
RoastCardcomponent:Share Link — copies
https://kooked.vercel.app/roast/[id]to clipboard. The roast ID is now captured from the Supabase insert response inpage.tsx(changed from fire-and-forget to.select("id").single()), stored in state, and passed as an optionalroastIdprop toRoastCard. The button only renders whenroastIdis available.Share as Image — exports the card as a 2x PNG using
html-to-image(toPng). The exported region includes the header, roast text, saving grace, and a new Kooked branding footer.Additional changes in
RoastCard:gradeprop (previously accepted but unused) is now displayed as a badge in the card header.roastIdis also passed on theroast/[id]detail page so the share button works there too.AI Prompt Rewrite (Edge Function)
Rewrote the system prompt in
supabase/functions/roast/index.tsto produce better roasts:Review & Testing Checklist for Human
supabase/functions/roast/index.ts. Merging this PR updates the repo, but you may need to manually redeploy the edge function via the Supabase CLI or dashboard for the prompt change to take effect.parseRoastregex format (Grade: ... / Roast 1: ... / Roast 2: ... / Roast 3: ... / Saving Grace: ...)..select("id").single()after insert: Confirm this works with existing RLS policies. If the table only allowsINSERTbut notSELECTfor anon users, the insert will succeed butsetRoastIdwill never fire (Share Link button won't appear). Check the Supabase dashboard to verify.toPngcall hardcodesbackgroundColor: "#000000"(black). Since the card uses CSS variable-based colors, verify the exported PNG looks correct in both light and dark mode — light-mode text on a black background may be unreadable.html-to-imagecan fail or produce blank areas when rendering cross-origin images (the favicon fromicon.horse). Test export with a real roast to confirm the favicon renders in the PNG.Suggested test plan: Roast a real URL on the deployed preview → verify the grade badge appears and roasts are short/varied → click "Share Link" and confirm the clipboard contains the correct URL → click "Share as Image" and verify the downloaded PNG includes all content with correct colors → toggle to the other theme and repeat the image export test.
Notes
https://kooked.vercel.app/roast/...— this won't resolve correctly in local dev or Vercel preview deployments.document.execCommand("copy")for older browser support.html-to-image@^1.11.13Link to Devin session: https://app.devin.ai/sessions/c0222eddeab348589a28ca1397ffa906
Requested by: @iamovi