mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-13 17:10:06 +00:00
feat: workflow sharing and ComfyHub publish flow (#8951)
## Summary Add workflow sharing by URL and a multi-step ComfyHub publish wizard, gated by feature flags and an optional profile gate. ## Changes - **What**: Share dialog with URL generation and asset warnings; ComfyHub publish wizard (Describe → Examples → Finish) with thumbnail upload and tags; profile gate flow; shared workflow URL loader with confirmation dialog - **Dependencies**: None (new `sharing/` module under `src/platform/workflow/`) ## Review Focus - Three new feature flags: `workflow_sharing_enabled`, `comfyhub_upload_enabled`, `comfyhub_profile_gate_enabled` - Share service API contract and stale-share detection (`workflowShareService.ts`) - Publish wizard and profile gate state management - Shared workflow URL loading and query-param preservation ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8951-feat-share-workflow-by-URL-30b6d73d3650813ebbfafdad775bfb33) by [Unito](https://www.unito.io) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
@@ -8,6 +8,19 @@ import { getPathDetails } from '@/utils/formatUtil'
|
||||
import { syncEntities } from '@/utils/syncUtil'
|
||||
import { buildTree } from '@/utils/treeUtil'
|
||||
|
||||
/**
|
||||
* Normalizes a timestamp value that may be either a number (milliseconds)
|
||||
* or an ISO 8601 string (from Go's time.Time JSON serialization) into
|
||||
* a consistent millisecond timestamp.
|
||||
*/
|
||||
function normalizeTimestamp(value: number | string): number {
|
||||
if (typeof value === 'string') {
|
||||
const ms = new Date(value).getTime()
|
||||
return Number.isNaN(ms) ? Date.now() : ms
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a file in the user's data directory.
|
||||
*/
|
||||
@@ -140,7 +153,7 @@ export class UserFile {
|
||||
// https://github.com/comfyanonymous/ComfyUI/pull/5446
|
||||
const updatedFile = (await resp.json()) as string | UserDataFullInfo
|
||||
if (typeof updatedFile === 'object') {
|
||||
this.lastModified = updatedFile.modified
|
||||
this.lastModified = normalizeTimestamp(updatedFile.modified)
|
||||
this.size = updatedFile.size
|
||||
}
|
||||
this.originalContent = this.content
|
||||
@@ -175,7 +188,7 @@ export class UserFile {
|
||||
// https://github.com/comfyanonymous/ComfyUI/pull/5446
|
||||
const updatedFile = (await resp.json()) as string | UserDataFullInfo
|
||||
if (typeof updatedFile === 'object') {
|
||||
this.lastModified = updatedFile.modified
|
||||
this.lastModified = normalizeTimestamp(updatedFile.modified)
|
||||
this.size = updatedFile.size
|
||||
}
|
||||
return this
|
||||
|
||||
Reference in New Issue
Block a user