mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-20 23:04:06 +00:00
chore: remove unused draftTypes.ts to fix knip (#8993)
## Summary - Remove `src/platform/workflow/persistence/base/draftTypes.ts` which is not imported anywhere - Fixes `knip` reporting it as an unused file The file was added in #8517 but nothing consumes its exports yet. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8993-chore-remove-unused-draftTypes-ts-to-fix-knip-30d6d73d36508151a9e1e936864fd311) by [Unito](https://www.unito.io)
This commit is contained in:
committed by
GitHub
parent
25696ffe03
commit
fe78bc6043
@@ -1,85 +0,0 @@
|
||||
/**
|
||||
* V2 Workflow Persistence Type Definitions
|
||||
*
|
||||
* Two-layer state system:
|
||||
* - sessionStorage: Per-tab pointers (tiny, scoped by clientId)
|
||||
* - localStorage: Persistent drafts (per-workspace, per-draft keys)
|
||||
*/
|
||||
|
||||
/**
|
||||
* Metadata for a single draft entry stored in the index.
|
||||
* The actual workflow data is stored separately in a Draft payload key.
|
||||
*/
|
||||
export interface DraftEntryMeta {
|
||||
/** Workflow path (e.g., "workflows/Untitled.json") */
|
||||
path: string
|
||||
/** Display name of the workflow */
|
||||
name: string
|
||||
/** Whether this is an unsaved temporary workflow */
|
||||
isTemporary: boolean
|
||||
/** Last update timestamp (ms since epoch) */
|
||||
updatedAt: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Draft index stored in localStorage.
|
||||
* Contains LRU order and metadata for all drafts in a workspace.
|
||||
*
|
||||
* Key: `Comfy.Workflow.DraftIndex.v2:${workspaceId}`
|
||||
*/
|
||||
export interface DraftIndexV2 {
|
||||
/** Schema version */
|
||||
v: 2
|
||||
/** Last update timestamp */
|
||||
updatedAt: number
|
||||
/** LRU order: oldest → newest (draftKey array) */
|
||||
order: string[]
|
||||
/** Metadata keyed by draftKey (hash of path) */
|
||||
entries: Record<string, DraftEntryMeta>
|
||||
}
|
||||
|
||||
/**
|
||||
* Individual draft payload stored in localStorage.
|
||||
*
|
||||
* Key: `Comfy.Workflow.Draft.v2:${workspaceId}:${draftKey}`
|
||||
*/
|
||||
export interface DraftPayloadV2 {
|
||||
/** Serialized workflow JSON */
|
||||
data: string
|
||||
/** Last update timestamp */
|
||||
updatedAt: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Pointer stored in sessionStorage to track active workflow per tab.
|
||||
* Includes workspaceId for validation on read.
|
||||
*
|
||||
* Key: `Comfy.Workflow.ActivePath:${clientId}`
|
||||
*/
|
||||
export interface ActivePathPointer {
|
||||
/** Workspace ID for validation */
|
||||
workspaceId: string
|
||||
/** Path to the active workflow */
|
||||
path: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Pointer stored in sessionStorage to track open workflow tabs.
|
||||
* Includes workspaceId for validation on read.
|
||||
*
|
||||
* Key: `Comfy.Workflow.OpenPaths:${clientId}`
|
||||
*/
|
||||
export interface OpenPathsPointer {
|
||||
/** Workspace ID for validation */
|
||||
workspaceId: string
|
||||
/** Ordered list of open workflow paths */
|
||||
paths: string[]
|
||||
/** Index of the active workflow in paths array */
|
||||
activeIndex: number
|
||||
}
|
||||
|
||||
/** Maximum number of drafts to keep per workspace */
|
||||
export const MAX_DRAFTS = 32
|
||||
|
||||
/** Debounce delay for persisting graph changes (ms) */
|
||||
export const PERSIST_DEBOUNCE_MS = 512
|
||||
Reference in New Issue
Block a user