feat(dashboard): finish the overview tab and document it

Keeps tile tips on the label's line, moves the share button under the banner
text on a phone, and records the new default tab, the overview and the
subscriber list in the decisions and page docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Amiram_se 2026-11-05 19:19:20 +04:00
parent d56064fa2e
commit 1b8d1df265
11 changed files with 131 additions and 31 deletions

View File

@ -1,6 +1,6 @@
# 0034 The creator's داشبورد is three tab routes, C7 a pushed page
Status: Proposed · Area: architecture · Date: 2026-10-08, amended 2026-10-09 · Decided by: agent
Status: Proposed · Area: architecture · Date: 2026-10-08, amended 2026-10-09, 0072 makes «نمای کلی» the default tab · Decided by: agent
## Context

View File

@ -0,0 +1,24 @@
# 0072 The analyst's overview is the default dashboard tab
Status: Accepted · Area: architecture · Date: 2026-11-05 · Decided by: user · Amends: 0034
## Context
The analyst's figures were spread over the plans tab, and the user asked for one place with audience, income, the split by plan and signal performance. The back end already answers `GET /me/dashboard/overview` and `GET /me/subscribers`.
## Decision
- `/dashboard/overview` in `dashboard/(creator)` is the first tab and the default: the nav's داشبورد opens it for a creator. The tabs are «نمای کلی» · «طرح‌های اشتراک» · «سیگنال‌ها» · «مالی», as in the design (J10-0); the request named three, and the signals tab stays because the same request adds to it.
- The plans tab keeps prices and the invite code, loses «مخاطبان», and shows the soonest-ending subscribers. Its followers count moved to the overview, where only the analyst sees it, with no list of who follows.
- `/dashboard/subscribers?filter=expiring` is a pushed page outside `(creator)`, with «همه» and «در حال انقضا» from the API's totals.
- The signal summary reads the snapshot the signals tab reads (`useSignalStatsPart`), so the two can't disagree, and shows the same message before the first evaluation.
## Alternatives
- Three tabs, with signals under the overview: the request also adds a block to the signals tab, so that tab has to exist.
- Keeping the figures on the plans tab with a strip above the tabs: the request removes it.
## Consequences
- The bar has four tabs on a phone; they fit at 375px with no scrolling.
- Everything but the signal summary is one read, so it loads and fails as one part. The summary loads and fails on its own.

View File

@ -29,6 +29,7 @@
- 0068 Keep the previous release as a stopped `<app>-<UTC time>` container with its env folder; `tools/rollback.sh <app>` starts it in place of the serving one.
- 0070 Render every page except the landing in the browser: the server reads no data and sends the frame, a skeleton and metadata; channel and post are `noindex`, their metadata from params only.
- 0071 Index only the landing in bull and bear; every other page is `noindex` with no canonical or JSON-LD, new pages included.
- 0072 Make `/dashboard/overview` the analyst's default tab, «نمای کلی» · «طرح‌های اشتراک» · «سیگنال‌ها» · «مالی»; the plans tab lists subscribers instead of audience counts, and `/dashboard/subscribers` lists them all.
## Proposed
@ -48,7 +49,7 @@
- 0030 architecture: Keep the last checkout's period, invite code and bank payment in the persisted `session.checkout-draft` store from payment start until success, and restore them on the same creator's checkout.
- 0031 design: List renew and reactivate periods as island `TierOption` cards, as checkout does, instead of R3's chip grid.
- 0033 architecture: Keep the payment sent to the bank in the checkout draft and settle it through `POST /subscriptions/payments/:id/abandon` only on the page that came back from the bank (bfcache or a history load), triggered by the app shell and awaited by checkout's screen read.
- 0034 architecture: Serve the creator's داشبورد from `dashboard/(creator)` as `/dashboard/plans` (default), `/dashboard/predictions` and `/dashboard/finance`, and C7 at `/dashboard/pricing` in `(flow)`; the شبا form and ledger details open in place.
- 0034 architecture: Serve the creator's داشبورد from `dashboard/(creator)` as `/dashboard/plans`, `/dashboard/predictions` and `/dashboard/finance` (0072 adds the default, `/dashboard/overview`), and C7 at `/dashboard/pricing` in `(flow)`; the شبا form and ledger details open in place.
- 0035 design: Pick a promotion's Shamsi date and time with island `Select`s in a sheet or modal, not a drawn wheel.
- 0036 architecture: During the 7-day lock the save button reads «ذخیره تخفیف» and saves promotion changes; standing prices and period switches stay read-only.
- 0037 architecture: Open payout receipts from the API's session-authorized `/payouts/me/payouts/:id/receipt` through `/api`, not signed expiring URLs.

View File

@ -32,7 +32,9 @@ Rendered on the server:
- `/account` · [account.md](market/account.md) · noindex · none · browser: top-bar title/login, AccountOverview (identity, lists, sign-out), SupportDialog, SignOutConfirm
- `/account/install` · [account-install.md](market/account-install.md) · noindex · none · browser: top-bar title/login, InstallApp
- `/account/notifications` · [account-notifications.md](market/account-notifications.md) · noindex · none · browser: top-bar title/login, NotificationSettings, offline banner
- `/dashboard/plans` · [dashboard-plans.md](market/dashboard-plans.md) · noindex · none · browser: PricingCard, InviteCodeCard, InviteShareSheet, CapacityRequestDialog, AudienceStats
- `/dashboard/overview` · [dashboard-overview.md](market/dashboard-overview.md) · noindex · none · browser: DashboardOverview (WelcomeBanner, audience, income, PlanBreakdown), SignalSummary
- `/dashboard/plans` · [dashboard-plans.md](market/dashboard-plans.md) · noindex · none · browser: PricingCard, InviteCodeCard, InviteShareSheet, CapacityRequestDialog, SubscribersPreview
- `/dashboard/subscribers` · [dashboard-subscribers.md](market/dashboard-subscribers.md) · noindex · none · browser: SubscriberList
- `/dashboard/predictions` · [dashboard-predictions.md](market/dashboard-predictions.md) · noindex · none · browser: PredictionsTab, TrackRecord, open and recently closed PredictionSections, ClosePredictionSheet
- `/dashboard/finance` · [dashboard-finance.md](market/dashboard-finance.md) · noindex · none · browser: BalanceSummary, PayoutAccount, ReadBackDialog, Ledger, LedgerDetail, receipt Lightbox
- `/dashboard/predictions/all` · [dashboard-predictions-all.md](market/dashboard-predictions-all.md) · noindex · none · browser: page name (bull), PredictionList, ClosePredictionSheet

View File

@ -0,0 +1,31 @@
# Dashboard: overview
`/dashboard/overview` · `apps/{bull,bear}/src/app/(main)/dashboard/(creator)/overview/page.tsx` · Type: account · Layout: [layout-dashboard-creator.md](layout-dashboard-creator.md), [layout-main.md](layout-main.md), [layout.md](layout.md)
| Field | Value |
| ----------- | ------------------------------------------------------------------------------------------------------------------------- |
| Robots | `noindex` (page `metadata`) |
| Status | `200` for every viewer: a guest is sent to login in the browser, an investor sees `AuthGuard`'s page-size no-access state |
| loading.tsx | `(creator)/overview/loading.tsx`: the page's skeleton, `delayed` |
| First flush | none |
| Canonical | none: `noindex` |
| H1 | bull: none (see the layout doc); bear: «داشبورد» in the layout |
| JSON-LD | none |
| Scripts | none beyond the layout's |
## Sections
The creator's default tab (0072). Everything sits in `AuthGuard role="creator"`, whose fallback is the skeleton, so the server HTML is only the skeleton.
| Section | Data | HTML | JS | Index | Notes |
| --------------- | ------ | -------- | ------- | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| WelcomeBanner | viewer | skeleton | hydrate | no | only with no audience and no income (J10-0b): shares the channel through `OwnerShareSheet`, frozen with the reason until the channel is public |
| AudienceSection | viewer | skeleton | hydrate | no | «مخاطبان»: followers (ⓘ subscribers included), active subscribers, ending within 7 days with a link to `/dashboard/subscribers?filter=expiring` |
| IncomeSection | viewer | skeleton | hydrate | no | «درآمد»: total (ⓘ net), this Shamsi month, payable with a link to مالی |
| PlanBreakdown | viewer | skeleton | hydrate | no | «تفکیک طرح‌ها»: chips «مشترکان فعال» · «کل خریدها» · «درآمد», one bar per plan with count and share; a creator with no plan sees the four periods at zero |
| SignalSummary | viewer | skeleton | hydrate | no | the four numbers and the way to a public record, or the message before the first evaluation; its own `PartBoundary` and `<Suspense>` |
## Notes
- The first four share one read, `GET /me/dashboard/overview`, under one `PartBoundary`. `SignalSummary` reads `GET /me/signal-stats` with the signals tab's query, so the two tabs can't disagree.
- bull: tiles two to a row; bear: three to a row, signal tiles four to a row. Same sections in both apps.

View File

@ -22,7 +22,7 @@ In bull's document order. Everything sits in `AuthGuard role="creator"`, whose f
| PricingCard | viewer | skeleton | hydrate | no | «قیمت طرح‌ها»: its own `PartBoundary` and `<Suspense>` (`useSuspenseQuery` in the browser); links to `/dashboard/pricing` |
| InviteCodeCard | viewer | skeleton | hydrate | no | «کد دعوت»: renders nothing until the creator is approved (J10-1e); the invite link is built from `NEXT_PUBLIC_SITE_URL`; own `PartBoundary` and `<Suspense>` |
| ↳ InviteShareSheet, CapacityRequestDialog | viewer | none | hydrate | no | mount when opened; bull: share opens a bottom sheet; bear: a popover beside the link field |
| AudienceStats | viewer | skeleton | hydrate | no | «مخاطبان»: follower count and active subscriptions, two browser reads; either failing fails the part |
| SubscribersPreview | viewer | skeleton | hydrate | no | «مشترکان»: the total and the three who end soonest, with «مشاهده همه» to `/dashboard/subscribers`; own `PartBoundary` and `<Suspense>` |
## Notes

View File

@ -0,0 +1,24 @@
# Dashboard: subscribers
`/dashboard/subscribers` · `apps/{bull,bear}/src/app/(main)/dashboard/subscribers/page.tsx` · Type: account · Layout: [layout-main.md](layout-main.md), [layout.md](layout.md)
| Field | Value |
| ----------- | --------------------------------------------------------------------------------------------------------------- |
| Robots | `noindex` (page `metadata`) |
| Status | `200` for every viewer: a guest is sent to login in the browser, an investor sees `AuthGuard`'s no-access state |
| loading.tsx | `subscribers/loading.tsx`: the bar or title over the chips and rows, `delayed` |
| First flush | none |
| Canonical | none: `noindex` |
| H1 | bull: the bar's title; bear: `DesktopPageTitle` |
| JSON-LD | none |
| Scripts | none beyond the layout's |
## Sections
| Section | Data | HTML | JS | Index | Notes |
| -------------- | ------ | -------- | ------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| SubscriberList | viewer | skeleton | hydrate | no | «همه» · «در حال انقضا» from the API's totals, the chip in `?filter=`; soonest-ending first, «نمایش مشترکان بیشتر» by cursor; only the @username shows |
## Notes
- Pushed from نمای کلی and طرح‌های اشتراک; opened on its own, back goes to نمای کلی. Locked until registration step 5 is done (0016).

View File

@ -1,19 +1,19 @@
# Layout: dashboard (creator)
`apps/{bull,bear}/src/app/(main)/dashboard/(creator)/layout.tsx` · wraps `/dashboard/plans`, `/dashboard/predictions` and `/dashboard/finance` · it awaits no read, so it adds nothing to any page's first flush; it sits outside each tab's `loading.tsx`, so the bar and the tabs stay while a tab loads
`apps/{bull,bear}/src/app/(main)/dashboard/(creator)/layout.tsx` · wraps `/dashboard/overview`, `/dashboard/plans`, `/dashboard/predictions` and `/dashboard/finance` · it awaits no read, so it adds nothing to any page's first flush; it sits outside each tab's `loading.tsx`, so the bar and the tabs stay while a tab loads
| Section | Data | HTML | JS | Index | Notes |
| -------------------------------------------- | ------ | ----------- | ------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| -------------------------------------------- | ------ | ----------- | ------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OnboardingGuard | viewer | none | hydrate | no | renders its children unchanged; once the browser knows the viewer, a creator who hasn't finished step 5 is sent to `/onboarding/creator-profile` with a return path (0016) |
| MobileTopBar (bull) | config | first flush | hydrate | no | `isTab`: the brand and «داشبورد» centred, in a `<span>`; support entry; the connection bar under it (0040) |
| ↳ NotificationBell and account avatar (bull) | viewer | none | hydrate | no | member only; while the viewer is unknown, the guest's «ورود/ثبت‌نام» holds the end of the bar, invisible |
| «داشبورد» `<h1>` (bear) | config | first flush | none | no | at the top of the 640 column |
| DashboardTabs | config | first flush | hydrate | no | `role="creator"`: island `TabLinks`, an `<a href>` per tab «طرح‌های اشتراک» · «سیگنال‌ها» · «مالی» (0034); the active tab comes from `usePathname`, so the server HTML already marks it |
| DashboardTabs | config | first flush | hydrate | no | `role="creator"`: island `TabLinks`, an `<a href>` per tab «نمای کلی» · «طرح‌های اشتراک» · «سیگنال‌ها» · «مالی» (0034, 0072); the active tab comes from `usePathname`, so the server HTML already marks it |
Scripts: none beyond the root layout's.
## Notes
- The tabs' URLs don't overlap the investor group's: `(creator)` owns `plans`, `predictions` and `finance`, `(investor)` owns `subscriptions`, `transactions` and `following`. There is no `/dashboard` page, so `/dashboard` answers the root not-found. The bottom nav (bull) and the header (bear) link a creator to `/dashboard/plans` and an investor to `/dashboard/subscriptions`.
- The tabs' URLs don't overlap the investor group's: `(creator)` owns `overview`, `plans`, `predictions` and `finance`, `(investor)` owns `subscriptions`, `transactions` and `following`. There is no `/dashboard` page, so `/dashboard` answers the root not-found. The bottom nav (bull) and the header (bear) link a creator to `/dashboard/overview` and an investor to `/dashboard/subscriptions`.
- The layout doesn't check the role: each page's `AuthGuard role="creator"` shows an investor the page-size no-access state, under these tabs.
- Debt: bull has no `<h1>` (the bar's «داشبورد» is a `<span>`), bear has one, `apps/bull/src/app/(main)/dashboard/(creator)/layout.tsx:22`. Make the bar's tab title an `<h1>` on tab screens, or add a visually hidden `<h1>` in the bull layout.

View File

@ -5,6 +5,7 @@ import { InfoTip } from '@lumina/island/molecules/info-tip';
import { SectionTitle } from '@lumina/island/molecules/section-title';
import { StatTile } from '@lumina/island/molecules/stat-tile';
import { number } from '@lumina/tools/format';
import { Element } from '@lumina/island/primitives/element';
import { useId } from 'react';
import { useTranslation } from 'react-i18next';
@ -31,12 +32,15 @@ export function AudienceSection({ overview, cols }: OverviewSectionProps) {
<StatTile
icon="users"
label={
<>
<Element
tag="span"
className="inline-flex items-center whitespace-nowrap"
>
{t('overview.audience.followers')}
<InfoTip label={t('overview.audience.followers-tip-label')}>
{t('overview.audience.followers-tip')}
</InfoTip>
</>
</Element>
}
value={number(overview.followers)}
/>

View File

@ -6,6 +6,7 @@ import { InfoTip } from '@lumina/island/molecules/info-tip';
import { SectionTitle } from '@lumina/island/molecules/section-title';
import { StatTile } from '@lumina/island/molecules/stat-tile';
import { month } from '@lumina/tools/format';
import { Element } from '@lumina/island/primitives/element';
import { useId } from 'react';
import { useTranslation } from 'react-i18next';
@ -33,12 +34,15 @@ export function IncomeSection({ overview, cols }: OverviewSectionProps) {
<StatTile
icon="wallet"
label={
<>
<Element
tag="span"
className="inline-flex items-center whitespace-nowrap"
>
{t('overview.income.total')}
<InfoTip label={t('overview.income.total-tip-label')}>
{t('overview.income.total-tip')}
</InfoTip>
</>
</Element>
}
value={
<Amount

View File

@ -34,13 +34,7 @@ export function WelcomeBanner({ layout }: WelcomeBannerProps) {
? undefined
: t('channel:share.owner.pending');
return (
<FlexBox direction="flex-col" className="relative">
<Banner
tone="info"
icon="share"
title={t('overview.welcome.title')}
action={
const share = (
<Button
variant="secondary"
size="sm"
@ -52,9 +46,25 @@ export function WelcomeBanner({ layout }: WelcomeBannerProps) {
>
{t('overview.welcome.action')}
</Button>
}
);
return (
<FlexBox direction="flex-col" className="relative">
<Banner
tone="info"
icon="share"
title={t('overview.welcome.title')}
action={layout === 'desktop' ? share : undefined}
>
{layout === 'desktop' ? (
t('overview.welcome.text')
) : (
// A phone has no room beside the text, so the button goes under it.
<FlexBox direction="flex-col" alignItems="items-start" gap="gap-3">
{t('overview.welcome.text')}
{share}
</FlexBox>
)}
</Banner>
<OwnerShareSheet model={sheet} channelUrl={channelUrl} layout={layout} />
</FlexBox>