mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-13 17:10:06 +00:00
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:
@@ -132,7 +132,7 @@ describe('useExecutionStore - NodeLocatorId conversions', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('useExecutionStore - reconcileInitializingPrompts', () => {
|
||||
describe('useExecutionStore - reconcileInitializingJobs', () => {
|
||||
let store: ReturnType<typeof useExecutionStore>
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -141,36 +141,36 @@ describe('useExecutionStore - reconcileInitializingPrompts', () => {
|
||||
store = useExecutionStore()
|
||||
})
|
||||
|
||||
it('should remove prompt IDs not present in active jobs', () => {
|
||||
store.initializingPromptIds = new Set(['job-1', 'job-2', 'job-3'])
|
||||
it('should remove job IDs not present in active jobs', () => {
|
||||
store.initializingJobIds = new Set(['job-1', 'job-2', 'job-3'])
|
||||
|
||||
store.reconcileInitializingPrompts(new Set(['job-1']))
|
||||
store.reconcileInitializingJobs(new Set(['job-1']))
|
||||
|
||||
expect(store.initializingPromptIds).toEqual(new Set(['job-1']))
|
||||
expect(store.initializingJobIds).toEqual(new Set(['job-1']))
|
||||
})
|
||||
|
||||
it('should be a no-op when all initializing IDs are active', () => {
|
||||
store.initializingPromptIds = new Set(['job-1', 'job-2'])
|
||||
store.initializingJobIds = new Set(['job-1', 'job-2'])
|
||||
|
||||
store.reconcileInitializingPrompts(new Set(['job-1', 'job-2', 'job-3']))
|
||||
store.reconcileInitializingJobs(new Set(['job-1', 'job-2', 'job-3']))
|
||||
|
||||
expect(store.initializingPromptIds).toEqual(new Set(['job-1', 'job-2']))
|
||||
expect(store.initializingJobIds).toEqual(new Set(['job-1', 'job-2']))
|
||||
})
|
||||
|
||||
it('should be a no-op when there are no initializing prompts', () => {
|
||||
store.initializingPromptIds = new Set()
|
||||
it('should be a no-op when there are no initializing jobs', () => {
|
||||
store.initializingJobIds = new Set()
|
||||
|
||||
store.reconcileInitializingPrompts(new Set(['job-1']))
|
||||
store.reconcileInitializingJobs(new Set(['job-1']))
|
||||
|
||||
expect(store.initializingPromptIds).toEqual(new Set())
|
||||
expect(store.initializingJobIds).toEqual(new Set())
|
||||
})
|
||||
|
||||
it('should clear all initializing IDs when no active jobs exist', () => {
|
||||
store.initializingPromptIds = new Set(['job-1', 'job-2'])
|
||||
store.initializingJobIds = new Set(['job-1', 'job-2'])
|
||||
|
||||
store.reconcileInitializingPrompts(new Set())
|
||||
store.reconcileInitializingJobs(new Set())
|
||||
|
||||
expect(store.initializingPromptIds).toEqual(new Set())
|
||||
expect(store.initializingJobIds).toEqual(new Set())
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user