Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

feat(models): finished downloads and image and video models get the right-click menu too (W33)

purple37ae512bab55
diff --git a/src/components/__tests__/kontextmenue-nachricht-und-modellkarte.test.ts b/src/components/__tests__/kontextmenue-nachricht-und-modellkarte.test.ts
index 04b70954..9b2fa55e 100644
--- a/src/components/__tests__/kontextmenue-nachricht-und-modellkarte.test.ts
+++ b/src/components/__tests__/kontextmenue-nachricht-und-modellkarte.test.ts
@@ -172,7 +172,7 @@ describe('ein Menü, ein Aufrufweg — Gegenprobe an der Quelle', () => {
const src = read('components', 'models', 'ModelCard.tsx')
// A14 brought a fourth action, Remove refusals, and W33 a fifth, Show in
// folder (ComfyUI files), through the same object.
- expect(src).toContain('const actions: ModelMenuHandlers = { select: onSelect, info: onInfo, remove: onDelete, removeRefusals: onRemoveRefusals, reveal: onReveal }')
+ expect(src).toContain('const actions: ModelMenuHandlers = { select: onSelect, info: onInfo, remove: onDelete, removeRefusals: onRemoveRefusals, reveal: onReveal, rename: onRename }')
expect(src).toContain('actions.removeRefusals?.()')
expect(src).toContain('buildModelCardMenu(actions,')
expect(src).toContain('actions.info()')
diff --git a/src/components/layout/DownloadBadge.tsx b/src/components/layout/DownloadBadge.tsx
index dc4c7013..7c5e60bc 100644
--- a/src/components/layout/DownloadBadge.tsx
+++ b/src/components/layout/DownloadBadge.tsx
@@ -11,6 +11,14 @@ import { isMlxImageHost } from '../../api/mlx-image'
import { formatBytes } from '../../lib/formatters'
import { HINWEIS_TEXT, PUNKT_FARBE } from '../../lib/hinweis'
import { trayAfterPulse, trayBundles, bundleVerdict, TRAY_CLOSED, NO_PULSE } from '../../lib/download-tray'
+import { ContextMenu } from '../ui/ContextMenu'
+import { Modal } from '../ui/Modal'
+import { ModalActions, ModalButton } from '../ui/ModalActions'
+import { buildDownloadMenu } from '../ui/menu-actions'
+import { revealComfyModel } from '../../api/discover'
+import { RenameNoteDialog } from '../models/RenameNoteDialog'
+import { UninstallDialog, type UninstallRequest } from '../models/UninstallDialog'
+import { useLoraNotesStore } from '../../stores/loraNotesStore'
function ProgressBar({ progress }: { progress: number }) {
return (
@@ -21,7 +29,13 @@ function ProgressBar({ progress }: { progress: number }) {
}
export function DownloadBadge() {
- const { activePulls, pullModel, pausePull, dismissPull } = useModels()
+ const { activePulls, pullModel, pausePull, dismissPull, fetchModels } = useModels()
+ // W33: the right click on a finished ComfyUI download, and what it opens.
+ const [rowMenu, setRowMenu] = useState<{ x: number; y: number; ids: string[]; cancelled: string[]; file: string; single: boolean } | null>(null)
+ const [renaming, setRenaming] = useState<string | null>(null)
+ const [deleting, setDeleting] = useState<UninstallRequest | null>(null)
+ const [revealError, setRevealError] = useState<string | null>(null)
+ const ownNames = useLoraNotesStore((s) => s.notes)
const comfyDownloads = useDownloadStore(s => s.downloads)
const bundleMap = useDownloadStore(s => s.bundleMap)
// Whether the tray is open, and whether it was the TRAY that opened it —
@@ -252,11 +266,21 @@ export function DownloadBadge() {
const resumable = files.filter(f => f.d.status === 'paused')
const anyActive = files.some(f => f.d.status === 'downloading' || f.d.status === 'connecting' || f.d.status === 'pausing')
+ // W33: finished files of this entry, for the right click.
+ const doneFiles = files.filter(f => f.d.status === 'complete' && f.d.filename).map(f => f.d.filename!)
+ const singleOwnName = !isBundle && doneFiles[0] ? ownNames[doneFiles[0]]?.label?.trim() : undefined
return (
- <div key={bundleName} className="px-3 py-2 border-t border-gray-100 dark:border-white/[0.04] first:border-t-0">
+ <div
+ key={bundleName}
+ className="px-3 py-2 border-t border-gray-100 dark:border-white/[0.04] first:border-t-0"
+ onContextMenu={settled && doneFiles.length > 0 ? (e) => {
+ e.preventDefault()
+ setRowMenu({ x: e.clientX, y: e.clientY, ids: files.map(f => f.id), cancelled, file: doneFiles[0], single: !isBundle })
+ } : undefined}
+ >
{/* Bundle header */}
<div className="flex items-center justify-between gap-2 mb-1">
- <p className={`${isBundle ? 'text-[0.7rem] font-medium' : 'text-[0.7rem] font-mono'} text-gray-700 dark:text-gray-300 truncate`}>{bundleName}</p>
+ <p title={singleOwnName ? bundleName : undefined} className={`${isBundle || singleOwnName ? 'text-[0.7rem] font-medium' : 'text-[0.7rem] font-mono'} text-gray-700 dark:text-gray-300 truncate`}>{singleOwnName || bundleName}</p>
<div className="flex items-center gap-0.5 shrink-0">
{resumable.length > 0 && !anyActive && (
<button onClick={() => resumable.forEach(f => useDownloadStore.getState().resume(f.id))} className="p-0.5 rounded hover:bg-white/10 text-gray-500 hover:text-gray-300 transition-colors" title="Resume"><Play size={11} /></button>
@@ -427,6 +451,42 @@ export function DownloadBadge() {
</motion.div>
)}
</AnimatePresence>
+ {rowMenu && (
+ <ContextMenu
+ items={buildDownloadMenu({
+ reveal: () => { revealComfyModel(rowMenu.file).catch((e) => setRevealError(e instanceof Error ? e.message : String(e))) },
+ rename: rowMenu.single ? () => setRenaming(rowMenu.file) : undefined,
+ removeFromList: () => {
+ rowMenu.ids.forEach((id) => useDownloadStore.getState().dismiss(id))
+ useDownloadStore.getState().forgetCancelled(rowMenu.cancelled)
+ },
+ deleteFile: rowMenu.single ? () => setDeleting({ kind: 'comfy-file', name: rowMenu.file }) : undefined,
+ })}
+ x={rowMenu.x}
+ y={rowMenu.y}
+ label={`Actions for ${rowMenu.file}`}
+ onClose={() => setRowMenu(null)}
+ />
+ )}
+ <RenameNoteDialog name={renaming} kind="model" onClose={() => setRenaming(null)} />
+ <UninstallDialog
+ request={deleting}
+ onClose={() => setDeleting(null)}
+ onDone={async () => {
+ // The file is gone: its entry goes off the list, the model lists read the disk again.
+ const req = deleting
+ if (req?.kind === 'comfy-file') {
+ Object.entries(useDownloadStore.getState().downloads)
+ .filter(([, d]) => d.filename === req.name)
+ .forEach(([id]) => useDownloadStore.getState().dismiss(id))
+ }
+ await fetchModels().catch(() => {})
+ }}
+ />
+ <Modal open={!!revealError} onClose={() => setRevealError(null)} title="Could not open the folder">
+ <p className="t-micro text-red-500 dark:text-red-400 mb-3">{revealError}</p>
+ <ModalActions><ModalButton variant="primary" onClick={() => setRevealError(null)}>OK</ModalButton></ModalActions>
+ </Modal>
</div>
)
}
diff --git a/src/components/models/ModelCard.tsx b/src/components/models/ModelCard.tsx
index 26cda4e2..b4c7b3e3 100644
--- a/src/components/models/ModelCard.tsx
+++ b/src/components/models/ModelCard.tsx
@@ -12,6 +12,7 @@ import { fileFormat } from '../../lib/model-file-format'
import { ICON_SM } from '../ui/icon-size'
import { modelSkin } from './skin'
import { AddImageInput } from './AddImageInput'
+import { useLoraNotesStore } from '../../stores/loraNotesStore'
interface Props {
model: AIModel
@@ -57,6 +58,8 @@ interface Props {
onRemoveRefusals?: () => void
/** W33: show a ComfyUI file in its folder (right click). */
onReveal?: () => void
+ /** W33: give a ComfyUI file the name LU shows (right click). */
+ onRename?: () => void
}
// The glyph of each kind of model. Its tone, like every other class of this
@@ -78,7 +81,7 @@ export function createTabForArchitecture(architecture: string | undefined): stri
return null
}
-export function ModelCard({ model, isActive, onSelect, onDelete, onInfo, infoTitle, canDelete = true, onUse, useBusy = false, engineStopped: luEngineRuht = false, onRemoveRefusals, onReveal }: Props) {
+export function ModelCard({ model, isActive, onSelect, onDelete, onInfo, infoTitle, canDelete = true, onUse, useBusy = false, engineStopped: luEngineRuht = false, onRemoveRefusals, onReveal, onRename }: Props) {
const typeInfo = TYPE_CONFIG[model.type] || TYPE_CONFIG.text
const TypeIcon = typeInfo.icon
const look = modelSkin().card
@@ -88,11 +91,14 @@ export function ModelCard({ model, isActive, onSelect, onDelete, onInfo, infoTit
// EIN Satz Aktionen fuer die Karte. Die sichtbaren Knoepfe unten lesen aus
// diesem Objekt, das Kontextmenue bekommt dasselbe Objekt gereicht — es gibt
// also keinen zweiten Aufrufweg, der irgendwann anders werden koennte.
- const actions: ModelMenuHandlers = { select: onSelect, info: onInfo, remove: onDelete, removeRefusals: onRemoveRefusals, reveal: onReveal }
+ const actions: ModelMenuHandlers = { select: onSelect, info: onInfo, remove: onDelete, removeRefusals: onRemoveRefusals, reveal: onReveal, rename: onRename }
const refusalsRemoved = 'refusalsRemoved' in model && model.refusalsRemoved === true
// Fremde Kennungen tragen Pfadteile und Dateiendungen mit sich, die kein
// Kunde gewaehlt hat. Der Name selbst bleibt unangetastet (lib/model-label).
- const { head: nameKopf, tail: nameEnde } = splitForMiddleEllipsis(displayModelName(model.name))
+ // W33: a ComfyUI file the user gave a name of its own shows that name; the
+ // file name stays in the tooltip.
+ const ownName = useLoraNotesStore((s) => (model.type === 'image' || model.type === 'video' ? s.notes[model.name]?.label?.trim() : undefined))
+ const { head: nameKopf, tail: nameEnde } = splitForMiddleEllipsis(ownName || displayModelName(model.name))
// Was die stehende Engine ueber DIESE Zeile aussagt.
//
// Sie bedient nur ihre eigenen Zeilen. Ollama und LM Studio antworten
diff --git a/src/components/models/ModelManager.tsx b/src/components/models/ModelManager.tsx
index ebdee88c..afdbb5cb 100644
--- a/src/components/models/ModelManager.tsx
+++ b/src/components/models/ModelManager.tsx
@@ -24,6 +24,7 @@ import { LORA_USE_HINT, type LoraRow } from './LoraManager'
import { LoraAddons } from './LoraAddons'
import { Modal } from '../ui/Modal'
import { ModalActions, ModalButton } from '../ui/ModalActions'
+import { RenameNoteDialog, type RenameKind } from './RenameNoteDialog'
import { showModel } from '../../api/ollama'
import { comfyModelInfo } from '../../api/discover'
import { ModelFileInfo, type ModelFileInfoState } from './ModelFileInfo'
@@ -291,7 +292,7 @@ export function ModelManager() {
const [deleteError, setDeleteError] = useState<string | null>(null)
// C41: the rename-and-note dialog of a LoRA, and what a folder open said.
- const [loraEdit, setLoraEdit] = useState<{ name: string; label: string; note: string } | null>(null)
+ const [loraEdit, setLoraEdit] = useState<{ name: string; kind: RenameKind } | null>(null)
const [loraNotice, setLoraNotice] = useState<string | null>(null)
// D17: a GGUF from anywhere on the drive. The dialog picks it, the import
@@ -488,10 +489,7 @@ export function ModelManager() {
search={searchQuery}
searchSubmitToken={searchSubmitToken}
onGetNew={() => setTab('discover')}
- onEdit={(name) => {
- const n = useLoraNotesStore.getState().notes[name]
- setLoraEdit({ name, label: n?.label ?? '', note: n?.note ?? '' })
- }}
+ onEdit={(name) => setLoraEdit({ name, kind: 'lora' })}
/>
)}
@@ -550,10 +548,7 @@ export function ModelManager() {
onDelete={(name) => setConfirmDelete(name)}
onInfo={(name) => { void handleFileInfo(name) }}
onGetNew={() => setTab('discover')}
- onEdit={(name) => {
- const n = useLoraNotesStore.getState().notes[name]
- setLoraEdit({ name, label: n?.label ?? '', note: n?.note ?? '' })
- }}
+ onEdit={(name) => setLoraEdit({ name, kind: 'lora' })}
onToggleHidden={(name) => {
const hidden = !!useLoraNotesStore.getState().notes[name]?.hidden
useLoraNotesStore.getState().setNote(name, { hidden: !hidden })
@@ -665,6 +660,12 @@ export function ModelManager() {
engineStopped={engineRuht}
onDelete={() => setUninstall(uninstallRequestFor(model))}
onInfo={() => handleInfo(model.name)}
+ // W33: a ComfyUI file gets a name of its own (the file stays).
+ onRename={
+ model.type === 'image' || model.type === 'video'
+ ? () => setLoraEdit({ name: model.name, kind: 'model' })
+ : undefined
+ }
// W33: a ComfyUI file can be shown in its folder.
onReveal={
model.type === 'image' || model.type === 'video'
@@ -762,51 +763,8 @@ export function ModelManager() {
removeOllamaModel={async (name) => { await removeModel(name) }}
/>
- <Modal open={!!loraEdit} onClose={() => setLoraEdit(null)} title="Rename and note">
- {loraEdit && (
- <form
- className="space-y-3"
- data-testid="lora-edit"
- onSubmit={(e) => {
- e.preventDefault()
- useLoraNotesStore.getState().setNote(loraEdit.name, { label: loraEdit.label, note: loraEdit.note })
- setLoraEdit(null)
- }}
- >
- <p className="t-micro text-gray-500 dark:text-gray-400">
- The name is how LU shows this LoRA, here and in the LoRA stack of Create. The file keeps its own name, <span className="font-mono break-all">{loraEdit.name}</span>, so saved settings and workflows still find it.
- </p>
- <label className="block t-label text-gray-700 dark:text-gray-200">
- Name
- <input
- autoFocus
- value={loraEdit.label}
- onChange={(e) => setLoraEdit({ ...loraEdit, label: e.target.value })}
- placeholder={loraEdit.name.replace(/\.safetensors$/i, '')}
- maxLength={120}
- className="mt-1 w-full px-3 py-2 rounded-lg bg-gray-100 dark:bg-white/5 border border-gray-200 dark:border-white/10 text-sm text-gray-900 dark:text-white"
- data-testid="lora-edit-name"
- />
- </label>
- <label className="block t-label text-gray-700 dark:text-gray-200">
- Note
- <textarea
- value={loraEdit.note}
- onChange={(e) => setLoraEdit({ ...loraEdit, note: e.target.value })}
- placeholder="Trigger words, a strength that works, what it is good for…"
- rows={4}
- maxLength={2000}
- className="mt-1 w-full px-3 py-2 rounded-lg bg-gray-100 dark:bg-white/5 border border-gray-200 dark:border-white/10 text-sm text-gray-900 dark:text-white"
- data-testid="lora-edit-note"
- />
- </label>
- <ModalActions>
- <ModalButton variant="quiet" onClick={() => setLoraEdit(null)}>Cancel</ModalButton>
- <ModalButton variant="primary" type="submit" data-testid="lora-edit-save">Save</ModalButton>
- </ModalActions>
- </form>
- )}
- </Modal>
+ {/* C41, W33: one dialog for a LoRA and an image or video model. */}
+ <RenameNoteDialog name={loraEdit?.name ?? null} kind={loraEdit?.kind ?? 'lora'} onClose={() => setLoraEdit(null)} />
<Modal open={!!loraNotice} onClose={() => setLoraNotice(null)} title="Could not open the folder">
<p className="t-micro text-red-500 dark:text-red-400 mb-3">{loraNotice}</p>
diff --git a/src/components/models/RenameNoteDialog.tsx b/src/components/models/RenameNoteDialog.tsx
new file mode 100644
index 00000000..58306f5c
--- /dev/null
+++ b/src/components/models/RenameNoteDialog.tsx
@@ -0,0 +1,74 @@
+// C41's "Rename and note" dialog, for a LoRA and (W33) for an image or video
+// model and a finished download. It renames the name LU shows; the file
+// keeps its own name, so saved settings, workflows and the catalog's install
+// check still find it.
+import { useState } from 'react'
+import { Modal } from '../ui/Modal'
+import { ModalActions, ModalButton } from '../ui/ModalActions'
+import { useLoraNotesStore } from '../../stores/loraNotesStore'
+
+export type RenameKind = 'lora' | 'model'
+
+/** What the dialog says the name is for. */
+export function renameHint(kind: RenameKind): string {
+ return kind === 'lora'
+ ? 'The name is how LU shows this LoRA, here and in the LoRA stack of Create.'
+ : 'The name is how LU shows this model in the Models tab and in the download list.'
+}
+
+export function RenameNoteDialog({ name, kind, onClose }: { name: string | null; kind: RenameKind; onClose: () => void }) {
+ return (
+ <Modal open={!!name} onClose={onClose} title="Rename and note">
+ {/* Keyed by the file, so each opening starts from what is stored for it. */}
+ {name && <RenameForm key={name} name={name} kind={kind} onClose={onClose} />}
+ </Modal>
+ )
+}
+
+function RenameForm({ name, kind, onClose }: { name: string; kind: RenameKind; onClose: () => void }) {
+ const [label, setLabel] = useState(() => useLoraNotesStore.getState().notes[name]?.label ?? '')
+ const [note, setNote] = useState(() => useLoraNotesStore.getState().notes[name]?.note ?? '')
+ return (
+ <form
+ className="space-y-3"
+ data-testid="lora-edit"
+ onSubmit={(e) => {
+ e.preventDefault()
+ useLoraNotesStore.getState().setNote(name, { label, note })
+ onClose()
+ }}
+ >
+ <p className="t-micro text-gray-500 dark:text-gray-400">
+ {renameHint(kind)} The file keeps its own name, <span className="font-mono break-all">{name}</span>, so saved settings and workflows still find it.
+ </p>
+ <label className="block t-label text-gray-700 dark:text-gray-200">
+ Name
+ <input
+ autoFocus
+ value={label}
+ onChange={(e) => setLabel(e.target.value)}
+ placeholder={name.replace(/\.(safetensors|gguf|ckpt|pt|pth|bin)$/i, '')}
+ maxLength={120}
+ className="mt-1 w-full px-3 py-2 rounded-lg bg-gray-100 dark:bg-white/5 border border-gray-200 dark:border-white/10 text-sm text-gray-900 dark:text-white"
+ data-testid="lora-edit-name"
+ />
+ </label>
+ <label className="block t-label text-gray-700 dark:text-gray-200">
+ Note
+ <textarea
+ value={note}
+ onChange={(e) => setNote(e.target.value)}
+ placeholder={kind === 'lora' ? 'Trigger words, a strength that works, what it is good for…' : 'What it is good for, settings that work…'}
+ rows={4}
+ maxLength={2000}
+ className="mt-1 w-full px-3 py-2 rounded-lg bg-gray-100 dark:bg-white/5 border border-gray-200 dark:border-white/10 text-sm text-gray-900 dark:text-white"
+ data-testid="lora-edit-note"
+ />
+ </label>
+ <ModalActions>
+ <ModalButton variant="quiet" onClick={onClose}>Cancel</ModalButton>
+ <ModalButton variant="primary" type="submit" data-testid="lora-edit-save">Save</ModalButton>
+ </ModalActions>
+ </form>
+ )
+}
diff --git a/src/components/ui/__tests__/right-click-w33.test.tsx b/src/components/ui/__tests__/right-click-w33.test.tsx
index b9ea0bf2..cfcd4526 100644
--- a/src/components/ui/__tests__/right-click-w33.test.tsx
+++ b/src/components/ui/__tests__/right-click-w33.test.tsx
@@ -17,7 +17,9 @@ vi.mock('../../../api/backend', async (o) => ({ ...(await o<typeof import('../..
import { TextContextMenu } from '../TextContextMenu'
import { textMenuActions, readTarget, keepsNativeMenu } from '../../../lib/text-context-menu'
-import { buildLoraRowMenu, buildModelCardMenu } from '../menu-actions'
+import { buildDownloadMenu, buildLoraRowMenu, buildModelCardMenu } from '../menu-actions'
+import { RenameNoteDialog } from '../../models/RenameNoteDialog'
+import { useLoraNotesStore } from '../../../stores/loraNotesStore'
function rightClick(el: Element) {
const e = new MouseEvent('contextmenu', { bubbles: true, cancelable: true, clientX: 20, clientY: 20 })
@@ -108,9 +110,32 @@ describe('the Models tab', () => {
items.at(-1)!.run()
expect(remove).toHaveBeenCalledOnce()
})
- it('an image or video model gets Show in folder; a chat model does not', () => {
+ it('an image or video model gets Show in folder and Rename; a chat model neither', () => {
const base = { select: vi.fn(), info: vi.fn(), remove: vi.fn() }
- expect(buildModelCardMenu({ ...base, reveal: vi.fn() }, { isActive: false, canDelete: true }).map((i) => i.label)).toEqual(['Use this model', 'Details', 'Show in folder', 'Delete model'])
+ expect(buildModelCardMenu({ ...base, reveal: vi.fn(), rename: vi.fn() }, { isActive: false, canDelete: true }).map((i) => i.label)).toEqual(['Use this model', 'Details', 'Show in folder', 'Rename…', 'Delete model'])
expect(buildModelCardMenu(base, { isActive: false, canDelete: true }).map((i) => i.label)).not.toContain('Show in folder')
})
})
+
+describe('W33 part 2: finished downloads and the name of a model', () => {
+ it('a finished single download: Show in folder, Rename, Remove from list, Delete file', () => {
+ const items = buildDownloadMenu({ reveal: vi.fn(), rename: vi.fn(), removeFromList: vi.fn(), deleteFile: vi.fn() })
+ expect(items.map((i) => i.label)).toEqual(['Show in folder', 'Rename…', 'Remove from list', 'Delete file…'])
+ // Taking the entry off the list is not a deletion: only the file entry is red.
+ expect(items.filter((i) => i.destructive).map((i) => i.id)).toEqual(['delete-file'])
+ })
+ it('a finished bundle: Show in folder and Remove from list (its files are rows in the Models tab)', () => {
+ expect(buildDownloadMenu({ reveal: vi.fn(), removeFromList: vi.fn() }).map((i) => i.label)).toEqual(['Show in folder', 'Remove from list'])
+ })
+ it('Rename gives a model file the name LU shows and keeps the file', async () => {
+ useLoraNotesStore.setState({ notes: {} } as never)
+ const onClose = vi.fn()
+ render(<RenameNoteDialog name="ltx-2.5-distilled.safetensors" kind="model" onClose={onClose} />)
+ expect(screen.getByText(/The file keeps its own name/)).toBeTruthy()
+ fireEvent.change(screen.getByTestId('lora-edit-name'), { target: { value: 'LTX fast' } })
+ await act(async () => { fireEvent.click(screen.getByTestId('lora-edit-save')) })
+ expect(useLoraNotesStore.getState().notes['ltx-2.5-distilled.safetensors']?.label).toBe('LTX fast')
+ expect(onClose).toHaveBeenCalled()
+ })
+})
+
diff --git a/src/components/ui/menu-actions.ts b/src/components/ui/menu-actions.ts
index 01f7bcf9..bd008885 100644
--- a/src/components/ui/menu-actions.ts
+++ b/src/components/ui/menu-actions.ts
@@ -97,6 +97,8 @@ export interface ModelMenuHandlers {
readonly removeRefusals?: () => void
/** W33: a ComfyUI file (image or video model) shown in its folder. */
readonly reveal?: () => void
+ /** W33: the name LU shows for a ComfyUI file (the file stays). */
+ readonly rename?: () => void
}
export interface ModelMenuState {
@@ -111,6 +113,7 @@ export function buildModelCardMenu(h: ModelMenuHandlers, s: ModelMenuState): Men
if (!s.isActive) out.push({ id: 'select', label: 'Use this model', run: h.select })
out.push({ id: 'info', label: 'Details', run: h.info })
if (h.reveal) out.push({ id: 'reveal', label: 'Show in folder', run: h.reveal })
+ if (h.rename) out.push({ id: 'rename', label: 'Rename…', run: h.rename })
if (h.removeRefusals) out.push({ id: 'remove-refusals', label: 'Remove refusals…', run: h.removeRefusals })
if (s.canDelete) out.push({ id: 'delete', label: 'Delete model', run: h.remove, destructive: true })
return out
@@ -138,6 +141,29 @@ export function buildLoraRowMenu(h: LoraMenuHandlers): MenuAction[] {
return out
}
+/* ── Download-Fenster ────────────────────────────────────────────────────── */
+
+/** W33: the right click on a finished ComfyUI download. "Remove from list"
+ * only takes the entry off the list; "Delete file…" deletes the model file,
+ * through the same confirmation as the Models tab. Rename and Delete only
+ * where the entry is one file: a bundle's files are rows of their own in
+ * the Models tab. */
+export interface DownloadMenuHandlers {
+ readonly reveal?: () => void
+ readonly rename?: () => void
+ readonly removeFromList: () => void
+ readonly deleteFile?: () => void
+}
+
+export function buildDownloadMenu(h: DownloadMenuHandlers): MenuAction[] {
+ const out: MenuAction[] = []
+ if (h.reveal) out.push({ id: 'reveal', label: 'Show in folder', run: h.reveal })
+ if (h.rename) out.push({ id: 'rename', label: 'Rename…', run: h.rename })
+ out.push({ id: 'remove-from-list', label: 'Remove from list', run: h.removeFromList })
+ if (h.deleteFile) out.push({ id: 'delete-file', label: 'Delete file…', run: h.deleteFile, destructive: true })
+ return out
+}
+
/* ── Platzierung ─────────────────────────────────────────────────────────── */
export interface MenuBox {
diff --git a/src/lib/__tests__/zwei-modelle-sehen-nicht-gleich-aus.test.ts b/src/lib/__tests__/zwei-modelle-sehen-nicht-gleich-aus.test.ts
index a53233a6..802253ff 100644
--- a/src/lib/__tests__/zwei-modelle-sehen-nicht-gleich-aus.test.ts
+++ b/src/lib/__tests__/zwei-modelle-sehen-nicht-gleich-aus.test.ts
@@ -98,7 +98,8 @@ describe('verdrahtet', () => {
it('die Models-Kachel auch, denn dort standen dieselben Kennungen', () => {
const src = lies('components/models/ModelCard.tsx')
- expect(src).toContain('splitForMiddleEllipsis(displayModelName(model.name))')
+ // W33: a ComfyUI file with a name of its own shows that name, cut the same way.
+ expect(src).toContain('splitForMiddleEllipsis(ownName || displayModelName(model.name))')
expect(src).toContain('<span className="truncate">{nameKopf}</span>')
})