refactor(pets): tighten remix comments and confirm handler

This commit is contained in:
Brooklyn Nicholson 2026-06-25 01:10:56 -05:00
parent 5196575d40
commit 6b3ea2cea6
2 changed files with 6 additions and 11 deletions

View file

@ -82,9 +82,7 @@ export function DraftGrid({
)}
</button>
{/* Branch off this look reuses the draft as the next reference so
the user can explore variations without leaving the grid. Hidden
until hover/focus to keep the grid clean. */}
{/* Remix: branch a new round off this look. Revealed on hover/focus. */}
{draft != null && !generating && (
<Tip label={copy.remix}>
<Button

View file

@ -145,15 +145,13 @@ export function PetGenerateContent() {
void generateDrafts(requestGateway, { prompt: example })
}
// Branch a fresh draft round off an existing look by feeding it back in as the
// reference image. Keeps the user on step 2 with the same prompt, just grounded
// on the chosen draft.
// A remix re-runs generation grounded on an existing draft — same prompt, stay
// on step 2 — so the user explores variations without starting over.
const runRemix = (draft: { dataUri: string }) => {
void generateDrafts(requestGateway, { prompt: prompt.trim(), referenceImage: draft.dataUri })
}
// "Remix" affordance: regenerating is slow and replaces the current drafts, so
// warn once (then remember the acknowledgement) before kicking off the round.
// Slow, and it replaces the current drafts — so confirm once, then remember it.
const remixDraft = (draft: { dataUri: string }) => {
if (busy) {
return
@ -324,11 +322,10 @@ export function PetGenerateContent() {
description={copy.remixConfirmBody}
onClose={() => setRemixPending(null)}
onConfirm={() => {
const draft = remixPending
markRemixConfirmed()
if (draft) {
runRemix(draft)
if (remixPending) {
runRemix(remixPending)
}
}}
open={remixPending !== null}