fix(dashboard): another Home crash — top_conviction_week vs _7d
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

Round-2 of the Home/Strategy contract drift. The dashboard endpoint
returns top_conviction_7d, but the frontend type+code referenced
top_conviction_week — so the section render crashed on
undefined.length.

Renamed type field + code references to top_conviction_7d to match
the actual API, and kept the ?? [] guard so future drift can't crash.
This commit is contained in:
Viktor Barzin 2026-05-27 18:11:54 +00:00
parent 04e3add4d5
commit 658c4d3221
2 changed files with 9 additions and 7 deletions

View file

@ -141,13 +141,13 @@ export default function MeetKevinHome() {
</Link> </Link>
{/* Top conviction this week */} {/* Top conviction this week */}
{dashboard && dashboard.top_conviction_week.length > 0 && ( {dashboard && (dashboard.top_conviction_7d ?? []).length > 0 && (
<div className="bg-slate-800 border border-slate-700 rounded-xl p-5 space-y-3"> <div className="bg-slate-800 border border-slate-700 rounded-xl p-5 space-y-3">
<h3 className="text-sm font-semibold text-slate-300 uppercase tracking-wide"> <h3 className="text-sm font-semibold text-slate-300 uppercase tracking-wide">
Top Conviction Last 7 Days Top Conviction Last 7 Days
</h3> </h3>
<div className="space-y-2"> <div className="space-y-2">
{dashboard.top_conviction_week.map( {(dashboard.top_conviction_7d ?? []).map(
(row: { (row: {
symbol: string; symbol: string;
max_conviction: number; max_conviction: number;

View file

@ -107,11 +107,13 @@ export interface PipelineHealth {
export interface DashboardData { export interface DashboardData {
latest_video: VideoSummary | null; latest_video: VideoSummary | null;
latest_analysis: VideoAnalysis | null; latest_analysis: VideoAnalysis | null;
top_conviction_week: { top_conviction_7d:
| {
symbol: string; symbol: string;
max_conviction: number; max_conviction: number;
mention_count: number; mention_count: number;
}[]; }[]
| null;
outlook_trend_14d: { outlook_trend_14d: {
day: string; day: string;
direction: MarketOutlook; direction: MarketOutlook;