Skip to content

Release 0.69.2#471

Merged
tudddorrr merged 3 commits intomainfrom
develop
Feb 20, 2026
Merged

Release 0.69.2#471
tudddorrr merged 3 commits intomainfrom
develop

Conversation

@tudddorrr
Copy link
Collaborator

No description provided.

@tudddorrr tudddorrr added the release This pull request contains a release label Feb 20, 2026
@claude
Copy link

claude bot commented Feb 20, 2026

PR Review: Release 0.69.2


🟡 Potential Bugs

StatGlobalValueChart missing hasData prop

BarChartCard passes hasData={data.length > 0} to ChartCard, which enables the new "No data for this date range" message. However, StatGlobalValueChart does not pass hasData, so it always defaults to true — meaning an empty chart will render instead of the no-data message when dataPoints is empty.

// StatGlobalValueChart.tsx — missing hasData
<ChartCard
  title="Global value"
  loading={loading}
  error={error}
  // hasData={dataPoints.length > 0}  ← should be added
>

🟡 Performance

useMemo in useYAxisWidth never memoizes effectively

In useYAxis.tsx, useMemo lists [data, transformer] as dependencies, but transformer is always an inline arrow function at each call site (BarChartCard, StatGlobalValueChart, EventsDisplay). This creates a new reference on every render, causing useMemo to recompute on every render — the memoization provides no benefit and adds overhead.

Fix: wrap transformer at call sites with useCallback, or remove useMemo and compute yAxisWidth directly since the computation is already cheap.

// BarChartCard.tsx
const transformer = useCallback((d: T[]) =>
  d.flatMap((item) =>
    bars.map((bar) => {
      if (typeof bar.dataKey === 'function') return bar.dataKey(item)
      const value = get(item, String(bar.dataKey))
      return typeof value === 'number' ? value : 0
    })
  ), [bars])

const { yAxisProps } = useYAxis({ data, transformer })

🔵 Minor

tickComponent memoized with no dependencies

In useYAxis.tsx, tickComponent is wrapped in useMemo([]) with an empty dependency array. A useMemo with no dependencies is equivalent to a module-level constant — it only runs once anyway but adds unnecessary hook overhead. This could simply be a module-level constant or moved outside the hook.

// Could be a module-level constant instead
const tickComponent = (
  <ChartTick
    transform={(x, y) => {
      if (!x || !y) return ''
      return `translate(${x - 2},${y - 12})`
    }}
    formatter={(tick) => tick.toLocaleString()}
  />
)

@tudddorrr tudddorrr merged commit 894c87b into main Feb 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release This pull request contains a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant