diff --git a/lightrag_webui/src/components/graph/PropertiesView.tsx b/lightrag_webui/src/components/graph/PropertiesView.tsx index 3ebdfd29..39b9a448 100644 --- a/lightrag_webui/src/components/graph/PropertiesView.tsx +++ b/lightrag_webui/src/components/graph/PropertiesView.tsx @@ -183,7 +183,8 @@ const PropertyRow = ({ entityType, sourceId, targetId, - isEditable = false + isEditable = false, + truncate }: { name: string value: any @@ -197,6 +198,7 @@ const PropertyRow = ({ sourceId?: string targetId?: string isEditable?: boolean + truncate?: string }) => { const { t } = useTranslation() @@ -216,7 +218,12 @@ const PropertyRow = ({ // Format the value to convert to newlines const formattedValue = formatValueWithSeparators(value) - const formattedTooltip = tooltip || formatValueWithSeparators(value) + let formattedTooltip = tooltip || formatValueWithSeparators(value) + + // If this is source_id field and truncate info exists, append it to the tooltip + if (name === 'source_id' && truncate) { + formattedTooltip += `\n(Truncation-${truncate})` + } // Use EditablePropertyRow for editable fields (description, entity_id and keywords) if (isEditable && (name === 'description' || name === 'entity_id' || name === 'keywords')) { @@ -241,7 +248,10 @@ const PropertyRow = ({ // For non-editable fields, use the regular Text component return (
- {getPropertyNameTranslation(name)}: + + {getPropertyNameTranslation(name)} + {name === 'source_id' && truncate && } + : { {Object.keys(node.properties) .sort() .map((name) => { - if (name === 'created_at') return null; // Hide created_at property + if (name === 'created_at' || name === 'truncate') return null; // Hide created_at and truncate properties return ( { entityId={node.properties['entity_id']} entityType="node" isEditable={name === 'description' || name === 'entity_id'} + truncate={node.properties['truncate']} /> ) })} @@ -373,7 +384,7 @@ const EdgePropertiesView = ({ edge }: { edge: EdgeType }) => { {Object.keys(edge.properties) .sort() .map((name) => { - if (name === 'created_at') return null; // Hide created_at property + if (name === 'created_at' || name === 'truncate') return null; // Hide created_at and truncate properties return ( { sourceId={edge.sourceNode?.properties['entity_id'] || edge.source} targetId={edge.targetNode?.properties['entity_id'] || edge.target} isEditable={name === 'description' || name === 'keywords'} + truncate={edge.properties['truncate']} /> ) })}