Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.
TypeScript adhdagent-orchestrationai-agentscanvasclaude-codecodexcoding-agentsdeveloper-toolselectrongeminilinuxmacosmultiplexeropencodeparallel-agentsterminalterminal-emulatorterminal-multiplexertmuxworkspace-manager
feat(canvas): VideoNode + route video files from explorer/openFile
enes63c925233c58
diff --git a/src/renderer/canvas/Canvas.tsx b/src/renderer/canvas/Canvas.tsxindex 09ff5922c..ff6552bf7 100644--- a/src/renderer/canvas/Canvas.tsx+++ b/src/renderer/canvas/Canvas.tsx@@ -21,6 +21,7 @@ import { GroupNode, setWorktreeActionHandler } from '../nodes/GroupNode'import { EditorNode } from '../nodes/EditorNode'import { DiffNode } from '../nodes/DiffNode'import { DinoNode } from '../nodes/DinoNode'+import VideoNode from '../nodes/VideoNode'import { withNodeBoundary } from '../components/NodeBoundary'import { Dock } from '../components/Dock'import { TabBar } from '../components/TabBar'@@ -111,6 +112,8 @@ import {createSshTerminalNode,createStickyNode,createTerminalNode,+ createVideoNode,+ isVideoFile,duplicateNode,flowToNodeStates,groupSelectedNodes,@@ -247,7 +250,8 @@ export function Canvas() {diff: withNodeBoundary(DiffNode),subagent: withNodeBoundary(SubagentNode),loop: withNodeBoundary(LoopNode),- dino: withNodeBoundary(DinoNode)+ dino: withNodeBoundary(DinoNode),+ video: withNodeBoundary(VideoNode)}),[])@@ -945,7 +949,12 @@ export function Canvas() {* dialog / quick-open paths are LOCAL and stay local (so their ⌘S never writes to the host). */const openFile = useCallback((filePath: string, center?: { x: number; y: number }, sshFs?: boolean) => {- setNodes((ns) => [...ns, createEditorNode(ns.length, filePath, center ?? viewCenter(), sshFs)])+ setNodes((ns) => [+ ...ns,+ isVideoFile(filePath)+ ? createVideoNode(ns.length, filePath, center ?? viewCenter())+ : createEditorNode(ns.length, filePath, center ?? viewCenter(), sshFs)+ ])markDirty()},[setNodes, markDirty, viewCenter]diff --git a/src/renderer/nodes/VideoNode.tsx b/src/renderer/nodes/VideoNode.tsxnew file mode 100644index 000000000..0843fe788--- /dev/null+++ b/src/renderer/nodes/VideoNode.tsx@@ -0,0 +1,71 @@+import { useEffect, useState } from 'react'+import { NodeResizer, useReactFlow, type NodeProps } from '@xyflow/react'+import type { CanvasNode } from '../state/workspace'++/**+ * A video player node for a local video file. The file is served over the `nt-media://`+ * protocol (allowlisted on mount via `media.allow`) and rendered with native controls so+ * seeking/scrubbing works. The frame/header mirror {@link EditorNode} for consistent+ * drag/resize/close behavior.+ */+export default function VideoNode({ id, data, selected }: NodeProps<CanvasNode>) {+ const { deleteElements } = useReactFlow()+ const [src, setSrc] = useState('')+ const [error, setError] = useState('')+ const filePath = (data.filePath as string) ?? ''+ const fileName = filePath.split('/').pop() || 'video'++ useEffect(() => {+ if (!filePath) return+ let alive = true+ window.nodeTerminal.media+ .allow(filePath)+ .then((url) => {+ if (alive) setSrc(url)+ })+ .catch(() => {+ if (alive) setError('Couldn’t load this video.')+ })+ return () => {+ alive = false+ }+ }, [filePath])++ return (+ <div+ className={`term-node video-node${selected ? ' selected' : ''}`}+ style={{ borderTopColor: data.color }}+ >+ <NodeResizer minWidth={320} minHeight={200} isVisible={selected} color={data.color} />++ <div className="term-node__header">+ <span className="term-node__title-text" title={filePath}>+ {fileName}+ </span>+ <span className="term-node__spacer" />+ <button+ className="term-node__close"+ title="Close"+ onClick={() => deleteElements({ nodes: [{ id }] })}+ >+ ×+ </button>+ </div>++ <div className="editor-node__body">+ <div className="editor-node__image nodrag nowheel">+ {src ? (+ <video+ src={src}+ controls+ preload="metadata"+ style={{ width: '100%', height: '100%', objectFit: 'contain' }}+ />+ ) : (+ <span className="editor-node__loading">{error || 'Loading…'}</span>+ )}+ </div>+ </div>+ </div>+ )+}