Repository navigation
wip nux lite #14255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wip nux lite #14255
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,7 @@ | ||
| export type EntryPath = 'appMode' | ||
| import type { LGraphNode } from '@/lib/litegraph/src/LGraphNode' | ||
| import { app } from '@/scripts/app' | ||
|
|
||
| export type EntryPath = 'appMode' | 'graph' | ||
|
|
||
| /** Setting holding the tours the user has completed or dismissed. */ | ||
| export const TOUR_SEEN_SETTING = 'Comfy.OnboardingCoachmarks.Seen' | ||
|
|
@@ -18,10 +21,15 @@ | |
| appRunButton: 'app-run-button', | ||
| inputsList: 'inputs-list', | ||
| outputs: 'outputs', | ||
| assetsPanel: 'assets-panel' | ||
| assetsPanel: 'assets-panel', | ||
|
|
||
| nodeReference: 'node-reference', | ||
| nodePrompt: 'node-prompt', | ||
| graphRunButton: 'graph-run-button' | ||
| } as const | ||
|
|
||
| export type CoachId = (typeof COACH_IDS)[keyof typeof COACH_IDS] | ||
| type CoachKey = keyof typeof COACH_IDS | ||
| export type CoachId = (typeof COACH_IDS)[CoachKey] | ||
|
|
||
| export interface CoachStep { | ||
| /** | ||
|
|
@@ -42,6 +50,10 @@ | |
| image?: string | ||
| } | ||
|
|
||
| export function isCoachKey(val: unknown): val is CoachKey { | ||
| return typeof val === 'string' && val in COACH_IDS | ||
| } | ||
|
AustinMroz marked this conversation as resolved.
Resolved
|
||
|
|
||
| /** | ||
| * Fixes the running step set (and so the step count) at tour start: drops steps | ||
| * whose own target isn't mounted, keeping targetless and deferred steps. | ||
|
|
@@ -88,5 +100,41 @@ | |
| deferTarget: true, | ||
| openSidebarTab: 'assets' | ||
| } | ||
| ] | ||
| ], | ||
| get graph(): CoachStep[] { | ||
| const nodeKeys: CoachKey[] = ['nodeReference', 'nodePrompt'] | ||
| const { nodes } = app.graph | ||
|
Check failure on line 106 in src/platform/onboarding/onboardingTours.ts
|
||
| const nodeSteps: [CoachKey, LGraphNode][] = nodeKeys.flatMap((key) => { | ||
| const node = nodes.find((n) => n.properties.tourStep === key) | ||
| return node ? [[key, node]] : [] | ||
| }) | ||
|
|
||
| const visible = new Set(app.canvas.visible_nodes.map((node) => node.id)) | ||
| if (!nodeSteps.map(([, node]) => node.id).every((id) => visible.has(id))) { | ||
| app.canvas.selectItems(nodeSteps.map(([, node]) => node)) | ||
| app.canvas.fitViewToSelectionAnimated() | ||
| app.canvas.selectItems([]) | ||
|
AustinMroz marked this conversation as resolved.
Resolved
|
||
| } | ||
| return [ | ||
| ...nodeSteps.map(([key]) => ({ | ||
| name: key, | ||
| coachId: COACH_IDS[key], | ||
| placement: 'auto' as const, | ||
| deferTarget: true | ||
| })), | ||
| { | ||
| name: 'run', | ||
| coachId: COACH_IDS.graphRunButton, | ||
| placement: 'auto' as const, | ||
| deferTarget: true | ||
| }, | ||
| { | ||
| name: 'assets', | ||
| coachId: COACH_IDS.assetsPanel, | ||
| placement: 'auto' as const, | ||
| deferTarget: true, | ||
| openSidebarTab: 'assets' | ||
| } | ||
| ] | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.