-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug
Metric badges on canvas cards disappear in the following scenarios:
- Page reload — after an agent generates a logic model with metrics, reloading the page causes all metric badges to vanish
- IPFS-saved canvas — when viewing a canvas loaded from IPFS URL, metric badges are not rendered
Root Cause
cardsToNodes() in lib/canvas/react-flow-utils.ts does not include metrics in node.data. When the canvas state is restored (from localStorage or IPFS props), nodes are created without metric data, so CardNode cannot render the badges.
// cardsToNodes() output — missing metrics
data: {
id: card.id,
title: card.title,
description: card.description,
color: card.color,
type: card.type,
// metrics is absent
}Meanwhile, CardNode relies on data.metrics to render badges:
{data.metrics && data.metrics.length > 0 && (
<div>...</div>
)}Fix
Merge cardMetrics into node.data.metrics during both initialization and localStorage hydration in CanvasContext.tsx.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working