feat: full screen node

This commit is contained in:
2026-03-11 20:22:32 +01:00
parent 0b8c18a43f
commit 86d264e83a
11 changed files with 151 additions and 12 deletions

View File

@@ -22,6 +22,9 @@ export type FlowContextValue = {
isValidConnection: (connection: Connection) => boolean
/** Set by FlowKeyboardShortcuts so Node menubar can trigger paste / fit view. */
flowActionsRef: React.MutableRefObject<FlowActions | null>
/** When set, graph centers on this node and a fullscreen dialog shows the node. Cleared on close. */
fullscreenNodeId: string | null
setFullscreenNodeId: (id: string | null) => void
}
const FlowContext = React.createContext<FlowContextValue | null>(null)

View File

@@ -45,6 +45,8 @@ export type NodeTypeDescriptor = {
getResetData?: (nodeId?: string) => Record<string, unknown>
/** Optional: label shown on edge when this type is the target (e.g. "render", "add input"). */
connectionLabel?: string
/** When true, double-clicking the node header opens a fullscreen dialog for this node. */
supportsFullscreen?: boolean
}
const registry = new Map<string, NodeTypeDescriptor>()

View File

@@ -42,6 +42,7 @@ export function registerBuiltinNodes(): void {
title: nodeId ?? '',
}),
connectionLabel: 'adding input',
supportsFullscreen: true,
})
registerNodeType({
@@ -58,6 +59,7 @@ export function registerBuiltinNodes(): void {
menuLabel: 'Renderer',
menuIcon: <Sparkles className={ICON_CLASS} />,
connectionLabel: 'rendering',
supportsFullscreen: true,
})
registerNodeType({
@@ -75,6 +77,7 @@ export function registerBuiltinNodes(): void {
menuLabel: 'Agent',
menuIcon: <Bot className={ICON_CLASS} />,
connectionLabel: 'prompt/context',
supportsFullscreen: true,
})
registerNodeType({
@@ -128,5 +131,6 @@ export function registerBuiltinNodes(): void {
menuIcon: <Code2 className={ICON_CLASS} />,
getResetData: () => ({ body: '' }),
connectionLabel: 'adding input',
supportsFullscreen: true,
})
}