From fe78bc604345a17591407f4b468eb3c68ba97fa5 Mon Sep 17 00:00:00 2001 From: Johnpaul Chiwetelu <49923152+Myestery@users.noreply.github.com> Date: Fri, 20 Feb 2026 05:57:14 +0100 Subject: [PATCH] chore: remove unused draftTypes.ts to fix knip (#8993) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 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) --- .../workflow/persistence/base/draftTypes.ts | 85 ------------------- 1 file changed, 85 deletions(-) delete mode 100644 src/platform/workflow/persistence/base/draftTypes.ts diff --git a/src/platform/workflow/persistence/base/draftTypes.ts b/src/platform/workflow/persistence/base/draftTypes.ts deleted file mode 100644 index e2ffcaeca5..0000000000 --- a/src/platform/workflow/persistence/base/draftTypes.ts +++ /dev/null @@ -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 -} - -/** - * 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