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 (