sitesmith: layers panel prefers props.aiName when present

This commit is contained in:
2026-05-23 14:25:43 -07:00
parent e651becdbe
commit 2ca1ff0cf9

View File

@@ -29,7 +29,7 @@ const LayerNode: React.FC<LayerNodeProps> = ({ nodeId, depth }) => {
const resolvedName = typeof nodeType === 'object' && nodeType !== null && 'resolvedName' in nodeType const resolvedName = typeof nodeType === 'object' && nodeType !== null && 'resolvedName' in nodeType
? (nodeType as any).resolvedName ? (nodeType as any).resolvedName
: typeof nodeType === 'string' ? nodeType : undefined; : typeof nodeType === 'string' ? nodeType : undefined;
const displayName = node.data.displayName || resolvedName || 'Component'; const displayName = (node.data.props?.aiName as string) || node.data.displayName || (node.data.type as any)?.resolvedName || 'Node';
const childNodeIds: string[] = node.data.nodes || []; const childNodeIds: string[] = node.data.nodes || [];
const linkedNodeIds: string[] = Object.values(node.data.linkedNodes || {}) as string[]; const linkedNodeIds: string[] = Object.values(node.data.linkedNodes || {}) as string[];
const allChildren = [...childNodeIds, ...linkedNodeIds]; const allChildren = [...childNodeIds, ...linkedNodeIds];