Restore pre-text and post-text with Use as input and Details.
Library items already stored those fields, but Details showed one blob and Use as input left the form's empty pre/post in place. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+11
-15
@@ -1706,8 +1706,8 @@
|
||||
>
|
||||
<p v-else class="min-w-0 flex-1 truncate text-sm font-medium">{{ collectionTitle(entry.group) }}</p>
|
||||
<PromptPreviewTip
|
||||
v-if="familyScript(entry.group.parts)"
|
||||
:text="familyScript(entry.group.parts)"
|
||||
v-if="formatPromptParts(entry.group.head, familyScript(entry.group.parts))"
|
||||
:text="formatPromptParts(entry.group.head, familyScript(entry.group.parts))"
|
||||
:aria-label="'Copy prompt for ' + collectionTitle(entry.group)"
|
||||
@copy="copyPrompt"
|
||||
/>
|
||||
@@ -1799,8 +1799,8 @@
|
||||
>
|
||||
<p v-else class="min-w-0 flex-1 truncate text-sm font-medium">{{ item.name || item.prompt }}</p>
|
||||
<PromptPreviewTip
|
||||
v-if="item.prompt"
|
||||
:text="item.prompt"
|
||||
v-if="formatPromptParts(item)"
|
||||
:text="formatPromptParts(item)"
|
||||
:aria-label="'Copy prompt for ' + (item.name || 'this clip')"
|
||||
@copy="copyPrompt"
|
||||
/>
|
||||
@@ -1906,8 +1906,8 @@
|
||||
>
|
||||
<p v-else class="min-w-0 flex-1 truncate text-sm font-medium">{{ stillCollectionTitle(entry.stillGroup) }}</p>
|
||||
<PromptPreviewTip
|
||||
v-if="stillFamilyScript(entry.stillGroup.parts)"
|
||||
:text="stillFamilyScript(entry.stillGroup.parts)"
|
||||
v-if="formatPromptParts(entry.stillGroup.head, stillFamilyScript(entry.stillGroup.parts))"
|
||||
:text="formatPromptParts(entry.stillGroup.head, stillFamilyScript(entry.stillGroup.parts))"
|
||||
:aria-label="'Copy prompt for ' + stillCollectionTitle(entry.stillGroup)"
|
||||
@copy="copyPrompt"
|
||||
/>
|
||||
@@ -1992,8 +1992,8 @@
|
||||
>
|
||||
<p v-else class="min-w-0 flex-1 truncate text-sm font-medium">{{ stillTitle(item) }}</p>
|
||||
<PromptPreviewTip
|
||||
v-if="item.prompt"
|
||||
:text="item.prompt"
|
||||
v-if="formatPromptParts(item)"
|
||||
:text="formatPromptParts(item)"
|
||||
:aria-label="'Copy prompt for ' + stillTitle(item)"
|
||||
@copy="copyPrompt"
|
||||
/>
|
||||
@@ -2155,7 +2155,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { composePromptParts, restorePromptParts } from '~/utils/promptParts'
|
||||
import { composePromptParts, formatPromptParts, restorePromptParts } from '~/utils/promptParts'
|
||||
import { parseEditPasses, looksLikeShotScript } from '~/utils/parseRecommend'
|
||||
import { parseImageBatchScript, parseShotScript } from '~/utils/parseShots'
|
||||
import type { DirectorScript } from '~/utils/directorScripts'
|
||||
@@ -4120,12 +4120,8 @@ function insertKeepPrompt(item: KeepPrompt) {
|
||||
function applyPromptRestore(saved: string, stored?: { prompt?: string; promptPre?: string; promptPost?: string } | null) {
|
||||
const parts = restorePromptParts(saved, {
|
||||
pre: stored?.promptPre,
|
||||
prompt: stored?.prompt ?? saved,
|
||||
prompt: saved,
|
||||
post: stored?.promptPost
|
||||
}, {
|
||||
pre: promptPre.value,
|
||||
prompt: prompt.value,
|
||||
post: promptPost.value
|
||||
})
|
||||
promptPre.value = parts.pre
|
||||
prompt.value = parts.prompt
|
||||
@@ -5902,7 +5898,7 @@ function applyStillSettings(still: LibraryStill) {
|
||||
const settings = still.settings
|
||||
folderId.value = still.folderId
|
||||
browseFolderId.value = still.folderId
|
||||
if (still.prompt || still.promptPre || still.promptPost) applyPromptRestore(still.prompt || '', still)
|
||||
applyPromptRestore(still.prompt || '', still)
|
||||
if (dest === 'imagev2') {
|
||||
studioMode.value = 'editv2'
|
||||
outputFocus.value = 'edit'
|
||||
|
||||
Reference in New Issue
Block a user