From 67c050ee5df50f3da3590a97c7a5bceb6a76a6bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Wed, 19 Aug 2026 19:16:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DUI=E7=BC=96=E8=BE=91=E5=99=A8?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E9=AB=98=E4=BA=AE=E5=BE=AA=E7=8E=AF=E5=AE=9A?= =?UTF-8?q?=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 高亮状态绑定到具体节点与状态字段 循环定位时重建状态提示并滚入Inspector可视区 补充多节点连续定位的回归测试 --- .../components/Inspector/InspectorSidebar.tsx | 28 ++++++++++--- .../src/view/ui-editor/index.tsx | 4 +- .../src/view/ui-editor/useUiEditorPage.ts | 4 +- .../tests/uiEditorPage.test.ts | 39 +++++++++++++++++-- 4 files changed, 64 insertions(+), 11 deletions(-) diff --git a/apps/ai-game-creator-shell/src/view/ui-editor/components/Inspector/InspectorSidebar.tsx b/apps/ai-game-creator-shell/src/view/ui-editor/components/Inspector/InspectorSidebar.tsx index 9f150eada..a02444660 100644 --- a/apps/ai-game-creator-shell/src/view/ui-editor/components/Inspector/InspectorSidebar.tsx +++ b/apps/ai-game-creator-shell/src/view/ui-editor/components/Inspector/InspectorSidebar.tsx @@ -1,14 +1,17 @@ import { Boxes, LockKeyhole, Trash2, Unlock } from 'lucide-react'; -import type { - InputHTMLAttributes, +import { + type InputHTMLAttributes, ReactNode, SelectHTMLAttributes, TextareaHTMLAttributes, + useEffect, + useRef, } from 'react'; import { FontSamplePreview } from '../../../../features/ui-editor/components/FontSamplePreview'; import { SpriteImagePreview } from '../../../../features/ui-editor/components/SpriteImagePreview'; import type { StageStatusField } from '../../../../features/ui-editor/stageStatusOverview'; +import type { NodeId } from '../../../../features/ui-editor/types/NodeId'; import type { UIDesignImageId } from '../../../../features/ui-editor/types/UIDesignImageId'; import type { UIDesignImageRole } from '../../../../features/ui-editor/types/UIDesignImageRole'; import { uiEditorPrivateFontFamily } from '../../../../features/ui-editor/useUiEditorFontFaces'; @@ -307,6 +310,7 @@ function NodeInspector({ onKeepChildrenUnchangedChange: (value: boolean) => void; onMetadataChange: UiEditorInspectorProjection['setNodeMetadata']; highlightedStatusField: { + nodeId: NodeId; field: StageStatusField; requestId: number; } | null; @@ -412,11 +416,13 @@ function NodeInspector({
void; }) { const readOnly = useInspectorReadOnly(); + const statusRowRef = useRef(null); const kind = typeof value === 'string' ? value @@ -818,9 +827,18 @@ function NodeStageSelect({ : value.Blocked : null; const attentionTone = kind === 'Blocked' ? 'blocked' : 'review'; + + useEffect(() => { + if (!highlight) return; + statusRowRef.current?.scrollIntoView({ + block: 'nearest', + behavior: 'smooth', + }); + }, [highlight]); + return (