From 3e908ab0b7b86fb001f3d68f6cd666c00cc7b6f4 Mon Sep 17 00:00:00 2001 From: Amiram_se Date: Wed, 21 Oct 2026 13:16:11 +0400 Subject: [PATCH] feat: render patterns --- ...0069-one-rendering-doc-per-market-route.md | 22 +++++ docs/decisions/README.md | 1 + docs/pages/README.md | 87 +++++++++++++++++++ docs/pages/market/account-install.md | 30 +++++++ docs/pages/market/account-notifications.md | 31 +++++++ docs/pages/market/account-profile.md | 31 +++++++ docs/pages/market/account.md | 34 ++++++++ docs/pages/market/analysts.md | 32 +++++++ docs/pages/market/auth-login-suspended.md | 32 +++++++ docs/pages/market/auth-login-verify.md | 34 ++++++++ docs/pages/market/auth-login.md | 34 ++++++++ docs/pages/market/auth-register-details.md | 37 ++++++++ docs/pages/market/auth-register-phone.md | 32 +++++++ docs/pages/market/auth-register-verify.md | 33 +++++++ docs/pages/market/auth-register.md | 32 +++++++ .../market/channels-username-posts-id.md | 40 +++++++++ docs/pages/market/channels-username.md | 45 ++++++++++ docs/pages/market/checkout-username.md | 35 ++++++++ docs/pages/market/compose-post-id.md | 31 +++++++ docs/pages/market/compose-post.md | 32 +++++++ docs/pages/market/compose-prediction.md | 32 +++++++ docs/pages/market/dashboard-finance.md | 33 +++++++ docs/pages/market/dashboard-following.md | 27 ++++++ docs/pages/market/dashboard-plans.md | 30 +++++++ .../pages/market/dashboard-predictions-all.md | 32 +++++++ docs/pages/market/dashboard-predictions.md | 31 +++++++ docs/pages/market/dashboard-pricing.md | 31 +++++++ docs/pages/market/dashboard-subscriptions.md | 29 +++++++ docs/pages/market/dashboard-transactions.md | 28 ++++++ docs/pages/market/feed.md | 35 ++++++++ docs/pages/market/home.md | 43 +++++++++ docs/pages/market/layout-dashboard-creator.md | 19 ++++ .../pages/market/layout-dashboard-investor.md | 17 ++++ docs/pages/market/layout-main.md | 28 ++++++ docs/pages/market/layout-terms.md | 16 ++++ docs/pages/market/layout.md | 21 +++++ docs/pages/market/not-found.md | 29 +++++++ docs/pages/market/notifications.md | 32 +++++++ .../market/onboarding-creator-profile-done.md | 32 +++++++ .../market/onboarding-creator-profile.md | 36 ++++++++ .../market/onboarding-investor-profile.md | 31 +++++++ docs/pages/market/payment-result-paymentId.md | 30 +++++++ docs/pages/market/payment-return.md | 28 ++++++ docs/pages/market/search.md | 34 ++++++++ docs/pages/market/terms-subscription.md | 30 +++++++ docs/pages/market/terms.md | 27 ++++++ docs/pages/wall-street-plaza/analysts-id.md | 26 ++++++ docs/pages/wall-street-plaza/analysts.md | 28 ++++++ docs/pages/wall-street-plaza/featured.md | 32 +++++++ .../wall-street-plaza/health-secondary.md | 26 ++++++ docs/pages/wall-street-plaza/health.md | 32 +++++++ .../invite-codes-requests.md | 23 +++++ docs/pages/wall-street-plaza/invite-codes.md | 24 +++++ .../wall-street-plaza/layout-invite-codes.md | 17 ++++ docs/pages/wall-street-plaza/layout-panel.md | 22 +++++ docs/pages/wall-street-plaza/layout.md | 17 ++++ docs/pages/wall-street-plaza/login.md | 30 +++++++ docs/pages/wall-street-plaza/not-found.md | 20 +++++ docs/pages/wall-street-plaza/payouts.md | 31 +++++++ docs/pages/wall-street-plaza/predictions.md | 30 +++++++ docs/pages/wall-street-plaza/subscriptions.md | 31 +++++++ .../wall-street-plaza/verifications-id.md | 33 +++++++ docs/pages/wall-street-plaza/verifications.md | 28 ++++++ 63 files changed, 1896 insertions(+) create mode 100644 docs/decisions/0069-one-rendering-doc-per-market-route.md create mode 100644 docs/pages/README.md create mode 100644 docs/pages/market/account-install.md create mode 100644 docs/pages/market/account-notifications.md create mode 100644 docs/pages/market/account-profile.md create mode 100644 docs/pages/market/account.md create mode 100644 docs/pages/market/analysts.md create mode 100644 docs/pages/market/auth-login-suspended.md create mode 100644 docs/pages/market/auth-login-verify.md create mode 100644 docs/pages/market/auth-login.md create mode 100644 docs/pages/market/auth-register-details.md create mode 100644 docs/pages/market/auth-register-phone.md create mode 100644 docs/pages/market/auth-register-verify.md create mode 100644 docs/pages/market/auth-register.md create mode 100644 docs/pages/market/channels-username-posts-id.md create mode 100644 docs/pages/market/channels-username.md create mode 100644 docs/pages/market/checkout-username.md create mode 100644 docs/pages/market/compose-post-id.md create mode 100644 docs/pages/market/compose-post.md create mode 100644 docs/pages/market/compose-prediction.md create mode 100644 docs/pages/market/dashboard-finance.md create mode 100644 docs/pages/market/dashboard-following.md create mode 100644 docs/pages/market/dashboard-plans.md create mode 100644 docs/pages/market/dashboard-predictions-all.md create mode 100644 docs/pages/market/dashboard-predictions.md create mode 100644 docs/pages/market/dashboard-pricing.md create mode 100644 docs/pages/market/dashboard-subscriptions.md create mode 100644 docs/pages/market/dashboard-transactions.md create mode 100644 docs/pages/market/feed.md create mode 100644 docs/pages/market/home.md create mode 100644 docs/pages/market/layout-dashboard-creator.md create mode 100644 docs/pages/market/layout-dashboard-investor.md create mode 100644 docs/pages/market/layout-main.md create mode 100644 docs/pages/market/layout-terms.md create mode 100644 docs/pages/market/layout.md create mode 100644 docs/pages/market/not-found.md create mode 100644 docs/pages/market/notifications.md create mode 100644 docs/pages/market/onboarding-creator-profile-done.md create mode 100644 docs/pages/market/onboarding-creator-profile.md create mode 100644 docs/pages/market/onboarding-investor-profile.md create mode 100644 docs/pages/market/payment-result-paymentId.md create mode 100644 docs/pages/market/payment-return.md create mode 100644 docs/pages/market/search.md create mode 100644 docs/pages/market/terms-subscription.md create mode 100644 docs/pages/market/terms.md create mode 100644 docs/pages/wall-street-plaza/analysts-id.md create mode 100644 docs/pages/wall-street-plaza/analysts.md create mode 100644 docs/pages/wall-street-plaza/featured.md create mode 100644 docs/pages/wall-street-plaza/health-secondary.md create mode 100644 docs/pages/wall-street-plaza/health.md create mode 100644 docs/pages/wall-street-plaza/invite-codes-requests.md create mode 100644 docs/pages/wall-street-plaza/invite-codes.md create mode 100644 docs/pages/wall-street-plaza/layout-invite-codes.md create mode 100644 docs/pages/wall-street-plaza/layout-panel.md create mode 100644 docs/pages/wall-street-plaza/layout.md create mode 100644 docs/pages/wall-street-plaza/login.md create mode 100644 docs/pages/wall-street-plaza/not-found.md create mode 100644 docs/pages/wall-street-plaza/payouts.md create mode 100644 docs/pages/wall-street-plaza/predictions.md create mode 100644 docs/pages/wall-street-plaza/subscriptions.md create mode 100644 docs/pages/wall-street-plaza/verifications-id.md create mode 100644 docs/pages/wall-street-plaza/verifications.md diff --git a/docs/decisions/0069-one-rendering-doc-per-market-route.md b/docs/decisions/0069-one-rendering-doc-per-market-route.md new file mode 100644 index 0000000..d53cd57 --- /dev/null +++ b/docs/decisions/0069-one-rendering-doc-per-market-route.md @@ -0,0 +1,22 @@ +# 0069 One rendering doc per market route + +Status: Proposed · Area: architecture · Date: 2026-10-21 · Decided by: agent + +## Context + +Every page needs a rendering doc in `docs/pages//`. bull (mobile) and bear (desktop) serve the same route tree from `platforms/market` (0001), and an edge in front of them picks the app by device. Googlebot Smartphone reads bull's HTML and desktop crawlers read bear's, so the "both templates" checks in a rendering doc compare the two apps. + +## Decision + +- Document each bull and bear route once, in `docs/pages/market/.md`. bull is the doc's mobile template and bear its desktop template; the Sections table follows bull's document order. +- A row only one app renders ends with `(bull)` or `(bear)` and is Index `no`. Notes give each app's difference as `bull: …; bear: …`. +- Admin routes keep their own folder, `docs/pages/wall-street-plaza/`, with the `desktop:` breakpoint as the desktop template (0063). + +## Alternatives + +- One doc per app (`docs/pages/bull/`, `docs/pages/bear/`): twice the docs for the same sections, which drift apart, and no single place to check that both apps put primary content in the first flush. + +## Consequences + +- A change to a page in one app updates the shared doc, and the reviewer checks the other app still matches it. +- The index file groups the docs under `market` and `wall-street-plaza`, not under bull and bear. diff --git a/docs/decisions/README.md b/docs/decisions/README.md index 9d6664c..1952990 100644 --- a/docs/decisions/README.md +++ b/docs/decisions/README.md @@ -64,3 +64,4 @@ - 0050 design: A post being read shows an info toast when the reader's access ends mid-read (J05-4f), the one toast not tied to the reader's own action. - 0062 architecture: Render every admin page in the browser behind `AdminGuard`; the server sends the frame, a same-size skeleton and `noindex`; no service worker, manifest, JSON-LD or caches. - 0063 design: Serve the admin's desktop and phone layouts from one app, switched at 1024px with Tailwind breakpoints; boards without a phone version scroll sideways. +- 0069 architecture: Document each bull and bear route once, in `docs/pages/market/`, with bull as its mobile template and bear as its desktop template. diff --git a/docs/pages/README.md b/docs/pages/README.md new file mode 100644 index 0000000..9044a48 --- /dev/null +++ b/docs/pages/README.md @@ -0,0 +1,87 @@ +# Page rendering docs + +One line per route: route · doc · robots · JSON-LD · browser-only sections. + +bull (mobile) and bear (desktop) share one doc per route under `market/`, with bull as the mobile template and bear as the desktop template (0069). wall-street-plaza is one responsive app (0063). + +## market + +Layouts and error pages: + +- root layout · [layout.md](market/layout.md) · — · — · browser: NetworkStatus, Toaster, ToastPlacementMarker (bear) +- `(main)` layout · [layout-main.md](market/layout-main.md) · — · — · browser: bear header nav, search field, publish menu, notification bell, notification panel, login button or account menu, `@modal` slot; bull BottomNav +- `(flow)/terms` layout · [layout-terms.md](market/layout-terms.md) · — · — · browser: MobileTopBar title (bull), DesktopHeader viewer parts (bear) +- `(main)/dashboard/(creator)` layout · [layout-dashboard-creator.md](market/layout-dashboard-creator.md) · — · — · browser: OnboardingGuard redirect, notification bell and account avatar (bull) +- `(main)/dashboard/(investor)` layout · [layout-dashboard-investor.md](market/layout-dashboard-investor.md) · — · — · browser: notification bell and account avatar (bull) +- not-found and error · [not-found.md](market/not-found.md) · noindex · none · browser: not-found top bar, every group `error.tsx`, `global-error.tsx` + +Indexable: + +- `/` · [home.md](market/home.md) · index · FAQPage · browser: LandingRedirect +- `/channels/[username]` · [channels-username.md](market/channels-username.md) · index; noindex when invalid, missing or suspended · none · browser: MobileTopBar (bull), ApprovedWelcome, ChannelActions, FollowNotice, locked post gate, Load more, PostLightbox +- `/channels/[username]/posts/[id]` · [channels-username-posts-id.md](market/channels-username-posts-id.md) · index; noindex when the post is missing, belongs to another channel, or the channel is suspended · none · browser: MobileTopBar (bull), ChannelActions, locked post gate, PreviewBanner, PostLightbox, access-ended toast +- `/terms` · [terms.md](market/terms.md) · index · none · browser: none +- `/terms/subscription` · [terms-subscription.md](market/terms-subscription.md) · index · none · browser: none + +`(main)`: + +- `/feed` · [feed.md](market/feed.md) · noindex · none · browser: top-bar bell/avatar/login, HomeGuard, HomeFeed (featured row, post cards, empty state), PostLightbox, InstallPrompt (bull) +- `/search` · [search.md](market/search.md) · noindex · none · browser: top-bar bell/avatar/login, SearchPanel (field, recent searches, featured, results) +- `/analysts` · [analysts.md](market/analysts.md) · noindex · none · browser: top-bar title/brand/login, AnalystFollowButton, GuestSignupCard +- `/notifications` · [notifications.md](market/notifications.md) · noindex · none · browser: top-bar title/login, NotificationCentre (filter chips, rows) +- `/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/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 +- `/dashboard/subscriptions` · [dashboard-subscriptions.md](market/dashboard-subscriptions.md) · noindex · none · browser: SubscriptionList, RenewalSheet, SupportDialog +- `/dashboard/transactions` · [dashboard-transactions.md](market/dashboard-transactions.md) · noindex · none · browser: TransactionList, TransactionDetail +- `/dashboard/following` · [dashboard-following.md](market/dashboard-following.md) · noindex · none · browser: FollowingList, UnfollowConfirm + +`(flow)`: + +- `/account/profile` · [account-profile.md](market/account-profile.md) · noindex · none · browser: AccountProfile (investor form or creator profile edit), LeaveDialog +- `/checkout/[username]` · [checkout-username.md](market/checkout-username.md) · noindex · none · browser: CheckoutPanel, CheckoutForm (tiers, code, pay footer), CheckoutHalts, NoCodeSheet +- `/compose/post` · [compose-post.md](market/compose-post.md) · noindex · none · browser: PostComposer, ComposerForm, LeaveConfirm, PostComposerDialog (bear `@modal`) +- `/compose/post/[id]` · [compose-post-id.md](market/compose-post-id.md) · noindex · none · browser: PostComposer, EditComposer, LeaveConfirm, PostComposerDialog (bear `@modal`) +- `/compose/prediction` · [compose-prediction.md](market/compose-prediction.md) · noindex · none · browser: PredictionComposer, ComposerPage, SymbolPicker, ConfirmPublish, LeaveConfirm, PredictionComposerDialog (bear `@modal`) +- `/dashboard/pricing` · [dashboard-pricing.md](market/dashboard-pricing.md) · noindex · none · browser: PricingForm, DateTimeDialog, ConfirmDialog, leave sheet +- `/payment/result/[paymentId]` · [payment-result-paymentId.md](market/payment-result-paymentId.md) · noindex · none · browser: PaymentResult, ResultActions +- `/payment/return` · [payment-return.md](market/payment-return.md) · noindex · none · browser: PaymentReturn (renders nothing; polls and replaces the page) + +`(auth)` and `(onboarding)`, browser-only behind their guards (0013): + +- `/auth/login` · [auth-login.md](market/auth-login.md) · noindex · none · browser: LoginStep, SupportDialog, NetworkBar +- `/auth/login/verify` · [auth-login-verify.md](market/auth-login-verify.md) · noindex · none · browser: LoginVerifyStep, ResendCode wait, NetworkBar +- `/auth/login/suspended` · [auth-login-suspended.md](market/auth-login-suspended.md) · noindex · none · browser: LoginSuspendedStep, actions, NetworkBar +- `/auth/register` · [auth-register.md](market/auth-register.md) · noindex · none · browser: RegisterTypeStep, NetworkBar +- `/auth/register/phone` · [auth-register-phone.md](market/auth-register-phone.md) · noindex · none · browser: RegisterPhoneStep, NetworkBar +- `/auth/register/verify` · [auth-register-verify.md](market/auth-register-verify.md) · noindex · none · browser: RegisterVerifyStep, ResendCode wait, NetworkBar +- `/auth/register/details` · [auth-register-details.md](market/auth-register-details.md) · noindex · none · browser: RegisterDetailsStep, ExpiryWarning, ExpiryHalt, LeaveRegistrationDialog, RulesSheet, NetworkBar +- `/onboarding/creator-profile` · [onboarding-creator-profile.md](market/onboarding-creator-profile.md) · noindex · none · browser: CreatorProfileStep, ProfileForm, SaveStatus, ProfilePreview, NetworkBar +- `/onboarding/creator-profile/done` · [onboarding-creator-profile-done.md](market/onboarding-creator-profile-done.md) · noindex · none · browser: CreatorProfileDoneStep, actions, NetworkBar +- `/onboarding/investor-profile` · [onboarding-investor-profile.md](market/onboarding-investor-profile.md) · noindex · none · browser: InvestorProfileStep, NetworkBar + +## wall-street-plaza + +Every page renders in the browser behind `AdminGuard` or `GuestGuard` (0062). + +- root layout · [layout.md](wall-street-plaza/layout.md) · — · — · browser: app shell session, toast placement, toaster +- `(panel)` layout · [layout-panel.md](wall-street-plaza/layout-panel.md) · — · — · browser: section counts, admin identity, menu sheet, sign-out dialog +- `invite-codes` layout · [layout-invite-codes.md](wall-street-plaza/layout-invite-codes.md) · — · — · browser: pending count +- not-found and error · [not-found.md](wall-street-plaza/not-found.md) · noindex · none · browser: every in-page error and empty state (PartBoundary, SessionEnded, group `error.tsx`) +- `/login` · [login.md](wall-street-plaza/login.md) · noindex · none · browser: GuestGuard form (number step), code step, resend countdown +- `/health` · [health.md](wall-street-plaza/health.md) · noindex · none · browser: beta subtitle, updated-at, BetaHealth (exit metrics, investor funnel, beta analysts) +- `/health/secondary` · [health-secondary.md](wall-street-plaza/health-secondary.md) · noindex · none · browser: beta subtitle, updated-at, BetaHealth (secondary metrics, analyst funnel) +- `/analysts` · [analysts.md](wall-street-plaza/analysts.md) · noindex · none · browser: search, analyst rows, account dialogs +- `/analysts/[id]` · [analysts-id.md](wall-street-plaza/analysts-id.md) · noindex · none · browser: header with name, badges and action, facts, audit log, account dialogs +- `/featured` · [featured.md](wall-street-plaza/featured.md) · noindex · none · browser: fewer banner, featured table, page visibility, preview, audit log, add and remove dialogs +- `/invite-codes` · [invite-codes.md](wall-street-plaza/invite-codes.md) · noindex · none · browser: code rows, code detail sheet, code dialogs +- `/invite-codes/requests` · [invite-codes-requests.md](wall-street-plaza/invite-codes-requests.md) · noindex · none · browser: request rows, code dialogs +- `/payouts` · [payouts.md](wall-street-plaza/payouts.md) · noindex · none · browser: tabs, payout rows, payout detail sheet, create, mark-paid and cancel dialogs +- `/predictions` · [predictions.md](wall-street-plaza/predictions.md) · noindex · none · browser: quote health, queue tabs, queue rows, prediction sheet, prediction dialogs +- `/subscriptions` · [subscriptions.md](wall-street-plaza/subscriptions.md) · noindex · none · browser: filter chips, subscription rows, detail sheet, grant dialog +- `/verifications` · [verifications.md](wall-street-plaza/verifications.md) · noindex · none · browser: status tabs, search and sort, verification rows +- `/verifications/[id]` · [verifications-id.md](wall-street-plaza/verifications-id.md) · noindex · none · browser: queue nav, banner, facts, decisions, past submissions, ID image, audit log, decision dialogs diff --git a/docs/pages/market/account-install.md b/docs/pages/market/account-install.md new file mode 100644 index 0000000..b35cdb6 --- /dev/null +++ b/docs/pages/market/account-install.md @@ -0,0 +1,30 @@ +# نصب اپلیکیشن (install the app) + +`/account/install` · `apps/{bull,bear}/src/app/(main)/account/install/page.tsx` · Type: account · Layout: [layout-main.md](layout-main.md), [layout.md](layout.md) + +| Field | Value | +| ----------- | -------------------------------------------------------------------------------------------------------- | +| Robots | `noindex` (page `metadata`) | +| Status | `200`; a guest is sent to login in the browser | +| loading.tsx | `(main)/account/install/loading.tsx` | +| First flush | none: what the device can do is known only in the browser | +| Canonical | none | +| H1 | bull: the `ResultPanel` title inside `InstallApp`, browser only; bear: `DesktopPageTitle` «نصب اپلیکیشن» | +| JSON-LD | none | +| Scripts | none beyond the layout's | + +## Sections + +In bull's document order. + +| Section | Data | HTML | JS | Index | Notes | +| ------------------------------- | ------ | ----------- | ------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| MobileTopBar (bull) | config | first flush | hydrate | no | back to `/account` when nothing of this site is behind the page (`backToPrevious`, 0057) | +| ↳ Title or login link (bull) | viewer | skeleton | hydrate | no | | +| DesktopPageTitle (bear) | config | first flush | hydrate | no | «بازگشت» to `/account` and the H1 | +| InstallApp | viewer | skeleton | hydrate | no | `AuthGuard` with `InstallAppSkeleton`, then the view from `useInstallApp`: the browser's install offer, the menu fallback, the iOS Safari steps, or installed | +| ↳ InstallBenefits, InstallSteps | config | skeleton | hydrate | no | bull: the menu caption; bear: the two steps | + +## Notes + +- No `PartBoundary`: the part reads nothing over the network; the pwa lib keeps the browser's install offer (0047). diff --git a/docs/pages/market/account-notifications.md b/docs/pages/market/account-notifications.md new file mode 100644 index 0000000..6a4bce5 --- /dev/null +++ b/docs/pages/market/account-notifications.md @@ -0,0 +1,31 @@ +# تنظیمات اعلان‌ها (notification settings) + +`/account/notifications` · `apps/{bull,bear}/src/app/(main)/account/notifications/page.tsx` · Type: account · Layout: [layout-main.md](layout-main.md), [layout.md](layout.md) + +| Field | Value | +| ----------- | ------------------------------------------------------------------------------------------ | +| Robots | `noindex` (page `metadata`) | +| Status | `200`; a guest is sent to login in the browser | +| loading.tsx | `(main)/account/notifications/loading.tsx` | +| First flush | none: the settings are read in the browser with the session | +| Canonical | none | +| H1 | bull: none, the top bar's title is a ``; bear: `DesktopPageTitle` «تنظیمات اعلان‌ها» | +| JSON-LD | none | +| Scripts | none beyond the layout's | + +## Sections + +In bull's document order. + +| Section | Data | HTML | JS | Index | Notes | +| ---------------------------- | ------------- | ----------- | ------- | ----- | ------------------------------------------------------------------------------------------------------------------ | +| MobileTopBar (bull) | config | first flush | hydrate | no | back to `/account` when opened on its own | +| ↳ Title or login link (bull) | viewer | skeleton | hydrate | no | | +| DesktopPageTitle (bear) | config | first flush | hydrate | no | «بازگشت» to `/account` and the H1 | +| NotificationSettings | viewer, query | skeleton | hydrate | no | `AuthGuard`, then `` and `PartBoundary name="notification-settings"`; `useSuspenseQuery`; bear: `framed` | +| ↳ SettingsSection cards | query | skeleton | hydrate | no | «اعلان در لومینا» and «پیامک» switches for the member's role; each switch saves as it flips, with a toast | +| ↳ Offline banner | — | none | hydrate | no | `useOfflineFreeze` freezes every switch and says why (0043) | + +## Notes + +- Debt: bull has no H1 while bear has one. Give bull an `sr-only` H1 with the same text. diff --git a/docs/pages/market/account-profile.md b/docs/pages/market/account-profile.md new file mode 100644 index 0000000..7328624 --- /dev/null +++ b/docs/pages/market/account-profile.md @@ -0,0 +1,31 @@ +# Account profile + +`/account/profile` · `apps/{bull,bear}/src/app/(flow)/account/profile/page.tsx` · Type: account · Layout: [layout.md](layout.md) + +| Field | Value | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| Robots | `noindex` (page `metadata`) | +| Status | `200` for every viewer: `AuthGuard` sends a guest to login in the browser, with a return path | +| loading.tsx | `account/profile/loading.tsx`: bull: the bar and the investor's form skeleton; bear: the header, the title and the same skeleton; `delayed` | +| First flush | none | +| Canonical | none: `noindex` | +| H1 | bull: none (the bar's name isn't a heading); bear: `DesktopPageTitle`, `account:profile.title` from i18n | +| JSON-LD | none | +| Scripts | none beyond the layout's | + +## Sections + +In bull's document order. One route for both roles (0046): the server sends the investor's frame and skeleton, because most members are investors. + +| Section | Data | HTML | JS | Index | Notes | +| ------------------------------------------------------------------ | ------ | ----------- | ------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| DesktopHeader (bear) | viewer | first flush | hydrate | no | the page renders it itself; rows as in [layout-main.md](layout-main.md) | +| AuthGuard fallback: MobileTopBar (bull) or DesktopPageTitle (bear) | config | first flush | hydrate | no | `account:profile.title`; back to `/account` | +| AccountProfile | viewer | skeleton | hydrate | no | server HTML: `InvestorProfileFormSkeleton`; once the viewer is known, `CreatorProfileEdit` (J03-1, bear's 640 column) or `InvestorProfileForm` (J12-2, bear's 560 column), each with its own bar or title that replaces the fallback's | +| ↳ LeaveDialog | — | none | hydrate | no | mounts when back or a link would drop unsaved changes | + +## Notes + +- `AccountProfile` imports both role forms statically, so every member downloads both. Split them with `next/dynamic` only if this route's first-load JS runs over its target. +- A session that ends on the page shows `SessionEnded` in place and keeps the draft (0042). +- Debt: different H1 per app. bull has no `h1`; add a screen-reader `h1` to the forms' mobile branch, as `SubscriptionTerms` does (`platforms/market/src/app/screens/(flow)/terms/subscription/organisms/subscription-terms/SubscriptionTerms.tsx:24`). diff --git a/docs/pages/market/account.md b/docs/pages/market/account.md new file mode 100644 index 0000000..5d09208 --- /dev/null +++ b/docs/pages/market/account.md @@ -0,0 +1,34 @@ +# حساب کاربری (account) + +`/account` · `apps/{bull,bear}/src/app/(main)/account/page.tsx` · Type: account · Layout: [layout-main.md](layout-main.md), [layout.md](layout.md) + +| Field | Value | +| ----------- | ------------------------------------------------------------------------------------- | +| Robots | `noindex` (page `metadata`) | +| Status | `200`; a guest is sent to login in the browser | +| loading.tsx | `(main)/account/loading.tsx`: the bar or title, then the overview skeleton | +| First flush | none: the identity comes from the session in the browser | +| Canonical | none | +| H1 | bull: none, the top bar's title is a ``; bear: `DesktopPageTitle` «حساب کاربری» | +| JSON-LD | none | +| Scripts | none beyond the layout's | + +## Sections + +In bull's document order. + +| Section | Data | HTML | JS | Index | Notes | +| ------------------------------- | ------------- | ----------- | ------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| MobileTopBar (bull) | config | first flush | hydrate | no | a pushed page's bar: back and support | +| ↳ Title or login link (bull) | viewer | skeleton | hydrate | no | | +| DesktopPageTitle (bear) | config | first flush | hydrate | no | «بازگشت» and the H1 | +| AccountOverview | viewer | skeleton | hydrate | no | `AuthGuard` with `AccountOverviewSkeleton`, in `PartBoundary name="account-overview"`; bear: `framed` | +| ↳ IdentityCard, CreatorFacts | viewer, query | skeleton | hydrate | no | creators also get the review badge, followers and subscribers: browser `useQuery`s that never throw and leave out what fails | +| ↳ PrivacyNote | config | skeleton | hydrate | no | investors only | +| ↳ Settings and help lists | viewer | skeleton | hydrate | no | `ListRow` links to `/account/profile`, `/dashboard/finance#…` (creators), `/account/notifications`, `/account/install` (not in the installed app), `/terms`; پشتیبانی opens `SupportDialog` | +| ↳ Sign-out button | — | skeleton | hydrate | no | `SignOutConfirm` asks first (0041) | +| ↳ SupportDialog, SignOutConfirm | — | none | hydrate | no | rendered with `open`; statically imported | + +## Notes + +- Debt: bull has no H1 while bear has one. Give bull an `sr-only` H1 with the same text. diff --git a/docs/pages/market/analysts.md b/docs/pages/market/analysts.md new file mode 100644 index 0000000..d4a7026 --- /dev/null +++ b/docs/pages/market/analysts.md @@ -0,0 +1,32 @@ +# تحلیلگران منتخب (featured analysts) + +`/analysts` · `apps/{bull,bear}/src/app/(main)/analysts/page.tsx` · Type: category and brand listing · Layout: [layout-main.md](layout-main.md), [layout.md](layout.md) + +| Field | Value | +| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Robots | `noindex` (page `metadata`) | +| Status | `200`; a failed read shows `(main)/error.tsx` with 200; a 404 or 403 read shows the empty state | +| loading.tsx | `(main)/analysts/loading.tsx`: the frame and three analyst cards | +| First flush | none: the page entry awaits `getFeaturedCreators()` through `readOnServer`, under `loading.tsx`, so the list streams | +| Canonical | none | +| H1 | `home:analysts.title` in `PageHeader`; bull: inside `AnalystsDirectory`, shown while the viewer is unknown or a guest, and removed for a member, whose top bar names the page | +| JSON-LD | none | +| Scripts | none beyond the layout's | + +## Sections + +In bull's document order. + +| Section | Data | HTML | JS | Index | Notes | +| ----------------------------------- | ----------------------- | ----------- | ------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| MobileTopBar (bull) | config | first flush | hydrate | no | a pushed page's bar: back and support | +| ↳ Title, brand or login link (bull) | viewer | skeleton | hydrate | no | member: the title; guest: the brand and «ورود/ثبت‌نام» | +| DeskBack, PageHeader (bear) | config | first flush | hydrate | no | «بازگشت» to خانه, or to the landing for a guest | +| AnalystsDirectory heading and note | `getFeaturedCreators()` | streamed | hydrate | no | bull's H1 and the «chosen by Lumina, not a ranking» note | +| AnalystList | `getFeaturedCreators()` | streamed | hydrate | no | every featured analyst in the admin's order, each card an `` to `/channels/username`; bull: one column; bear: three; empty: an `EmptyState` card | +| ↳ AnalystFollowButton | viewer | none | hydrate | no | investors only, once their follows are known; unfollow asks first | +| GuestSignupCard | viewer | none | hydrate | no | guests only: register and login links | + +## Notes + +- The page is `noindex`, but its channel links are server HTML, so crawlers that fetch it can follow them to the indexable channel pages. diff --git a/docs/pages/market/auth-login-suspended.md b/docs/pages/market/auth-login-suspended.md new file mode 100644 index 0000000..5ba4b0e --- /dev/null +++ b/docs/pages/market/auth-login-suspended.md @@ -0,0 +1,32 @@ +# Login: suspended account + +`/auth/login/suspended` · `apps/{bull,bear}/src/app/(auth)/auth/login/suspended/page.tsx` · Type: login · Layout: [layout.md](layout.md) + +| Field | Value | +| ----------- | ------------------------------------------------------------------------------------------------------------------------- | +| Robots | `noindex` (page `metadata`) | +| Status | `200`; without a suspension in the auth-flow store (a reload), the step sends the visitor to `/auth/login` in the browser | +| loading.tsx | `apps/{bull,bear}/src/app/(auth)/auth/login/suspended/loading.tsx` | +| First flush | `none` | +| Canonical | none set | +| H1 | `auth:suspended.title`, `ResultPanel`'s title; browser only | +| JSON-LD | `none` | +| Scripts | none beyond the layout's | + +## Sections + +In bull's document order. + +| Section | Data | HTML | JS | Index | Notes | +| -------------------------- | ------ | ----------- | ------- | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| AuthTopBar (bull) | config | first flush | none | no | brand `` and support; no way back into login | +| AuthTemplate header (bear) | config | first flush | none | no | brand `` | +| SupportEntry | — | first flush | hydrate | no | in the bar; the dialog mounts only when open | +| NetworkBar | — | none | hydrate | no | under the bar, only while offline or reconnecting | +| LoginSuspendedStep | viewer | skeleton | hydrate | no | `GuestGuard` fallback `SkeletonPreset preset="state"`; amber `ResultPanel`; a creator sees the admin's reason and the SMS note; an investor suspended mid-session learns they were signed out | +| ↳ Actions | config | skeleton | hydrate | no | support button and ``; bull: `PinnedFooter`; bear: inside the card | + +## Notes + +- Reached after a valid code for a suspended account (J01-3) or from `AppShell`'s `useSuspendedHalt` mid-session (J01-3d). The suspension lives only in memory (0013, 0015). +- Focus moves to the heading when the screen opens. diff --git a/docs/pages/market/auth-login-verify.md b/docs/pages/market/auth-login-verify.md new file mode 100644 index 0000000..7e472be --- /dev/null +++ b/docs/pages/market/auth-login-verify.md @@ -0,0 +1,34 @@ +# Login: code + +`/auth/login/verify` · `apps/{bull,bear}/src/app/(auth)/auth/login/verify/page.tsx` · Type: login · Layout: [layout.md](layout.md) + +| Field | Value | +| ----------- | -------------------------------------------------------------------------------------------------------------------------- | +| Robots | `noindex` (page `metadata`) | +| Status | `200`; without a number in the auth-flow store (a reload), the step sends the visitor back to `/auth/login` in the browser | +| loading.tsx | `apps/{bull,bear}/src/app/(auth)/auth/login/verify/loading.tsx` | +| First flush | `none` | +| Canonical | none set | +| H1 | `CodeStep`'s heading; browser only | +| JSON-LD | `none` | +| Scripts | none beyond the layout's | + +## Sections + +In bull's document order. + +| Section | Data | HTML | JS | Index | Notes | +| -------------------------- | ------ | ----------- | ------- | ----- | -------------------------------------------------------------------------------------------------------------------- | +| AuthTopBar (bull) | config | first flush | none | no | back button and `auth:login.header` | +| ↳ BackButton (bull) | URL | first flush | hydrate | no | `` to `/auth/login`, keeping `?redirect=` | +| AuthTemplate header (bear) | config | first flush | none | no | brand `` | +| StepBack (bear) | URL | first flush | hydrate | no | «بازگشت» above the card to `/auth/login`, keeping `?redirect=` | +| SupportEntry | — | first flush | hydrate | no | bull: bottom sheet; bear: popover; the dialog mounts only when open | +| NetworkBar | — | none | hydrate | no | under the bar, only while offline or reconnecting | +| LoginVerifyStep | viewer | skeleton | hydrate | no | `GuestGuard` fallback `SkeletonPreset preset="form"`; guest with a number: the number, 6 code cells, resend, support | +| ↳ ResendCode wait | clock | skeleton | hydrate | no | island `ResendCode` with `endsAt` from the flow store | + +## Notes + +- Decision 0013: the step renders only in the browser; the phone number lives in memory, never in the URL or storage, so a reload returns to the number step. +- Wrong codes are counted in the flow store; the third blocks the number for the server's block time (`use-code-step.ts`, event handlers only). diff --git a/docs/pages/market/auth-login.md b/docs/pages/market/auth-login.md new file mode 100644 index 0000000..8ac2b18 --- /dev/null +++ b/docs/pages/market/auth-login.md @@ -0,0 +1,34 @@ +# Login + +`/auth/login` · `apps/{bull,bear}/src/app/(auth)/auth/login/(number)/page.tsx` · Type: login · Layout: [layout.md](layout.md) + +| Field | Value | +| ----------- | ---------------------------------------------------------------------------------------------------------------------------- | +| Robots | `noindex` (page `metadata`) | +| Status | `200` for every visitor; a signed-in visitor is sent on in the browser by `GuestGuard`, never by the server | +| loading.tsx | `apps/{bull,bear}/src/app/(auth)/auth/login/(number)/loading.tsx`: the same frame and a `delayed` form skeleton | +| First flush | `none` | +| Canonical | none set | +| H1 | `auth:login.title`, or `auth:login.subscribe.title` when the visitor came from «اشتراک»; inside `LoginStep`, so browser only | +| JSON-LD | `none` | +| Scripts | none beyond the layout's | + +## Sections + +In bull's document order. + +| Section | Data | HTML | JS | Index | Notes | +| -------------------------- | ------ | ----------- | ------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| AuthTopBar (bull) | config | first flush | none | no | back button, no title; sticky, with the connection bar in its box | +| ↳ BackButton (bull) | URL | first flush | hydrate | no | ``, or straight to `?redirect=` (`leavesFlow`, J01-1e) | +| AuthTemplate header (bear) | config | first flush | none | no | brand ``; the step sits in the 560 card below | +| SupportEntry | — | first flush | hydrate | no | headset icon in the bar; bull: bottom sheet; bear: popover | +| ↳ SupportDialog | config | none | hydrate | no | island `Dialog` mounts its content only while open | +| NetworkBar | — | none | hydrate | no | under the bar, only while offline or reconnecting | +| LoginStep | viewer | skeleton | hydrate | no | `GuestGuard` shows `SkeletonPreset preset="form"` until the viewer is known; guest: H1, phone form, register link, support; member: replaced to `?redirect=`, home, or step 5 when `needsProfile` | + +## Notes + +- Decision 0013 overrides the skill's login map (H1 and phone form in the first flush): every `(auth)` step renders only in the browser behind `GuestGuard`, and flow state stays in memory. +- The `(auth)` layout renders nothing; it only sets `dynamic = 'force-dynamic'`. `(auth)/error.tsx` shows `PageError` with `standalone`. +- bull: `size="lg"`, support at the bottom; bear: `size="md"`, support as a popover. diff --git a/docs/pages/market/auth-register-details.md b/docs/pages/market/auth-register-details.md new file mode 100644 index 0000000..07a258d --- /dev/null +++ b/docs/pages/market/auth-register-details.md @@ -0,0 +1,37 @@ +# Register: details + +`/auth/register/details` · `apps/{bull,bear}/src/app/(auth)/auth/register/details/page.tsx` · Type: login · Layout: [layout.md](layout.md) + +| Field | Value | +| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Robots | `noindex` (page `metadata`) | +| Status | `200`; without a role, number, or registration token in the auth-flow store (a reload), the step sends the visitor to `/auth/register/phone` in the browser | +| loading.tsx | `apps/{bull,bear}/src/app/(auth)/auth/register/details/loading.tsx` | +| First flush | `none`; the rules text comes from server i18n, not a read | +| Canonical | none set | +| H1 | the investor details or creator identity heading; browser only | +| JSON-LD | `none` | +| Scripts | none beyond the layout's | + +## Sections + +In bull's document order. + +| Section | Data | HTML | JS | Index | Notes | +| -------------------------- | ------ | ----------- | ------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| AuthTopBar (bull) | config | first flush | none | no | back button and `auth:register.header` | +| ↳ BackButton (bull) | URL | first flush | hydrate | no | ``, keeping `?redirect=` | +| AuthTemplate header (bear) | config | first flush | none | no | brand `` | +| StepBack (bear) | URL | first flush | hydrate | no | «بازگشت» above the card to `/` | +| SupportEntry | — | first flush | hydrate | no | in the bar; the dialog mounts only when open | +| NetworkBar | — | none | hydrate | no | under the bar, only while offline or reconnecting | +| RegisterDetailsStep | viewer | skeleton | hydrate | no | `GuestGuard` fallback `SkeletonPreset preset="form" count={3}`; investor: `InvestorDetailsForm`; creator: `CreatorIdentityForm`, both in `DetailsFrame` | +| ↳ ExpiryWarning | clock | none | hydrate | no | two minutes before the token ends; `Countdown kind="otp"` and «تمدید زمان» | +| ↳ ExpiryHalt | viewer | none | hydrate | no | when the token ends; bull: sheet; bear: modal | +| ↳ LeaveRegistrationDialog | — | none | hydrate | no | back asks whether to leave and resume later (J02-3f) | +| ↳ RulesSheet | config | none | hydrate | no | «قوانین لومینا» in `TermsLine`; `GeneralRules` rendered on the server and passed as `rules`; bull: sheet; bear: modal; mounts when opened | + +## Notes + +- Decision 0013: the step renders only in the browser on the 15-minute token, held in memory. +- `GeneralRules` is a Server Component passed into the client step, so its text is in the RSC payload of every response, though it reaches the DOM only when the sheet opens. diff --git a/docs/pages/market/auth-register-phone.md b/docs/pages/market/auth-register-phone.md new file mode 100644 index 0000000..f351635 --- /dev/null +++ b/docs/pages/market/auth-register-phone.md @@ -0,0 +1,32 @@ +# Register: phone number + +`/auth/register/phone` · `apps/{bull,bear}/src/app/(auth)/auth/register/phone/page.tsx` · Type: login · Layout: [layout.md](layout.md) + +| Field | Value | +| ----------- | -------------------------------------------------------------------------------------- | +| Robots | `noindex` (page `metadata`) | +| Status | `200` for every visitor; a signed-in visitor is sent on in the browser by `GuestGuard` | +| loading.tsx | `apps/{bull,bear}/src/app/(auth)/auth/register/phone/loading.tsx` | +| First flush | `none` | +| Canonical | none set | +| H1 | the phone step's heading in `RegisterPhoneStep`; browser only | +| JSON-LD | `none` | +| Scripts | none beyond the layout's | + +## Sections + +In bull's document order. + +| Section | Data | HTML | JS | Index | Notes | +| -------------------------- | ------ | ----------- | ------- | ----- | -------------------------------------------------------------------------------------------------------- | +| AuthTopBar (bull) | config | first flush | none | no | back button and `auth:register.header` | +| ↳ BackButton (bull) | URL | first flush | hydrate | no | `` to `/auth/register`, keeping `?redirect=` | +| AuthTemplate header (bear) | config | first flush | none | no | brand `` | +| StepBack (bear) | URL | first flush | hydrate | no | «بازگشت» above the card to `/auth/register` | +| SupportEntry | — | first flush | hydrate | no | in the bar; the dialog mounts only when open | +| NetworkBar | — | none | hydrate | no | under the bar, only while offline or reconnecting | +| RegisterPhoneStep | viewer | skeleton | hydrate | no | `GuestGuard` fallback `SkeletonPreset preset="form" count={1}`; guest: progress, H1, phone form, support | + +## Notes + +- Decision 0013: the step renders only in the browser; the number stays in the auth-flow store. diff --git a/docs/pages/market/auth-register-verify.md b/docs/pages/market/auth-register-verify.md new file mode 100644 index 0000000..bd6d7e5 --- /dev/null +++ b/docs/pages/market/auth-register-verify.md @@ -0,0 +1,33 @@ +# Register: code + +`/auth/register/verify` · `apps/{bull,bear}/src/app/(auth)/auth/register/verify/page.tsx` · Type: login · Layout: [layout.md](layout.md) + +| Field | Value | +| ----------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| Robots | `noindex` (page `metadata`) | +| Status | `200`; without a number in the auth-flow store (a reload), the step sends the visitor back to `/auth/register/phone` in the browser | +| loading.tsx | `apps/{bull,bear}/src/app/(auth)/auth/register/verify/loading.tsx` | +| First flush | `none` | +| Canonical | none set | +| H1 | `CodeStep`'s heading; browser only | +| JSON-LD | `none` | +| Scripts | none beyond the layout's | + +## Sections + +In bull's document order. + +| Section | Data | HTML | JS | Index | Notes | +| -------------------------- | ------ | ----------- | ------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| AuthTopBar (bull) | config | first flush | none | no | back button and `auth:register.header` | +| ↳ BackButton (bull) | URL | first flush | hydrate | no | `` to `/auth/register/phone`, keeping `?redirect=` | +| AuthTemplate header (bear) | config | first flush | none | no | brand `` | +| StepBack (bear) | URL | first flush | hydrate | no | «بازگشت» above the card to `/auth/register/phone` | +| SupportEntry | — | first flush | hydrate | no | in the bar; the dialog mounts only when open | +| NetworkBar | — | none | hydrate | no | under the bar, only while offline or reconnecting | +| RegisterVerifyStep | viewer | skeleton | hydrate | no | `GuestGuard` fallback `SkeletonPreset preset="form" count={1}`; guest with a number: `RegisterProgress`, the shared `CodeStep`, «تأیید و ادامه» | +| ↳ ResendCode wait | clock | skeleton | hydrate | no | island `ResendCode` with `endsAt` from the flow store | + +## Notes + +- Decision 0013: the step renders only in the browser. A verified code opens step 4 on the 15-minute registration token, held in memory. diff --git a/docs/pages/market/auth-register.md b/docs/pages/market/auth-register.md new file mode 100644 index 0000000..0837f6b --- /dev/null +++ b/docs/pages/market/auth-register.md @@ -0,0 +1,32 @@ +# Register: account type + +`/auth/register` · `apps/{bull,bear}/src/app/(auth)/auth/register/(type)/page.tsx` · Type: login · Layout: [layout.md](layout.md) + +| Field | Value | +| ----------- | -------------------------------------------------------------------------------------- | +| Robots | `noindex` (page `metadata`) | +| Status | `200` for every visitor; a signed-in visitor is sent on in the browser by `GuestGuard` | +| loading.tsx | `apps/{bull,bear}/src/app/(auth)/auth/register/(type)/loading.tsx` | +| First flush | `none` | +| Canonical | none set; `?role=` preselects a card | +| H1 | `auth:register.type.title`; browser only | +| JSON-LD | `none` | +| Scripts | none beyond the layout's | + +## Sections + +In bull's document order. + +| Section | Data | HTML | JS | Index | Notes | +| -------------------------- | ------ | ----------- | ------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| AuthTopBar (bull) | config | first flush | none | no | back button, no title | +| ↳ BackButton (bull) | URL | first flush | hydrate | no | `` to `/auth/login`, keeping `?redirect=` | +| AuthTemplate header (bear) | config | first flush | none | no | brand `` | +| SupportEntry | — | first flush | hydrate | no | in the bar; the dialog mounts only when open | +| NetworkBar | — | none | hydrate | no | under the bar, only while offline or reconnecting | +| RegisterTypeStep | viewer | skeleton | hydrate | no | `GuestGuard` fallback `SkeletonPreset preset="form" count={2}`; guest: `RegisterProgress`, H1, two `ChoiceCard`s (investor, creator) in a fieldset, the note that the type can't change, «ادامه» | + +## Notes + +- Decision 0013: the step renders only in the browser; the chosen role goes to the auth-flow store, never the URL. +- bull: `size="lg"`, support at the bottom; bear: `size="md"`, support as a popover. diff --git a/docs/pages/market/channels-username-posts-id.md b/docs/pages/market/channels-username-posts-id.md new file mode 100644 index 0000000..127998b --- /dev/null +++ b/docs/pages/market/channels-username-posts-id.md @@ -0,0 +1,40 @@ +# Post + +`/channels/[username]/posts/[id]` · `apps/{bull,bear}/src/app/(main)/channels/[username]/posts/[id]/page.tsx` · Type: blog article · Layout: [layout-main.md](layout-main.md), [layout.md](layout.md) + +| Field | Value | +| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Robots | `index; noindex when` the post is missing, belongs to another channel, or the channel is suspended (`generateMetadata`) | +| Status | `200`; `308` when the username segment isn't the stored spelling (`ROUTES.post`), and from `/@username/…` (0064); `200` with `not-found.tsx` when the username is invalid or the channel is missing, because `loading.tsx` wraps the page; `200` with `noindex` and `PostMissing` when the post is missing (debt) | +| loading.tsx | `apps/{bull,bear}/src/app/(main)/channels/[username]/posts/[id]/loading.tsx` (debt, Notes) | +| First flush | `getChannel(username)` and `getPost(id)` in one `Promise.all` through `readOnServer`, which the page entry and `generateMetadata` await (0055) | +| Canonical | `/channels/username/posts/id`, from `postMetadata`; drops `?preview=` | +| H1 | none (debt) | +| JSON-LD | none (debt, Notes) | +| Scripts | none | + +## Sections + +In bull's document order. + +| Section | Data | HTML | JS | Index | Notes | +| -------------------- | ---------------------- | ----------- | ----------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| MobileTopBar (bull) | viewer | skeleton | hydrate | no | back to the channel (`parentHref`, `backToPrevious`, 0057); the title waits for the viewer | +| DeskBack (bear) | — | first flush | hydrate | no | «بازگشت» to the channel | +| PostChannelBar | `getChannel(username)` | first flush | none | primary | `` to the channel: avatar, name, `@username` | +| ↳ ChannelActions | viewer | skeleton | hydrate | no | follow and subscribe; own `PartBoundary` | +| PostView | `getPost(id)` | first flush | hydrate | primary | a free post's caption and images; a premium post's `captionPreview` and media count only; re-read in the browser for the creator or a subscriber (0021) | +| ↳ Locked post gate | viewer | skeleton | hydrate | no | guest: login back here; investor: checkout | +| ↳ PreviewBanner | viewer | none | hydrate | no | the creator's `?preview=` of their own premium post | +| ↳ PostLightbox | — | none | interaction | no | `next/dynamic`, mounted on the first image tap | +| ↳ Access-ended toast | viewer | none | hydrate | no | the info toast when access ends mid-read (0050) | +| PostMissing | `getChannel(username)` | first flush | hydrate | no | instead of `PostView` when the post is missing; a link back to the channel | +| ChannelUnavailable | `getChannel(username)` | first flush | hydrate | no | replaces the bar and post when the channel is suspended | + +## Notes + +- bull: under `MobileTopBar`, a padded column; bear: the 640px column under «بازگشت». Both hold the same primary rows. +- Debt: `loading.tsx` wraps an indexable entity page: a missing channel answers 200, and past 12,800 bytes the post follows the skeleton. Delete it. +- Debt: a missing post answers 200 with `PostMissing` (`PostTemplate.tsx:67`), a soft 404. Call `notFound()` in the page entry and move `PostMissing` into a route `not-found.tsx`. +- Debt: no H1. Make the post's first line, the text `postMetadata` titles it with, the H1 in both apps. +- Debt: no JSON-LD; an article-type page gets `BreadcrumbList`. The repo has no json-ld lib yet. diff --git a/docs/pages/market/channels-username.md b/docs/pages/market/channels-username.md new file mode 100644 index 0000000..944223b --- /dev/null +++ b/docs/pages/market/channels-username.md @@ -0,0 +1,45 @@ +# Channel + +`/channels/[username]` · `apps/{bull,bear}/src/app/(main)/channels/[username]/page.tsx` · Type: seller · Layout: [layout-main.md](layout-main.md), [layout.md](layout.md) + +| Field | Value | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Robots | `index; noindex when` the username is invalid, the channel is missing, or it is suspended (`generateMetadata`; `not-found.tsx` `metadata`) | +| Status | `200`; `308` when the segment isn't the stored spelling (`toChannelUsername`), keeping the query for `?code=` (0059), and from `/@username/…` (`next.config.ts` redirect, 0064); `200` with `not-found.tsx` and `noindex` when invalid or missing, because `loading.tsx` wraps the page (debt); `200` with `noindex` and `ChannelUnavailable` when suspended | +| loading.tsx | `apps/{bull,bear}/src/app/(main)/channels/[username]/loading.tsx` (debt, Notes) | +| First flush | `getChannel(username)` through `readOnServer`, which the page entry and `generateMetadata` await (0055) | +| Canonical | `/channels/username`, from `channelMetadata`; drops `?code=` and every other parameter | +| H1 | the display name, in `ChannelHeader` | +| JSON-LD | none (debt, Notes) | +| Scripts | none | + +## Sections + +In bull's document order. + +| Section | Data | HTML | JS | Index | Notes | +| -------------------------- | ------------------------------- | ----------- | ----------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| MobileTopBar (bull) | viewer | skeleton | hydrate | no | `tabOwnerId`: back and title wait for the viewer; the creator on their own channel gets the tab bar | +| ChannelDeskBack (bear) | viewer | first flush | hydrate | no | «بازگشت»; removed for the owner | +| ApprovedWelcome | viewer | none | hydrate | no | once, on the creator's first visit after approval; bull: sheet; bear: modal | +| ChannelHeader, with the H1 | `getChannel(username)` | first flush | none | primary | avatar, name, `@username`, bio, markets, social links; bear: in a card | +| ↳ ChannelShare | — | first flush | hydrate | no | the owner's share sheet opens on click | +| ↳ ChannelCounts | `getChannel(username)`, query | first flush | hydrate | no | follower count from the server read as `initialData`, kept live (0045); the owner's «مشترک فعال» is browser-only | +| ↳ ChannelActions | viewer | skeleton | hydrate | no | guest prompt, follow, subscribe, sale and invite notes; own `PartBoundary` | +| FollowNotice | viewer | none | hydrate | no | after the first follow | +| ChannelStats | `getPredictionStats(creatorId)` | streamed | none | secondary | own `` and `PartBoundary`; `CreatorStats`, empty when the record isn't public | +| ChannelFeed | `getCreatorPosts(creatorId)` | streamed | hydrate | primary | own `` and `PartBoundary`; an `` per post, the only links to post pages; re-read in the browser for the creator or a subscriber (0021) | +| ↳ Locked post gate | viewer | skeleton | hydrate | no | guest: login back here; investor: checkout | +| ↳ Load more | query | none | hydrate | no | a `