Skip to content

Commit e668e05

Browse files
committed
Tightened related entity filter: SanitizeData.tsx
1 parent 8411ef1 commit e668e05

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

lightrag_webui/src/features/SanitizeData.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -838,13 +838,19 @@ export default function SanitizeData() {
838838
// Process edges/relationships
839839
(data.edges || []).forEach((edge: any) => {
840840
const props = edge.properties || {};
841-
edges.push({
842-
from: edge.source,
843-
to: edge.target,
844-
relation: props.description || "",
845-
weight: props.weight || 1.0,
846-
keywords: props.keywords || "",
847-
});
841+
const from = edge.source;
842+
const to = edge.target;
843+
844+
// Keep the relationship only if Bypass Switch (or whichever entity we queried) is one of the endpoints
845+
if (from === entityName || to === entityName) {
846+
edges.push({
847+
from,
848+
to,
849+
relation: props.description || "",
850+
weight: props.weight || 1.0,
851+
keywords: props.keywords || "",
852+
});
853+
}
848854
});
849855

850856
// Store the parsed data
@@ -1699,6 +1705,7 @@ export default function SanitizeData() {
16991705
},
17001706
}));
17011707
}}
1708+
onFocus={(e) => e.target.select()}
17021709
/>
17031710
</div>
17041711

0 commit comments

Comments
 (0)