mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 02:32:18 +00:00
feat(historyV2): load workflows for images (#6384)
## Summary Hooked up the "Load Workflow" action to our `history_v2` API. Note: Our cloud envs were being stress tested right now so images are loading at time of recording. Images were loading for me during development before I had time to create the video. ## Screenshots 📷 https://github.com/user-attachments/assets/02145504-ceae-497b-9049-553796d698da ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6384-Feat-history-v2-workflows-29b6d73d365081bcb706fe799b8ce66a) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -21,8 +21,8 @@ function createHistoryItem(promptId: string, queueIndex = 0): TaskItem {
|
||||
}
|
||||
}
|
||||
|
||||
function getAllPromptIds(result: { items: TaskItem[] }): string[] {
|
||||
return result.items.map((item) => item.prompt[1])
|
||||
function getAllPromptIds(result: TaskItem[]): string[] {
|
||||
return result.map((item) => item.prompt[1])
|
||||
}
|
||||
|
||||
describe('reconcileHistory (V1)', () => {
|
||||
@@ -74,9 +74,9 @@ describe('reconcileHistory (V1)', () => {
|
||||
|
||||
const result = reconcileHistory(serverHistory, [], 10, undefined)
|
||||
|
||||
expect(result.items).toHaveLength(2)
|
||||
expect(result.items[0].prompt[1]).toBe('item-1')
|
||||
expect(result.items[1].prompt[1]).toBe('item-2')
|
||||
expect(result).toHaveLength(2)
|
||||
expect(result[0].prompt[1]).toBe('item-1')
|
||||
expect(result[1].prompt[1]).toBe('item-2')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -144,9 +144,9 @@ describe('reconcileHistory (V1)', () => {
|
||||
|
||||
const result = reconcileHistory(serverHistory, clientHistory, 2, 10)
|
||||
|
||||
expect(result.items).toHaveLength(2)
|
||||
expect(result.items[0].prompt[1]).toBe('new-1')
|
||||
expect(result.items[1].prompt[1]).toBe('new-2')
|
||||
expect(result).toHaveLength(2)
|
||||
expect(result[0].prompt[1]).toBe('new-1')
|
||||
expect(result[1].prompt[1]).toBe('new-2')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -168,13 +168,13 @@ describe('reconcileHistory (V1)', () => {
|
||||
|
||||
const result = reconcileHistory([], clientHistory, 10, 5)
|
||||
|
||||
expect(result.items).toHaveLength(0)
|
||||
expect(result).toHaveLength(0)
|
||||
})
|
||||
|
||||
it('should return empty result when both collections are empty', () => {
|
||||
const result = reconcileHistory([], [], 10, undefined)
|
||||
|
||||
expect(result.items).toHaveLength(0)
|
||||
expect(result).toHaveLength(0)
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -295,9 +295,9 @@ describe('reconcileHistory (V2/Cloud)', () => {
|
||||
|
||||
const result = reconcileHistory(serverHistory, clientHistory, 2)
|
||||
|
||||
expect(result.items).toHaveLength(2)
|
||||
expect(result.items[0].prompt[1]).toBe('new-1')
|
||||
expect(result.items[1].prompt[1]).toBe('new-2')
|
||||
expect(result).toHaveLength(2)
|
||||
expect(result[0].prompt[1]).toBe('new-1')
|
||||
expect(result[1].prompt[1]).toBe('new-2')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -310,9 +310,9 @@ describe('reconcileHistory (V2/Cloud)', () => {
|
||||
|
||||
const result = reconcileHistory(serverHistory, [], 10)
|
||||
|
||||
expect(result.items).toHaveLength(2)
|
||||
expect(result.items[0].prompt[1]).toBe('item-1')
|
||||
expect(result.items[1].prompt[1]).toBe('item-2')
|
||||
expect(result).toHaveLength(2)
|
||||
expect(result[0].prompt[1]).toBe('item-1')
|
||||
expect(result[1].prompt[1]).toBe('item-2')
|
||||
})
|
||||
|
||||
it('should return empty result when server history is empty', () => {
|
||||
@@ -323,13 +323,13 @@ describe('reconcileHistory (V2/Cloud)', () => {
|
||||
|
||||
const result = reconcileHistory([], clientHistory, 10)
|
||||
|
||||
expect(result.items).toHaveLength(0)
|
||||
expect(result).toHaveLength(0)
|
||||
})
|
||||
|
||||
it('should return empty result when both collections are empty', () => {
|
||||
const result = reconcileHistory([], [], 10)
|
||||
|
||||
expect(result.items).toHaveLength(0)
|
||||
expect(result).toHaveLength(0)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user