Rewrite @supermemory/memory-graph with perf optimizations + consolidate consumers (#809)

Co-authored-by: Vorflux AI <noreply@vorflux.com>
This commit is contained in:
vorflux[bot] 2026-03-28 19:06:27 -07:00 committed by GitHub
parent 38282a37d6
commit 851b8cfe86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
92 changed files with 6791 additions and 12118 deletions

View file

@ -85,6 +85,8 @@ function StaticGraphPreview({
height={height}
className="absolute inset-0"
viewBox={`0 0 ${width} ${height}`}
role="img"
aria-label="Memory graph preview"
>
{edges.map((e, i) => (
<line
@ -116,9 +118,8 @@ export const GraphCard = memo<GraphCardProps>(
({ containerTags, width = 216, height = 220, className }) => {
const { setViewMode } = useViewMode()
const { data, isLoading, error } = useGraphApi({
const { documents, isLoading, error } = useGraphApi({
containerTags,
limit: 20,
enabled: true,
})
@ -139,11 +140,8 @@ export const GraphCard = memo<GraphCardProps>(
)
}
const documentCount = data.stats?.documentsWithSpatial ?? 0
const memoryCount = data.documents.reduce(
(sum, d) => sum + d.memories.length,
0,
)
const documentCount = documents.length
const memoryCount = documents.reduce((sum, d) => sum + d.memories.length, 0)
return (
<button