From 7f4f393ba07b783afb8a185dc52ed82a6cf2d83d Mon Sep 17 00:00:00 2001 From: Amiram_se Date: Thu, 5 Nov 2026 19:07:25 +0400 Subject: [PATCH] feat(dashboard): summarise signal performance on the overview tab The four numbers and the way to a public record, from the snapshot the signals tab reads, so the two can't disagree. Before the first evaluation it shows the same message in their place, never zeros. Co-Authored-By: Claude Opus 5.5 --- .../dashboard-overview/DashboardOverview.tsx | 2 + .../components/SignalSummary.tsx | 69 +++++++++++++++++++ .../organisms/dashboard-overview/types.ts | 2 + .../src/shared/locales/fa/dashboard.json | 6 ++ 4 files changed, 79 insertions(+) create mode 100644 platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/components/SignalSummary.tsx diff --git a/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/DashboardOverview.tsx b/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/DashboardOverview.tsx index c500172..d10725e 100644 --- a/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/DashboardOverview.tsx +++ b/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/DashboardOverview.tsx @@ -6,6 +6,7 @@ import { useDashboardOverviewPart } from '../../../../../../../features/overview import { AudienceSection } from './components/AudienceSection'; import { IncomeSection } from './components/IncomeSection'; import { PlanBreakdown } from './components/PlanBreakdown'; +import { SignalSummary } from './components/SignalSummary'; import type { DashboardOverviewProps } from './types'; /** داشبورد › نمای کلی (J10-0), the creator's default tab. Loads and fails as one. */ @@ -18,6 +19,7 @@ export function DashboardOverview({ layout }: DashboardOverviewProps) { + ); } diff --git a/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/components/SignalSummary.tsx b/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/components/SignalSummary.tsx new file mode 100644 index 0000000..d1ba3e6 --- /dev/null +++ b/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/components/SignalSummary.tsx @@ -0,0 +1,69 @@ +'use client'; + +import { FlexBox } from '@lumina/island/atoms/flex-box'; +import { SectionTitle } from '@lumina/island/molecules/section-title'; +import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset'; +import { Suspense, useId } from 'react'; +import { useTranslation } from 'react-i18next'; + +import { useSignalStatsPart } from '../../../../../../../../features/prediction'; +import { PartBoundary } from '../../../../../../../error-boundaries'; +import { ROUTES } from '../../../../../../../navigation/navigation'; +import { SignalProgress } from '../../../../organisms/signal-progress'; +import { SignalStatTiles } from '../../../../organisms/signal-stat-tiles'; +import { SignalStatsPending } from '../../../../organisms/signal-stats-pending'; +import type { SignalSummaryProps } from '../types'; + +/** The same four numbers as the سیگنال‌ها tab, from the same snapshot, or the message before it. */ +function SignalSummaryBody({ layout }: SignalSummaryProps) { + const performance = useSignalStatsPart(); + + if (performance.status === 'pending') return ; + return ( + + + + + ); +} + +/** + * «عملکرد سیگنال‌ها» in short, with the way to the tab that explains it. It loads and fails on its + * own, so the rest of the page stands without it. + */ +export function SignalSummary({ layout }: SignalSummaryProps) { + const { t } = useTranslation('dashboard'); + const titleId = useId(); + + return ( + + + + + } + > + + + + + ); +} diff --git a/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/types.ts b/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/types.ts index 63010bb..1e4e687 100644 --- a/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/types.ts +++ b/platforms/market/src/app/screens/(main)/dashboard/overview/organisms/dashboard-overview/types.ts @@ -21,3 +21,5 @@ export type DashboardOverviewSkeletonProps = { export type PlanBreakdownProps = { plans: DashboardOverviewPartModel['plans']; }; + +export type SignalSummaryProps = DashboardOverviewProps; diff --git a/platforms/market/src/shared/locales/fa/dashboard.json b/platforms/market/src/shared/locales/fa/dashboard.json index bc1ecce..373a168 100644 --- a/platforms/market/src/shared/locales/fa/dashboard.json +++ b/platforms/market/src/shared/locales/fa/dashboard.json @@ -257,6 +257,12 @@ "income": "{{n}} {{currency}} · {{share}}" }, "note": "«کل خریدها» همه خریدها از ابتدا است، با تمدید و فعال‌سازی مجدد و منهای بازگشت وجه‌ها." + }, + "signals": { + "title": "عملکرد سیگنال‌ها", + "details": "جزئیات در تب سیگنال‌ها", + "error": "عملکرد سیگنال‌ها بارگذاری نشد.", + "loading": "در حال بارگذاری عملکرد سیگنال‌ها…" } } }