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:
Towsty
2026-09-02 14:51:35 -05:00
co-authored by Cursor
parent c20229da0e
commit c4e18eeb2c
6 changed files with 58 additions and 37 deletions
+11 -3
View File
@@ -33,6 +33,12 @@ export type StillGenerationSettings = {
export type SettingsRow = { label: string; value: string }
function pushPromptRows(rows: SettingsRow[], item: { prompt?: string; promptPre?: string; promptPost?: string }) {
if (item.promptPre?.trim()) rows.push({ label: 'Pre-text', value: item.promptPre.trim() })
if (item.prompt?.trim()) rows.push({ label: 'Prompt', value: item.prompt.trim() })
if (item.promptPost?.trim()) rows.push({ label: 'Post-text', value: item.promptPost.trim() })
}
function finiteNumber(raw: unknown): number | undefined {
const value = Number(raw)
return Number.isFinite(value) ? value : undefined
@@ -141,10 +147,10 @@ export function stillModeLabel(still: { filename?: string; settings?: StillGener
return ''
}
export function stillSettingsRows(still: { prompt?: string; width?: number; height?: number; settings?: StillGenerationSettings | null }) {
export function stillSettingsRows(still: { prompt?: string; promptPre?: string; promptPost?: string; width?: number; height?: number; settings?: StillGenerationSettings | null }) {
const settings = still.settings
const rows: SettingsRow[] = []
if (still.prompt?.trim()) rows.push({ label: 'Prompt', value: still.prompt.trim() })
pushPromptRows(rows, still)
const mode = stillModeLabel(still)
if (mode) rows.push({ label: 'Mode', value: mode })
if (!settings) return rows
@@ -203,6 +209,8 @@ function videoWorkflowLabel(workflow?: string) {
export function clipSettingsRows(clip: {
prompt?: string
promptPre?: string
promptPost?: string
width?: number
height?: number
duration?: number
@@ -220,7 +228,7 @@ export function clipSettingsRows(clip: {
loraStack?: LoraStackItem[]
}) {
const rows: SettingsRow[] = []
if (clip.prompt?.trim()) rows.push({ label: 'Prompt', value: clip.prompt.trim() })
pushPromptRows(rows, clip)
const workflow = videoWorkflowLabel(clip.workflow)
if (workflow) rows.push({ label: 'Workflow', value: workflow })
if (clip.width && clip.height) rows.push({ label: 'Size', value: `${clip.width}×${clip.height}` })