Fix Photos Add, Remove, and Replace against the library picker.
Remove clears the Photos array and backing image fields; Add opens the picker with disk upload and drops empty drafts on cancel. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,12 +4,14 @@
|
||||
type="button"
|
||||
class="slot-thumb"
|
||||
:class="asset ? 'slot-thumb--slot' : 'slot-thumb--empty'"
|
||||
:aria-label="asset ? 'Replace photo' : 'Select photo'"
|
||||
:aria-label="asset ? 'Replace photo' : 'Choose a photo'"
|
||||
@click="$emit('pick')"
|
||||
>
|
||||
<span v-if="asset && hidden" class="p-2 text-center text-[var(--type-sm)] text-[var(--muted)]">Still loaded · preview hidden</span>
|
||||
<img v-else-if="asset" :src="thumbSrc" alt="">
|
||||
<span v-else class="inline-flex items-center gap-1">Select <span aria-hidden="true">▾</span></span>
|
||||
<span v-else class="inline-flex flex-col items-center gap-1 px-2 text-center">
|
||||
<span>Choose a photo</span>
|
||||
</span>
|
||||
</button>
|
||||
<div class="photo-card-body">
|
||||
<label class="photo-role-label">
|
||||
@@ -31,6 +33,11 @@
|
||||
title="Mention this photo in the prompt"
|
||||
@click.stop="$emit('mention')"
|
||||
>Mention in prompt</button>
|
||||
<button
|
||||
v-if="!readonly && asset"
|
||||
type="button"
|
||||
@click.stop="$emit('pick')"
|
||||
>Replace</button>
|
||||
<button v-if="!readonly" type="button" @click.stop="$emit('remove')">Remove</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user