mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
Remove node bookmark migration (#1733)
* Remove node bookmarks setting migration * nit * nit
This commit is contained in:
@@ -350,23 +350,6 @@ test.describe('Menu', () => {
|
||||
await comfyPage.page.waitForTimeout(1000)
|
||||
expect(await tab.getNode('KSampler (Advanced)').count()).toBe(2)
|
||||
})
|
||||
|
||||
test('Can migrate legacy bookmarks', async ({ comfyPage }) => {
|
||||
await comfyPage.setSetting('Comfy.NodeLibrary.Bookmarks', [
|
||||
'foo/',
|
||||
'foo/KSampler (Advanced)',
|
||||
'UNKNOWN',
|
||||
'KSampler'
|
||||
])
|
||||
await comfyPage.setSetting('Comfy.NodeLibrary.Bookmarks.V2', [])
|
||||
await comfyPage.reload()
|
||||
expect(await comfyPage.getSetting('Comfy.NodeLibrary.Bookmarks')).toEqual(
|
||||
[]
|
||||
)
|
||||
expect(
|
||||
await comfyPage.getSetting('Comfy.NodeLibrary.Bookmarks.V2')
|
||||
).toEqual(['foo/', 'foo/KSamplerAdvanced', 'KSampler'])
|
||||
})
|
||||
})
|
||||
|
||||
test.describe('Workflows sidebar', () => {
|
||||
|
||||
@@ -13,29 +13,6 @@ export const BOOKMARK_SETTING_ID = 'Comfy.NodeLibrary.Bookmarks.V2'
|
||||
export const useNodeBookmarkStore = defineStore('nodeBookmark', () => {
|
||||
const settingStore = useSettingStore()
|
||||
const nodeDefStore = useNodeDefStore()
|
||||
|
||||
const migrateLegacyBookmarks = () => {
|
||||
const legacyBookmarks = settingStore.get('Comfy.NodeLibrary.Bookmarks')
|
||||
if (!legacyBookmarks.length) {
|
||||
return
|
||||
}
|
||||
|
||||
legacyBookmarks.forEach((bookmark: string) => {
|
||||
// If the bookmark is a folder, add it as a bookmark
|
||||
if (bookmark.endsWith('/')) {
|
||||
addBookmark(bookmark)
|
||||
return
|
||||
}
|
||||
const category = bookmark.split('/').slice(0, -1).join('/')
|
||||
const displayName = bookmark.split('/').pop() ?? ''
|
||||
const nodeDef = nodeDefStore.nodeDefsByDisplayName[displayName]
|
||||
|
||||
if (!nodeDef) return
|
||||
addBookmark(`${category === '' ? '' : category + '/'}${nodeDef.name}`)
|
||||
})
|
||||
settingStore.set('Comfy.NodeLibrary.Bookmarks', [])
|
||||
}
|
||||
|
||||
const bookmarks = computed<string[]>(() =>
|
||||
settingStore.get(BOOKMARK_SETTING_ID)
|
||||
)
|
||||
@@ -225,8 +202,6 @@ export const useNodeBookmarkStore = defineStore('nodeBookmark', () => {
|
||||
deleteBookmarkCustomization,
|
||||
renameBookmarkCustomization,
|
||||
defaultBookmarkIcon,
|
||||
defaultBookmarkColor,
|
||||
|
||||
migrateLegacyBookmarks
|
||||
defaultBookmarkColor
|
||||
}
|
||||
})
|
||||
|
||||
@@ -34,7 +34,6 @@ import TopMenubar from '@/components/topbar/TopMenubar.vue'
|
||||
import { setupAutoQueueHandler } from '@/services/autoQueueService'
|
||||
import { useKeybindingStore } from '@/stores/keybindingStore'
|
||||
import { useSidebarTabStore } from '@/stores/workspace/sidebarTabStore'
|
||||
import { useNodeBookmarkStore } from '@/stores/nodeBookmarkStore'
|
||||
import { useNodeDefStore, useNodeFrequencyStore } from '@/stores/nodeDefStore'
|
||||
import { useBottomPanelStore } from '@/stores/workspace/bottomPanelStore'
|
||||
import { useModelStore } from '@/stores/modelStore'
|
||||
@@ -171,9 +170,6 @@ const onGraphReady = () => {
|
||||
// Load model folders
|
||||
useModelStore().loadModelFolders()
|
||||
|
||||
// Migrate legacy bookmarks
|
||||
useNodeBookmarkStore().migrateLegacyBookmarks()
|
||||
|
||||
// Node defs now available after comfyApp.setup.
|
||||
// Explicitly initialize nodeSearchService to avoid indexing delay when
|
||||
// node search is triggered
|
||||
|
||||
Reference in New Issue
Block a user