diff --git a/headless/README.md b/headless/README.md index 25717ec..5b04c97 100644 --- a/headless/README.md +++ b/headless/README.md @@ -1008,8 +1008,14 @@ nodes/edges stay in React Flow's lookup; geometry, dragging, model data and hidd state are not fabricated. A view-local weak cache preserves tagged row identity, and ending an owner returns the original row. Detached focus is retired even when removing a renderer emits no blur. Flags never enter a Root or file. -Unscoped focused inputs/portals and exhausted/unknown paint-budget sentinels retain -the conservative whole-graph fallback; their missing ownership is not guessed. +Application panels/toolbars explicitly mark `data-canvas-ui-view` with their +current view ID, including portalled dialogs. Their inputs have a lifetime +independent of node culling; focusing them does not pin native nodes. Registered +node portals still declare their explicit target. Only unscoped third-party +inputs/portals keep the conservative whole-graph compatibility fallback; missing +ownership is not guessed. Exhausting curve-inspection work retains the edge +layer and its endpoints, while unrelated nodes remain culled. This can still +retain many endpoints/edges; it is not a constant-cost or complete geometry proof. React Flow 12.12.1 does not expose a retained-ID selector. The app-only `scripts/loaders/xyflow-retained.cjs` extends its two ESM visibility selectors at @@ -1026,7 +1032,10 @@ native empty-pane click. Reports include `inputCheck.beforeEditing` and `inputCheck.duringEditing`, `inputCheck.offscreenEditing` and `inputCheck.offscreenPortal`; this preflight is outside the copy timing window. The screen-pan probes preserve native IME and an unsaved Portal title, bound -mounted owners, check release after blur, and remount saved content. Add +mounted owners, check release after blur, and remount saved content. Independent +AI-panel focus/pan is recorded as `panelFocusedNodes`/`offscreenPanel`; blur saves +settings without starting a generation task. The actual-page suite also exceeds +the 4096-edge inspection limit and checks unrelated offscreen cards stay culled. Add `--turbopack` to the page/performance runner to use the app's default compiler. Turbopack fixtures live temporarily under the physical dependency workspace so its filesystem fence can resolve Next; the exact unique directory is removed in diff --git a/src/components/canvas/headless-ai-panel.tsx b/src/components/canvas/headless-ai-panel.tsx index 790f9ee..fcf5b78 100644 --- a/src/components/canvas/headless-ai-panel.tsx +++ b/src/components/canvas/headless-ai-panel.tsx @@ -11,7 +11,7 @@ import { managedImageSource } from "@/lib/canvas-v2"; import styles from "./canvas.module.css"; const object = (value: Json | undefined) => value && typeof value === 'object' && !Array.isArray(value) ? value : {}; -export function HeadlessAIPanel({ engine, element, close }: { engine: ProjectEngine; element: ElementRecord; close(): void }) { +export function HeadlessAIPanel({ engine, element, close, viewId }: { engine: ProjectEngine; element: ElementRecord; close(): void; viewId:string }) { const saved = object(element.data.ai), root = engine.getSnapshot(); const [models, setModels] = useState([]), [loading, setLoading] = useState(true), [error, setError] = useState(''); const [model, setModel] = useState(typeof saved.modelId === 'string' ? saved.modelId : ''); @@ -43,7 +43,7 @@ export function HeadlessAIPanel({ engine, element, close }: { engine: ProjectEng } const appliedOutput=typeof output.output_id==='string'&&run?.appliedOutputIds?.includes(output.output_id); const message = cancelling ? '取消请求已保存,等待确认…' : applying ? '正在应用生成结果…' : rejectedStart ? `生成未受理:${rejectedStart.blockers.join('、')}` : appliedOutput ? '此生成结果已应用' : pending.length ? pending.some(record => record.phase === 'blocked') ? '生成受理需要处理' : '正在等待同步并受理生成…' : run?.blocked ? '生成结果已保留,当前编辑需要协调' : run?.error ? '任务跟踪需要处理,可重试' : run?.hasMore ? '正在同步任务状态…' : run ? ({queued:'已受理,等待生成',running:'正在生成…',succeeded:'已更新当前元素',failed:'生成未完成,原内容已保留',conflict:'内容已改变,生成结果已保留',cancelled:'已取消生成',partially_succeeded:'部分步骤已完成'}[run.status]) : '结果将显示在当前元素'; - return
event.stopPropagation()} onKeyDown={event=>event.stopPropagation()}> + return
event.stopPropagation()} onKeyDown={event=>event.stopPropagation()}>
{image ? '图像创作' : '文本创作'}{element.data.title as string}