fix(dashboard): sort timing phases chronologically in mapTimingPhases

Merged
SH
1mo ago
+15-10

Fixes #2987

In 6dd5c051 (#2980), mapLatency in apps/dashboard/src/data/metrics.client.ts was updated to sort Tinybird metric buckets chronologically (oldest -> newest) before mapping, while mapTimingPhases passed timestamp: metric.timestamp into ChartAreaTimingPhases without sorting.

This sorts [...(timingPhases.data ?? [])] ascending by new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime() in mapTimingPhases to match mapLatency.

ss
Image