refactor: rename internal promptId/PromptId to jobId/JobId (#8730)

## Summary

Rename all internal TypeScript usage of legacy `promptId`/`PromptId`
naming to `jobId`/`JobId` across ~38 files for consistency with the
domain model.

## Changes

- **What**: Renamed internal variable names, type aliases, function
names, class getters, interface fields, and comments from
`promptId`/`PromptId` to `jobId`/`JobId`. Wire-protocol field names
(`prompt_id` in Zod schemas and `e.detail.prompt_id` accesses) are
intentionally preserved since they match the backend API contract.

## Review Focus

- All changes are pure renames with no behavioral changes
- Wire-protocol fields (`prompt_id`) are deliberately unchanged to
maintain backend compatibility
- Test fixtures updated to use consistent `job-id` naming

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8730-refactor-rename-internal-promptId-PromptId-to-jobId-JobId-3016d73d3650813ca40ce337f7c5271a)
by [Unito](https://www.unito.io)
This commit is contained in:
Christian Byrne
2026-02-20 02:10:53 -08:00
committed by GitHub
parent 541ad387b9
commit 473713cf02
39 changed files with 455 additions and 402 deletions

View File

@@ -80,7 +80,7 @@ const sampleAssets: AssetItem[] = [
size: 1887437,
tags: [],
user_metadata: {
promptId: 'job-running-1',
jobId: 'job-running-1',
nodeId: 12,
executionTimeInSeconds: 1.84
}

View File

@@ -9,7 +9,7 @@
>
<div class="flex items-center gap-2">
<span class="font-bold">{{ $t('assetBrowser.jobId') }}:</span>
<span class="text-sm">{{ folderPromptId?.substring(0, 8) }}</span>
<span class="text-sm">{{ folderJobId?.substring(0, 8) }}</span>
<button
class="m-0 cursor-pointer border-0 bg-transparent p-0 outline-0"
role="button"
@@ -273,10 +273,10 @@ const executionStore = useExecutionStore()
const settingStore = useSettingStore()
const activeTab = ref<'input' | 'output'>('output')
const folderPromptId = ref<string | null>(null)
const folderJobId = ref<string | null>(null)
const folderExecutionTime = ref<number | undefined>(undefined)
const expectedFolderCount = ref(0)
const isInFolderView = computed(() => folderPromptId.value !== null)
const isInFolderView = computed(() => folderJobId.value !== null)
const viewMode = useStorage<'list' | 'grid'>(
'Comfy.Assets.Sidebar.ViewMode',
'grid'
@@ -559,13 +559,13 @@ const handleBulkDelete = async (assets: AssetItem[]) => {
}
const handleClearQueue = async () => {
const pendingPromptIds = queueStore.pendingTasks
.map((task) => task.promptId)
const pendingJobIds = queueStore.pendingTasks
.map((task) => task.jobId)
.filter((id): id is string => typeof id === 'string' && id.length > 0)
await commandStore.execute('Comfy.ClearPendingTasks')
executionStore.clearInitializationByPromptIds(pendingPromptIds)
executionStore.clearInitializationByJobIds(pendingJobIds)
}
const handleBulkAddToWorkflow = async (assets: AssetItem[]) => {
@@ -628,14 +628,14 @@ const enterFolderView = async (asset: AssetItem) => {
return
}
const { promptId, executionTimeInSeconds } = metadata
const { jobId, executionTimeInSeconds } = metadata
if (!promptId) {
if (!jobId) {
console.warn('Missing required folder view data')
return
}
folderPromptId.value = promptId
folderJobId.value = jobId
folderExecutionTime.value = executionTimeInSeconds
expectedFolderCount.value = metadata.outputCount ?? 0
@@ -653,7 +653,7 @@ const enterFolderView = async (asset: AssetItem) => {
}
const exitFolderView = () => {
folderPromptId.value = null
folderJobId.value = null
folderExecutionTime.value = undefined
expectedFolderCount.value = 0
folderAssets.value = []
@@ -679,9 +679,9 @@ const handleEmptySpaceClick = () => {
}
const copyJobId = async () => {
if (folderPromptId.value) {
if (folderJobId.value) {
try {
await navigator.clipboard.writeText(folderPromptId.value)
await navigator.clipboard.writeText(folderJobId.value)
toast.add({
severity: 'success',
summary: t('mediaAsset.jobIdToast.copied'),