mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-19 22:09:37 +00:00
## Summary Users were finding the final step of the builder flow confusing/misleading, with the "choose default mode" not actually saving the workflow and people losing changes. This updates it to remove "save"/"set default" as a step in the builder, and changes it to a distinct action. ## Changes - **What**: - add mode selection tab on footer toolbar - extract reusable radio group component - remove setting default mode dialog - add save/save as/saved dialogs ## Screenshots (if applicable) https://github.com/user-attachments/assets/c7439c2e-a917-4f2b-b176-f8bb8c10026d ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10439-feat-App-mode-Rework-save-flow-32d6d73d3650814781b6c7bbea685a97) by [Unito](https://www.unito.io)
17 lines
543 B
TypeScript
17 lines
543 B
TypeScript
import { useTelemetry } from '@/platform/telemetry'
|
|
import type { LoadedComfyWorkflow } from '@/platform/workflow/management/stores/comfyWorkflow'
|
|
import { app } from '@/scripts/app'
|
|
|
|
export function setWorkflowDefaultView(
|
|
workflow: LoadedComfyWorkflow,
|
|
openAsApp: boolean
|
|
) {
|
|
workflow.initialMode = openAsApp ? 'app' : 'graph'
|
|
const extra = (app.rootGraph.extra ??= {})
|
|
extra.linearMode = openAsApp
|
|
workflow.changeTracker?.checkState()
|
|
useTelemetry()?.trackDefaultViewSet({
|
|
default_view: openAsApp ? 'app' : 'graph'
|
|
})
|
|
}
|