Compare commits

...

2 Commits

Author SHA1 Message Date
Amiram_se 2a1b657a77 feat: render every page except the landing in the browser
- Channel, post, checkout and analysts read their data in the browser; the
  server reads no back-end data outside the landing (0070).
- Only the landing is indexable; every other page is noindex, the rules
  pages through the terms layout (0071).
- Remove the landing's loading.tsx so all of it renders in the first flush.
- Remove the server caches and metadata helpers nothing uses any more.
- Update the page rendering docs; 0021, 0045 and 0055 are superseded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 15:40:47 +04:00
Amiram_se 3e908ab0b7 feat: render patterns 2026-10-21 13:16:11 +04:00
166 changed files with 3037 additions and 1004 deletions

View File

@ -1,8 +1,7 @@
import { ROUTES, withSearchParams } from '@lumina/market/app/navigation';
import { getChannel, readOnServer } from '@lumina/market/server';
import { toChannelUsername } from '@lumina/market/shared/utils';
import type { Metadata } from 'next';
import { notFound, permanentRedirect, redirect } from 'next/navigation';
import { notFound, permanentRedirect } from 'next/navigation';
import { i18n } from '../../../../i18n';
import { CheckoutTemplate } from './templates/checkout-template';
@ -18,10 +17,10 @@ export const metadata: Metadata = {
};
/**
* Checkout for a creator's channel (U9), reached only from its «اشتراک». The server renders the
* same page for everyone: the bar and who is being paid; the investor's own checkout loads in the
* browser. Another spelling of the username redirects to the stored one; a suspended channel
* sends the visitor to the channel, which says it is unavailable.
* Checkout for a creator's channel (U9), reached only from its «اشتراک». It renders in the
* browser only (0070): the server reads nothing and sends the bar and the skeleton. Another
* spelling of the username redirects to the stored one; a suspended channel sends the visitor to
* the channel, which says it is unavailable.
*/
export default async function CheckoutPage({
params,
@ -36,9 +35,6 @@ export default async function CheckoutPage({
withSearchParams(ROUTES.checkout(username), await searchParams),
);
}
const channel = await readOnServer(() => getChannel(username));
if (channel.status !== 'ok') notFound();
if (channel.data.suspended) redirect(ROUTES.channel(username));
return <CheckoutTemplate channel={channel.data} />;
return <CheckoutTemplate username={username} />;
}

View File

@ -1,22 +1,66 @@
'use client';
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { PartBoundary } from '@lumina/market/app/error-boundaries';
import {
PartBoundary,
StatusEmptyState,
} from '@lumina/market/app/error-boundaries';
import {
DesktopHeader,
DesktopPageTitle,
ROUTES,
} from '@lumina/market/app/navigation';
import { CheckoutCreator } from '@lumina/market/app/screens/(flow)/checkout/[username]/organisms/checkout-creator';
import { CheckoutPanel } from '@lumina/market/app/screens/(flow)/checkout/[username]/organisms/checkout-panel';
import {
CheckoutCreator,
CheckoutCreatorSkeleton,
} from '@lumina/market/app/screens/(flow)/checkout/[username]/organisms/checkout-creator';
import {
CheckoutPanel,
CheckoutSkeleton,
} from '@lumina/market/app/screens/(flow)/checkout/[username]/organisms/checkout-panel';
import { useCheckoutChannel } from '@lumina/market/features/checkout';
import type { ReactNode } from 'react';
import { useTranslation } from 'react-i18next';
import { i18n } from '../../../../../../i18n';
import type { CheckoutTemplateProps } from './types';
/**
* Checkout on desktop (U9 ۹.۱): one centred column of 480 under the header, back beside the
* title, and the pay block stuck to the bottom of the window while the tiers scroll.
* title, and the pay block stuck to the bottom of the window while the tiers scroll. It renders
* in the browser only (0070): the header, the title and the skeleton stay until the channel
* arrives.
*/
export function CheckoutTemplate({ channel }: CheckoutTemplateProps) {
const t = i18n.getFixedT(null, 'payment');
export function CheckoutTemplate({ username }: CheckoutTemplateProps) {
const { t } = useTranslation('payment');
const page = useCheckoutChannel(username);
const channelHref = ROUTES.channel(username);
let content: ReactNode;
if (page.status === 'pending') {
content = (
<CheckoutSkeleton
layout="desktop"
creator={<CheckoutCreatorSkeleton />}
label={t('checkout.loading')}
/>
);
} else if (page.status === 'not-found') {
content = <StatusEmptyState variant="not-found" size="page" />;
} else {
const { channel } = page;
content = (
<PartBoundary name="checkout" description={t('checkout.error')} framed>
<CheckoutPanel
creatorId={channel.creatorId}
channelHref={channelHref}
layout="desktop"
creator={<CheckoutCreator creator={channel} />}
creatorName={channel.displayName ?? channel.username}
creatorLinks={channel.socialLinks}
/>
</PartBoundary>
);
}
return (
<FlexBox direction="flex-col" className="min-h-dvh bg-bg-page">
@ -33,22 +77,9 @@ export function CheckoutTemplate({ channel }: CheckoutTemplateProps) {
>
<DesktopPageTitle
title={t('checkout.title')}
parentHref={ROUTES.channel(channel.username)}
parentHref={channelHref}
/>
<PartBoundary
name="checkout"
description={t('checkout.error')}
framed
>
<CheckoutPanel
creatorId={channel.creatorId}
channelHref={ROUTES.channel(channel.username)}
layout="desktop"
creator={<CheckoutCreator creator={channel} />}
creatorName={channel.displayName ?? channel.username}
creatorLinks={channel.socialLinks}
/>
</PartBoundary>
{content}
</FlexBox>
</FlexBox>
</FlexBox>

View File

@ -1,3 +1,4 @@
import type { PublicCreatorPayload } from '@lumina/market/features/channel';
export type CheckoutTemplateProps = { channel: PublicCreatorPayload };
export type CheckoutTemplateProps = {
/** The channel's username as the API stores it (lower case). */
username: string;
};

View File

@ -10,9 +10,11 @@ import type { ReactNode } from 'react';
import { i18n } from '../../../i18n';
// Only the landing is indexed (0071); both tabs inherit this.
export const metadata: Metadata = {
title: i18n.t('rules:meta-title'),
description: i18n.t('rules:meta-description'),
robots: { index: false },
};
/**

View File

@ -1,36 +0,0 @@
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { GridBox } from '@lumina/island/atoms/grid-box';
import { Skeleton, SkeletonRegion } from '@lumina/island/atoms/skeleton';
import { i18n } from '../../i18n';
/** The landing before it arrives: the header's height, then the hero's copy beside its picture. */
export default function Loading() {
return (
<SkeletonRegion
label={i18n.t('landing:loading')}
delayed
className="min-h-dvh bg-surface"
>
<FlexBox
alignItems="items-center"
className="h-16 border-b border-border-subtle px-8"
>
<Skeleton width="5rem" height="1.25rem" />
</FlexBox>
<GridBox
cols="grid-cols-2"
gap="gap-16"
alignItems="items-center"
className="mx-auto max-w-page px-8 py-14"
>
<FlexBox direction="flex-col" gap="gap-4">
<Skeleton height="3rem" width="90%" />
<Skeleton lines={3} height="1rem" />
<Skeleton shape="pill" width="12rem" height="3.25rem" />
</FlexBox>
<Skeleton shape="rect" width="100%" height="36rem" />
</GridBox>
</SkeletonRegion>
);
}

View File

@ -1,5 +1,4 @@
import { AnalystsDirectory } from '@lumina/market/app/screens/(main)/analysts/organisms/analysts-directory';
import { getFeaturedCreators, readOnServer } from '@lumina/market/server';
import type { Metadata } from 'next';
import { i18n } from '../../../i18n';
@ -11,20 +10,15 @@ export const metadata: Metadata = {
};
/**
* «تحلیلگران منتخب», `/analysts` (J04-3): every featured analyst, read on the server, the same for
* every visitor; follow (an investor) and the free registration card (a guest) join in the
* browser. Signed-in visitors are not sent anywhere. A failed read is the page's error state with
* its retry, never a partial list.
* «تحلیلگران منتخب», `/analysts` (J04-3): every featured analyst, read in the browser only
* (0070), the same for every visitor; follow (an investor) and the free registration card (a
* guest) join once the viewer is known. Signed-in visitors are not sent anywhere. A failed read
* is the page's error state with its retry, never a partial list.
*/
export default async function AnalystsPage() {
const featured = await readOnServer(() => getFeaturedCreators());
export default function AnalystsPage() {
return (
<AnalystsTemplate>
<AnalystsDirectory
analysts={featured.status === 'ok' ? featured.data : []}
layout="desktop"
/>
<AnalystsDirectory layout="desktop" />
</AnalystsTemplate>
);
}

View File

@ -1,16 +1,13 @@
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { Card } from '@lumina/island/molecules/card';
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
import { DeskBack } from '@lumina/market/app/navigation';
import { i18n } from '../../../../i18n';
import { ChannelSkeleton } from './templates/channel-template';
/**
* The channel before it arrives, in the 640 column and its reading order: «بازگشت», the header
* panel, the track record, then a post.
* The channel before it arrives, in the 640 column under «بازگشت»: the header panel, the track
* record, then a post. The page shows the same skeleton until its read arrives.
*/
export default function Loading() {
const t = i18n.getFixedT(null, 'channel');
return (
<FlexBox tag="main" justifyContent="justify-center" className="px-8 py-10">
<FlexBox
@ -19,11 +16,7 @@ export default function Loading() {
className="w-full max-w-content"
>
<DeskBack />
<Card padding="lg">
<SkeletonPreset preset="header" framed delayed label={t('loading')} />
</Card>
<SkeletonPreset preset="stats" delayed label={t('stats.loading')} />
<SkeletonPreset preset="post-media" delayed label={t('feed.loading')} />
<ChannelSkeleton delayed />
</FlexBox>
</FlexBox>
);

View File

@ -1,18 +1,11 @@
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { ChannelNotFound } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-not-found';
import type { Metadata } from 'next';
import { displayUrl } from '../../../../configs';
import { ChannelMissing } from './templates/channel-template';
export const metadata: Metadata = { robots: { index: false } };
/** No channel at this address, or not any more. */
/** An address that can't be a username; the page shows the same state for an unknown one. */
export default function ChannelNotFoundPage() {
return (
<FlexBox tag="main" justifyContent="justify-center" className="px-8 py-10">
<FlexBox direction="flex-col" className="w-full max-w-content">
<ChannelNotFound layout="desktop" siteHost={displayUrl('')} />
</FlexBox>
</FlexBox>
);
return <ChannelMissing siteHost={displayUrl('')} />;
}

View File

@ -1,10 +1,4 @@
import { ROUTES, withSearchParams } from '@lumina/market/app/navigation';
import {
channelMetadata,
getChannel,
getRequestTime,
readOnServer,
} from '@lumina/market/server';
import { toChannelUsername } from '@lumina/market/shared/utils';
import type { Metadata } from 'next';
import { notFound, permanentRedirect } from 'next/navigation';
@ -18,33 +12,26 @@ type ChannelPageProps = {
searchParams: Promise<Record<string, string | string[] | undefined>>;
};
// The one kind of route whose metadata names its data (0055): it reads through the same per-request
// cache as the page, so the first byte, held for the metadata in <head> (0054), waits for that
// one read.
// From the address alone (0070): the server reads nothing for this page.
export async function generateMetadata({
params,
}: ChannelPageProps): Promise<Metadata> {
const username = toChannelUsername((await params).username);
if (!username) return { robots: { index: false } };
const channel = await readOnServer(() => getChannel(username));
if (channel.status !== 'ok') return { robots: { index: false } };
if (channel.data.suspended) {
return {
title: i18n.t('channel:meta.unavailable-title'),
robots: { index: false },
};
}
return channelMetadata({
channel: channel.data,
title: i18n.t('channel:meta.title', { username }),
description: i18n.t('channel:meta.description', { username }),
});
return {
title: username
? i18n.t('channel:meta.title', { username })
: i18n.t('channel:meta.unavailable-title'),
description: username
? i18n.t('channel:meta.description', { username })
: undefined,
robots: { index: false },
};
}
/**
* A creator's channel, `/channels/username`. The same server render for every visitor: the
* header, the track record and the first posts; subscribe, follow and the locked posts' gates
* load in the browser. Any other spelling of the username redirects to the one the API stores.
* A creator's channel, `/channels/username`. It renders in the browser only (0070), the same for
* every visitor: the server reads nothing and sends the skeleton. Any other spelling of the
* username redirects to the stored one, keeping an invite link's `?code=` (0059).
*/
export default async function ChannelPage({
params,
@ -53,20 +40,17 @@ export default async function ChannelPage({
const segment = (await params).username;
const username = toChannelUsername(segment);
if (!username) notFound();
// An invite link's `?code=` goes along (0059).
if (username !== segment) {
permanentRedirect(
withSearchParams(ROUTES.channel(username), await searchParams),
);
}
const channel = await readOnServer(() => getChannel(username));
if (channel.status !== 'ok') notFound();
return (
<ChannelTemplate
channel={channel.data}
username={username}
channelUrl={displayUrl(ROUTES.channel(username))}
now={getRequestTime()}
siteHost={displayUrl('')}
/>
);
}

View File

@ -1,18 +1,13 @@
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { Skeleton, SkeletonRegion } from '@lumina/island/atoms/skeleton';
import { Card } from '@lumina/island/molecules/card';
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
import { DeskBack } from '@lumina/market/app/navigation';
import { i18n } from '../../../../../../i18n';
import { PostSkeleton } from './templates/post-template';
/**
* The post before it arrives, in the 640 column (C4b ۱.۵): «بازگشت», the channel bar's panel
* with the author row and the subscribe and follow row, then the post with its media. No lock is
* guessed meanwhile.
* The post before it arrives, in the 640 column under «بازگشت»: the creator's panel, then the
* post with its media. The page shows the same skeleton until its reads arrive.
*/
export default function Loading() {
const t = i18n.getFixedT(null, 'channel');
return (
<FlexBox tag="main" justifyContent="justify-center" className="px-8 py-10">
<FlexBox
@ -21,23 +16,7 @@ export default function Loading() {
className="w-full max-w-content"
>
<DeskBack />
<Card padding="lg">
<SkeletonRegion delayed label={t('loading')}>
<FlexBox
alignItems="items-center"
gap="gap-3"
className="min-h-touch-target"
>
<Skeleton shape="circle" className="size-10" />
<Skeleton className="h-4 w-32" />
</FlexBox>
<FlexBox gap="gap-2">
<Skeleton shape="pill" className="h-control-md flex-1" />
<Skeleton shape="pill" className="h-control-md w-32" />
</FlexBox>
</SkeletonRegion>
</Card>
<SkeletonPreset preset="post-media" delayed label={t('post.loading')} />
<PostSkeleton delayed />
</FlexBox>
</FlexBox>
);

View File

@ -1,12 +1,5 @@
import { ROUTES } from '@lumina/market/app/navigation';
import { POST_ID_PATTERN } from '@lumina/market/features/post';
import {
getChannel,
getRequestTime,
getPost,
postMetadata,
readOnServer,
} from '@lumina/market/server';
import { toChannelUsername } from '@lumina/market/shared/utils';
import type { Metadata } from 'next';
import { notFound, permanentRedirect } from 'next/navigation';
@ -17,65 +10,37 @@ import { PostTemplate } from './templates/post-template';
type PostPageProps = { params: Promise<{ username: string; id: string }> };
/** The channel and the post, read together; a post that isn't this channel's is missing. */
async function readPostPage(username: string, id: string) {
const [channel, post] = await Promise.all([
readOnServer(() => getChannel(username)),
POST_ID_PATTERN.test(id)
? readOnServer(() => getPost(id))
: ({ status: 'not-found' } as const),
]);
if (channel.status !== 'ok') return null;
const found =
post.status === 'ok' && post.data.creatorId === channel.data.creatorId
? post.data
: null;
return { channel: channel.data, post: found };
}
// The one kind of route whose metadata names its data (0055): it reads through the same per-request
// cache as the page, so the first byte, held for the metadata in <head> (0054), waits for that
// one read.
// From the address alone (0070): the server reads nothing for this page.
export async function generateMetadata({
params,
}: PostPageProps): Promise<Metadata> {
const { username: segment, id } = await params;
const username = toChannelUsername(segment);
const page = username ? await readPostPage(username, id) : null;
if (!page?.post || page.channel.suspended) {
return {
title: i18n.t('channel:meta.post-missing-title'),
robots: { index: false },
};
}
return postMetadata({
channel: page.channel,
post: page.post,
fallbackTitle: i18n.t('channel:meta.post-title', {
username: page.channel.username,
}),
});
const username = toChannelUsername((await params).username);
return {
title: username
? i18n.t('channel:meta.post-title', { username })
: i18n.t('channel:meta.post-missing-title'),
robots: { index: false },
};
}
/**
* One post, `/channels/username/posts/[id]`: where every shared link lands. The server renders it
* as every visitor sees it; a subscriber's or the creator's premium post opens in the browser. A
* deleted or unknown post keeps the channel's frame and leads back to the channel.
* One post, `/channels/username/posts/[id]`: where every shared link lands. It renders in the
* browser only (0070): the server reads nothing and sends the skeleton; a subscriber's or the
* creator's premium post arrives open. A deleted or unknown post keeps the channel's frame and
* leads back to the channel, as does an id that can't be a post's.
*/
export default async function PostPage({ params }: PostPageProps) {
const { username: segment, id } = await params;
const username = toChannelUsername(segment);
if (!username) notFound();
if (username !== segment) permanentRedirect(ROUTES.post(username, id));
const page = await readPostPage(username, id);
if (!page) notFound();
return (
<PostTemplate
channel={page.channel}
post={page.post}
username={username}
postId={POST_ID_PATTERN.test(id) ? id : null}
channelUrl={displayUrl(ROUTES.channel(username))}
now={getRequestTime()}
siteHost={displayUrl('')}
/>
);
}

View File

@ -0,0 +1,43 @@
'use client';
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { Skeleton, SkeletonRegion } from '@lumina/island/atoms/skeleton';
import { Card } from '@lumina/island/molecules/card';
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
import { useTranslation } from 'react-i18next';
import type { PostSkeletonProps } from './types';
/**
* The post before it arrives, in the 640 column under «بازگشت»: the creator's panel with its
* author row and the subscribe and follow row, then the post with its media. No lock is guessed
* meanwhile. The route's loading and the page's own wait share it.
*/
export function PostSkeleton({ delayed }: PostSkeletonProps) {
const { t } = useTranslation('channel');
return (
<>
<Card padding="lg">
<SkeletonRegion delayed={delayed} label={t('loading')}>
<FlexBox
alignItems="items-center"
gap="gap-3"
className="min-h-touch-target"
>
<Skeleton shape="circle" className="size-10" />
<Skeleton className="h-4 w-32" />
</FlexBox>
<FlexBox gap="gap-2">
<Skeleton shape="pill" className="h-control-md flex-1" />
<Skeleton shape="pill" className="h-control-md w-32" />
</FlexBox>
</SkeletonRegion>
</Card>
<SkeletonPreset
preset="post-media"
delayed={delayed}
label={t('post.loading')}
/>
</>
);
}

View File

@ -1,3 +1,5 @@
'use client';
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { PartBoundary } from '@lumina/market/app/error-boundaries';
import { DeskBack, ROUTES } from '@lumina/market/app/navigation';
@ -6,21 +8,70 @@ import { ChannelUnavailable } from '@lumina/market/app/screens/(main)/channels/[
import { PostChannelBar } from '@lumina/market/app/screens/(main)/channels/[username]/posts/[id]/organisms/post-channel-bar';
import { PostMissing } from '@lumina/market/app/screens/(main)/channels/[username]/posts/[id]/organisms/post-missing';
import { PostView } from '@lumina/market/app/screens/(main)/channels/[username]/posts/[id]/organisms/post-view';
import { usePostPage } from '@lumina/market/features/post';
import type { ReactNode } from 'react';
import { useTranslation } from 'react-i18next';
import { i18n } from '../../../../../../../../i18n';
import { ChannelMissing } from '../../../../templates/channel-template';
import { PostSkeleton } from './PostSkeleton';
import type { PostTemplateProps } from './types';
/**
* The post on desktop, in the 640 column under «بازگشت»: the creator with subscribe and follow,
* then the post in full. The action area loads in the browser.
* The post on desktop: one 640px column under «بازگشت», the creator's panel with subscribe and
* follow, then the post in full. It renders in the browser only (0070): the server sends the
* column and the skeleton, which stay until the channel and the post arrive. The action area
* waits for the viewer.
*/
export function PostTemplate({
channel,
post,
username,
postId,
channelUrl,
now,
siteHost,
}: PostTemplateProps) {
const t = i18n.getFixedT(null, 'channel');
const { t } = useTranslation('channel');
const page = usePostPage(username, postId);
if (page.status === 'not-found')
return <ChannelMissing siteHost={siteHost} />;
let content: ReactNode;
if (page.status === 'pending') {
content = <PostSkeleton />;
} else if (page.channel.suspended) {
content = <ChannelUnavailable context="post" />;
} else if (page.status === 'ok') {
const { channel, post, now } = page;
content = (
<>
<PostChannelBar
channel={channel}
layout="desktop"
verifiedLabel={t('header.verified')}
actions={
<PartBoundary name="post-channel-actions">
<ChannelActions
creatorId={channel.creatorId}
username={channel.username}
channelUrl={channelUrl}
layout="desktop"
saleOpen={channel.saleOpen}
/>
</PartBoundary>
}
/>
<PostView
post={post}
username={channel.username}
displayName={channel.displayName}
avatarUrl={channel.avatarUrl}
now={now}
layout="desktop"
/>
</>
);
} else {
content = <PostMissing username={username} />;
}
return (
<FlexBox tag="main" justifyContent="justify-center" className="px-8 py-10">
@ -30,42 +81,8 @@ export function PostTemplate({
className="w-full max-w-content"
>
{/* A link opened on its own goes back to the post's channel (R14). */}
<DeskBack
parentHref={ROUTES.channel(channel.username)}
backToPrevious
/>
{channel.suspended ? (
<ChannelUnavailable context="post" />
) : post ? (
<>
<PostChannelBar
channel={channel}
layout="desktop"
verifiedLabel={t('header.verified')}
actions={
<PartBoundary name="post-channel-actions">
<ChannelActions
creatorId={channel.creatorId}
username={channel.username}
channelUrl={channelUrl}
layout="desktop"
saleOpen={channel.saleOpen}
/>
</PartBoundary>
}
/>
<PostView
post={post}
username={channel.username}
displayName={channel.displayName}
avatarUrl={channel.avatarUrl}
now={now}
layout="desktop"
/>
</>
) : (
<PostMissing username={channel.username} />
)}
<DeskBack parentHref={ROUTES.channel(username)} backToPrevious />
{content}
</FlexBox>
</FlexBox>
);

View File

@ -1,2 +1,3 @@
export { PostSkeleton } from './PostSkeleton';
export { PostTemplate } from './PostTemplate';
export type { PostTemplateProps } from './types';
export type { PostSkeletonProps, PostTemplateProps } from './types';

View File

@ -1,12 +1,15 @@
import type { PublicCreatorPayload } from '@lumina/market/features/channel';
import type { PostPayload } from '@lumina/market/features/post';
export type PostTemplateProps = {
channel: PublicCreatorPayload;
/** `null`: deleted, unknown, or another channel's. */
post: PostPayload | null;
/** The channel's username as the API stores it (lower case). */
username: string;
/** `null`: the address can't name a post, so the post is missing. */
postId: string | null;
/** «lumina.ir/channels/sara_gold», for the guest's login prompt. */
channelUrl: string;
/** The render's time: the post's time counts from it. */
now: string;
/** «lumina.ir», for the channel's not-found state. */
siteHost: string;
};
export type PostSkeletonProps = {
/** The route's loading: shown only when the wait is long enough to notice. */
delayed?: boolean;
};

View File

@ -0,0 +1,18 @@
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { ChannelNotFound } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-not-found';
import type { ChannelMissingProps } from './types';
/**
* No channel at this address, or not any more, in the 640 column. Its creator, before approval,
* sees their own tab here instead (C6 ۵.۲); the browser decides.
*/
export function ChannelMissing({ siteHost }: ChannelMissingProps) {
return (
<FlexBox tag="main" justifyContent="justify-center" className="px-8 py-10">
<FlexBox direction="flex-col" className="w-full max-w-content">
<ChannelNotFound layout="desktop" siteHost={siteHost} />
</FlexBox>
</FlexBox>
);
}

View File

@ -0,0 +1,37 @@
'use client';
import { Card } from '@lumina/island/molecules/card';
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
import { useTranslation } from 'react-i18next';
import type { ChannelSkeletonProps } from './types';
/**
* The channel before it arrives, in the 640 column under «بازگشت»: the header panel, the track
* record, then a post. The route's loading and the page's own wait share it.
*/
export function ChannelSkeleton({ delayed }: ChannelSkeletonProps) {
const { t } = useTranslation('channel');
return (
<>
<Card padding="lg">
<SkeletonPreset
preset="header"
framed
delayed={delayed}
label={t('loading')}
/>
</Card>
<SkeletonPreset
preset="stats"
delayed={delayed}
label={t('stats.loading')}
/>
<SkeletonPreset
preset="post-media"
delayed={delayed}
label={t('feed.loading')}
/>
</>
);
}

View File

@ -1,125 +1,139 @@
'use client';
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
import { PartBoundary } from '@lumina/market/app/error-boundaries';
import { ApprovedWelcome } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/approved-welcome';
import { ChannelActions } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-actions';
import { ChannelDeskBack } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-desk-back';
import { ChannelFeed } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-feed/server';
import { ChannelFeed } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-feed';
import {
ChannelHeader,
channelHeaderLabels,
} from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-header';
import { PendingChannelGate } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-not-found';
import { ChannelShare } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-share';
import { ChannelStats } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-stats/server';
import { ChannelStats } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-stats';
import { ChannelUnavailable } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-unavailable';
import { FollowNotice } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/follow-notice';
import { useChannelPage } from '@lumina/market/features/channel';
import { creatorStatsLabels } from '@lumina/market/shared/labels';
import type { ReactNode } from 'react';
import { Suspense } from 'react';
import { useTranslation } from 'react-i18next';
import { i18n } from '../../../../../../i18n';
import { ChannelMissing } from './ChannelMissing';
import { ChannelSkeleton } from './ChannelSkeleton';
import type { ChannelTemplateProps } from './types';
/**
* The channel on desktop: one 640px column, no side rail, under «بازگشت» (R14; none on the
* creator's own tab). The header panel renders at once; the first follow's notice and the track
* record follow it, then the feed, streaming in reading order, each in its own boundary, and the
* action area loads in the browser.
* creator's own tab). It renders in the browser only (0070): the server sends the column with
* «بازگشت» and the skeleton, which stay until the channel arrives. Then the header panel renders
* at once; the first follow's notice and the track record follow it, then the feed, each loading
* in its own boundary, and the action area waits for the viewer.
*/
export function ChannelTemplate({
channel,
username,
channelUrl,
now,
siteHost,
}: ChannelTemplateProps) {
const t = i18n.getFixedT(null, 'channel');
const { t, i18n } = useTranslation('channel');
const page = useChannelPage(username);
// Suspension outranks everything: no header, posts or actions, for anyone (U6 ۵.۳).
if (channel.suspended) {
return (
<FlexBox
tag="main"
justifyContent="justify-center"
className="px-8 py-10"
>
<FlexBox
direction="flex-col"
gap="gap-4"
className="w-full max-w-content"
>
<ChannelDeskBack creatorId={channel.creatorId} />
<ChannelUnavailable
context="channel"
channel={channel}
channelUrl={channelUrl}
layout="desktop"
/>
</FlexBox>
</FlexBox>
);
}
if (page.status === 'not-found')
return <ChannelMissing siteHost={siteHost} />;
const publicChannel = (
<>
<ApprovedWelcome creatorId={channel.creatorId} layout="desktop" />
<ChannelHeader
const channel = page.status === 'ok' ? page.channel : null;
let content: ReactNode;
if (!channel) {
content = <ChannelSkeleton />;
} else if (channel.suspended) {
// Suspension outranks everything: no header, posts or actions, for anyone (U6 ۵.۳).
content = (
<ChannelUnavailable
context="channel"
channel={channel}
channelUrl={channelUrl}
layout="desktop"
share={
<ChannelShare
creatorId={channel.creatorId}
username={channel.username}
channelUrl={channelUrl}
layout="desktop"
/>
}
stats={
<>
<FollowNotice creatorId={channel.creatorId} />
<PartBoundary
name="channel-stats"
title={t('stats.error-title')}
description={t('stats.error-description')}
framed
>
<Suspense
fallback={
<SkeletonPreset preset="stats" label={t('stats.loading')} />
}
>
<ChannelStats
creatorId={channel.creatorId}
labels={creatorStatsLabels(i18n.getFixedT(null, 'content'))}
/>
</Suspense>
</PartBoundary>
</>
}
actions={
<PartBoundary name="channel-actions">
<ChannelActions
/>
);
} else {
const publicChannel = (
<>
<ApprovedWelcome creatorId={channel.creatorId} layout="desktop" />
<ChannelHeader
channel={channel}
layout="desktop"
share={
<ChannelShare
creatorId={channel.creatorId}
username={channel.username}
channelUrl={channelUrl}
layout="desktop"
saleOpen={channel.saleOpen}
inviteNoteName={channel.displayName}
/>
</PartBoundary>
}
labels={channelHeaderLabels(t, i18n.getFixedT(null, 'common'))}
verified={!channel.verificationPending}
/>
<PartBoundary name="channel-feed">
<Suspense
fallback={
<SkeletonPreset preset="post" count={2} label={t('feed.loading')} />
}
>
<ChannelFeed channel={channel} now={now} layout="desktop" />
</Suspense>
</PartBoundary>
</>
);
stats={
<>
<FollowNotice creatorId={channel.creatorId} />
<PartBoundary
name="channel-stats"
title={t('stats.error-title')}
description={t('stats.error-description')}
framed
>
<Suspense
fallback={
<SkeletonPreset preset="stats" label={t('stats.loading')} />
}
>
<ChannelStats
creatorId={channel.creatorId}
labels={creatorStatsLabels(i18n.getFixedT(null, 'content'))}
/>
</Suspense>
</PartBoundary>
</>
}
actions={
<PartBoundary name="channel-actions">
<ChannelActions
creatorId={channel.creatorId}
username={channel.username}
channelUrl={channelUrl}
layout="desktop"
saleOpen={channel.saleOpen}
inviteNoteName={channel.displayName}
/>
</PartBoundary>
}
labels={channelHeaderLabels(t, i18n.getFixedT(null, 'common'))}
verified={!channel.verificationPending}
/>
<PartBoundary name="channel-feed">
<Suspense
fallback={
<SkeletonPreset
preset="post"
count={2}
label={t('feed.loading')}
/>
}
>
<ChannelFeed channel={channel} layout="desktop" />
</Suspense>
</PartBoundary>
</>
);
content = channel.verificationPending ? (
<PendingChannelGate layout="desktop" channelUrl={channelUrl}>
{publicChannel}
</PendingChannelGate>
) : (
publicChannel
);
}
return (
<FlexBox tag="main" justifyContent="justify-center" className="px-8 py-10">
@ -128,14 +142,8 @@ export function ChannelTemplate({
gap="gap-4"
className="w-full max-w-content"
>
<ChannelDeskBack creatorId={channel.creatorId} />
{channel.verificationPending ? (
<PendingChannelGate layout="desktop" channelUrl={channelUrl}>
{publicChannel}
</PendingChannelGate>
) : (
publicChannel
)}
<ChannelDeskBack creatorId={channel?.creatorId} />
{content}
</FlexBox>
</FlexBox>
);

View File

@ -1,2 +1,8 @@
export { ChannelMissing } from './ChannelMissing';
export { ChannelSkeleton } from './ChannelSkeleton';
export { ChannelTemplate } from './ChannelTemplate';
export type { ChannelTemplateProps } from './types';
export type {
ChannelMissingProps,
ChannelSkeletonProps,
ChannelTemplateProps,
} from './types';

View File

@ -1,9 +1,17 @@
import type { PublicCreatorPayload } from '@lumina/market/features/channel';
export type ChannelTemplateProps = {
channel: PublicCreatorPayload;
/** The username as the API stores it (lower case). */
username: string;
/** «lumina.ir/channels/sara_gold». */
channelUrl: string;
/** The render's time: the posts' relative times count from it. */
now: string;
/** «lumina.ir», for the not-found state. */
siteHost: string;
};
export type ChannelSkeletonProps = {
/** The route's loading: shown only when the wait is long enough to notice. */
delayed?: boolean;
};
export type ChannelMissingProps = {
siteHost: string;
};

View File

@ -1,8 +1,7 @@
import { ROUTES, withSearchParams } from '@lumina/market/app/navigation';
import { getChannel, readOnServer } from '@lumina/market/server';
import { toChannelUsername } from '@lumina/market/shared/utils';
import type { Metadata } from 'next';
import { notFound, permanentRedirect, redirect } from 'next/navigation';
import { notFound, permanentRedirect } from 'next/navigation';
import { i18n } from '../../../../i18n';
import { CheckoutTemplate } from './templates/checkout-template';
@ -18,10 +17,10 @@ export const metadata: Metadata = {
};
/**
* Checkout for a creator's channel (U9), reached only from its «اشتراک». The server renders the
* same page for everyone: the bar and who is being paid; the investor's own checkout loads in the
* browser. Another spelling of the username redirects to the stored one; a suspended channel
* sends the visitor to the channel, which says it is unavailable.
* Checkout for a creator's channel (U9), reached only from its «اشتراک». It renders in the
* browser only (0070): the server reads nothing and sends the bar and the skeleton. Another
* spelling of the username redirects to the stored one; a suspended channel sends the visitor to
* the channel, which says it is unavailable.
*/
export default async function CheckoutPage({
params,
@ -36,9 +35,6 @@ export default async function CheckoutPage({
withSearchParams(ROUTES.checkout(username), await searchParams),
);
}
const channel = await readOnServer(() => getChannel(username));
if (channel.status !== 'ok') notFound();
if (channel.data.suspended) redirect(ROUTES.channel(username));
return <CheckoutTemplate channel={channel.data} />;
return <CheckoutTemplate username={username} />;
}

View File

@ -1,36 +1,75 @@
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { PartBoundary } from '@lumina/market/app/error-boundaries';
import { MobileTopBar, ROUTES } from '@lumina/market/app/navigation';
import { CheckoutCreator } from '@lumina/market/app/screens/(flow)/checkout/[username]/organisms/checkout-creator';
import { CheckoutPanel } from '@lumina/market/app/screens/(flow)/checkout/[username]/organisms/checkout-panel';
'use client';
import { FlexBox } from '@lumina/island/atoms/flex-box';
import {
PartBoundary,
StatusEmptyState,
} from '@lumina/market/app/error-boundaries';
import { MobileTopBar, ROUTES } from '@lumina/market/app/navigation';
import {
CheckoutCreator,
CheckoutCreatorSkeleton,
} from '@lumina/market/app/screens/(flow)/checkout/[username]/organisms/checkout-creator';
import {
CheckoutPanel,
CheckoutSkeleton,
} from '@lumina/market/app/screens/(flow)/checkout/[username]/organisms/checkout-panel';
import { useCheckoutChannel } from '@lumina/market/features/checkout';
import type { ReactNode } from 'react';
import { useTranslation } from 'react-i18next';
import { i18n } from '../../../../../../i18n';
import type { CheckoutTemplateProps } from './types';
/**
* Checkout on mobile: a task page pushed from the channel, back · «خرید اشتراک» · support and no
* bottom nav (U9 §۲), with the pay block pinned to the bottom of the screen.
* bottom nav (U9 §۲), with the pay block pinned to the bottom of the screen. It renders in the
* browser only (0070): the bar and the skeleton stay until the channel arrives.
*/
export function CheckoutTemplate({ channel }: CheckoutTemplateProps) {
const t = i18n.getFixedT(null, 'payment');
export function CheckoutTemplate({ username }: CheckoutTemplateProps) {
const { t } = useTranslation('payment');
const page = useCheckoutChannel(username);
const channelHref = ROUTES.channel(username);
let content: ReactNode;
if (page.status === 'pending') {
content = (
<CheckoutSkeleton
layout="mobile"
creator={<CheckoutCreatorSkeleton />}
label={t('checkout.loading')}
/>
);
} else if (page.status === 'not-found') {
content = (
<FlexBox
direction="flex-col"
justifyContent="justify-center"
className="flex-1 px-4"
>
<StatusEmptyState variant="not-found" size="page" />
</FlexBox>
);
} else {
const { channel } = page;
content = (
<PartBoundary name="checkout" description={t('checkout.error')}>
<CheckoutPanel
creatorId={channel.creatorId}
channelHref={channelHref}
layout="mobile"
creator={<CheckoutCreator creator={channel} />}
creatorName={channel.displayName ?? channel.username}
creatorLinks={channel.socialLinks}
/>
</PartBoundary>
);
}
return (
<FlexBox direction="flex-col" className="min-h-dvh bg-bg-page">
<MobileTopBar
title={t('checkout.title')}
parentHref={ROUTES.channel(channel.username)}
/>
<MobileTopBar title={t('checkout.title')} parentHref={channelHref} />
<FlexBox tag="main" direction="flex-col" className="flex-1">
<PartBoundary name="checkout" description={t('checkout.error')}>
<CheckoutPanel
creatorId={channel.creatorId}
channelHref={ROUTES.channel(channel.username)}
layout="mobile"
creator={<CheckoutCreator creator={channel} />}
creatorName={channel.displayName ?? channel.username}
creatorLinks={channel.socialLinks}
/>
</PartBoundary>
{content}
</FlexBox>
</FlexBox>
);

View File

@ -1,3 +1,4 @@
import type { PublicCreatorPayload } from '@lumina/market/features/channel';
export type CheckoutTemplateProps = { channel: PublicCreatorPayload };
export type CheckoutTemplateProps = {
/** The channel's username as the API stores it (lower case). */
username: string;
};

View File

@ -10,9 +10,11 @@ import type { ReactNode } from 'react';
import { i18n } from '../../../i18n';
// Only the landing is indexed (0071); both tabs inherit this.
export const metadata: Metadata = {
title: i18n.t('rules:meta-title'),
description: i18n.t('rules:meta-description'),
robots: { index: false },
};
/**

View File

@ -1,31 +0,0 @@
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { Skeleton, SkeletonRegion } from '@lumina/island/atoms/skeleton';
import { i18n } from '../../i18n';
/** The landing before it arrives: the header's height, then the hero's picture and copy. */
export default function Loading() {
return (
<SkeletonRegion
label={i18n.t('landing:loading')}
delayed
className="min-h-dvh bg-surface"
>
<FlexBox
alignItems="items-center"
className="h-14 border-b border-border-subtle px-4 tablet:h-16 tablet:px-8"
>
<Skeleton width="5rem" height="1.25rem" />
</FlexBox>
<FlexBox
direction="flex-col"
gap="gap-4"
className="px-4 pt-7 tablet:px-8"
>
<Skeleton shape="rect" width="100%" height="24rem" />
<Skeleton lines={3} height="1rem" />
<Skeleton shape="pill" width="100%" height="3.25rem" />
</FlexBox>
</SkeletonRegion>
);
}

View File

@ -1,5 +1,4 @@
import { AnalystsDirectory } from '@lumina/market/app/screens/(main)/analysts/organisms/analysts-directory';
import { getFeaturedCreators, readOnServer } from '@lumina/market/server';
import type { Metadata } from 'next';
import { i18n } from '../../../i18n';
@ -11,20 +10,15 @@ export const metadata: Metadata = {
};
/**
* «تحلیلگران منتخب», `/analysts` (J04-3): every featured analyst, read on the server, the same for
* every visitor; follow (an investor) and the free registration card (a guest) join in the
* browser. Signed-in visitors are not sent anywhere. A failed read is the page's error state with
* its retry, never a partial list.
* «تحلیلگران منتخب», `/analysts` (J04-3): every featured analyst, read in the browser only
* (0070), the same for every visitor; follow (an investor) and the free registration card (a
* guest) join once the viewer is known. Signed-in visitors are not sent anywhere. A failed read
* is the page's error state with its retry, never a partial list.
*/
export default async function AnalystsPage() {
const featured = await readOnServer(() => getFeaturedCreators());
export default function AnalystsPage() {
return (
<AnalystsTemplate>
<AnalystsDirectory
analysts={featured.status === 'ok' ? featured.data : []}
layout="mobile"
/>
<AnalystsDirectory layout="mobile" />
</AnalystsTemplate>
);
}

View File

@ -1,29 +1,19 @@
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
import { MobileTopBar } from '@lumina/market/app/navigation';
import { i18n } from '../../../../i18n';
import { ChannelSkeleton } from './templates/channel-template';
/**
* The channel before it arrives, in its reading order: the real top bar, the header, the track
* record, then a post.
* record, then a post. The page shows the same skeleton until its read arrives.
*/
export default function Loading() {
const t = i18n.getFixedT(null, 'channel');
return (
<>
<MobileTopBar title={t('top-bar.channel')} />
<MobileTopBar title={i18n.t('channel:top-bar.channel')} />
<FlexBox tag="main" direction="flex-col" className="flex-1">
{/* The skeleton draws the header's flush band itself. */}
<SkeletonPreset preset="header" delayed label={t('loading')} />
<FlexBox direction="flex-col" gap="gap-4" className="p-4">
<SkeletonPreset preset="stats" delayed label={t('stats.loading')} />
<SkeletonPreset
preset="post-media"
delayed
label={t('feed.loading')}
/>
</FlexBox>
<ChannelSkeleton delayed />
</FlexBox>
</>
);

View File

@ -1,27 +1,17 @@
import { FlexBox } from '@lumina/island/atoms/flex-box';
import {
ChannelNotFound,
ChannelNotFoundTopBar,
} from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-not-found';
import type { Metadata } from 'next';
import { displayUrl } from '../../../../configs';
import { i18n } from '../../../../i18n';
import { ChannelMissing } from './templates/channel-template';
export const metadata: Metadata = { robots: { index: false } };
/**
* No channel at this address, or not any more. Its creator, before approval, sees their own tab
* here instead (C6 ۱.۲), under their tab bar; both are decided in the browser. The main is flush
* for that tab's banner strip and header; the message keeps its own inset.
*/
/** An address that can't be a username; the page shows the same state for an unknown one. */
export default function ChannelNotFoundPage() {
return (
<>
<ChannelNotFoundTopBar title={i18n.t('channel:top-bar.channel')} />
<FlexBox tag="main" direction="flex-col" className="flex-1">
<ChannelNotFound layout="mobile" siteHost={displayUrl('')} />
</FlexBox>
</>
<ChannelMissing
title={i18n.t('channel:top-bar.channel')}
siteHost={displayUrl('')}
/>
);
}

View File

@ -1,10 +1,4 @@
import { ROUTES, withSearchParams } from '@lumina/market/app/navigation';
import {
channelMetadata,
getChannel,
getRequestTime,
readOnServer,
} from '@lumina/market/server';
import { toChannelUsername } from '@lumina/market/shared/utils';
import type { Metadata } from 'next';
import { notFound, permanentRedirect } from 'next/navigation';
@ -18,33 +12,26 @@ type ChannelPageProps = {
searchParams: Promise<Record<string, string | string[] | undefined>>;
};
// The one kind of route whose metadata names its data (0055): it reads through the same per-request
// cache as the page, so the first byte, held for the metadata in <head> (0054), waits for that
// one read.
// From the address alone (0070): the server reads nothing for this page.
export async function generateMetadata({
params,
}: ChannelPageProps): Promise<Metadata> {
const username = toChannelUsername((await params).username);
if (!username) return { robots: { index: false } };
const channel = await readOnServer(() => getChannel(username));
if (channel.status !== 'ok') return { robots: { index: false } };
if (channel.data.suspended) {
return {
title: i18n.t('channel:meta.unavailable-title'),
robots: { index: false },
};
}
return channelMetadata({
channel: channel.data,
title: i18n.t('channel:meta.title', { username }),
description: i18n.t('channel:meta.description', { username }),
});
return {
title: username
? i18n.t('channel:meta.title', { username })
: i18n.t('channel:meta.unavailable-title'),
description: username
? i18n.t('channel:meta.description', { username })
: undefined,
robots: { index: false },
};
}
/**
* A creator's channel, `/channels/username`. The same server render for every visitor: the
* header, the track record and the first posts; subscribe, follow and the locked posts' gates
* load in the browser. Any other spelling of the username redirects to the one the API stores.
* A creator's channel, `/channels/username`. It renders in the browser only (0070), the same for
* every visitor: the server reads nothing and sends the skeleton. Any other spelling of the
* username redirects to the stored one, keeping an invite link's `?code=` (0059).
*/
export default async function ChannelPage({
params,
@ -53,20 +40,17 @@ export default async function ChannelPage({
const segment = (await params).username;
const username = toChannelUsername(segment);
if (!username) notFound();
// An invite link's `?code=` goes along (0059).
if (username !== segment) {
permanentRedirect(
withSearchParams(ROUTES.channel(username), await searchParams),
);
}
const channel = await readOnServer(() => getChannel(username));
if (channel.status !== 'ok') notFound();
return (
<ChannelTemplate
channel={channel.data}
username={username}
channelUrl={displayUrl(ROUTES.channel(username))}
now={getRequestTime()}
siteHost={displayUrl('')}
/>
);
}

View File

@ -1,46 +1,19 @@
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { Skeleton, SkeletonRegion } from '@lumina/island/atoms/skeleton';
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
import { MobileTopBar } from '@lumina/market/app/navigation';
import { i18n } from '../../../../../../i18n';
import { PostSkeleton } from './templates/post-template';
/**
* The post before it arrives, in the real layout (C4b ۱.۵): the live top bar, the channel bar's
* band with the author row and the subscribe and follow row, then the post with its media. No lock
* is guessed meanwhile.
* band, then the post with its media. The page shows the same skeleton until its reads arrive.
*/
export default function Loading() {
const t = i18n.getFixedT(null, 'channel');
return (
<>
<MobileTopBar title={t('top-bar.post')} />
<MobileTopBar title={i18n.t('channel:top-bar.post')} />
<FlexBox tag="main" direction="flex-col" className="flex-1">
<SkeletonRegion
delayed
label={t('loading')}
className="border-b border-border-subtle bg-surface p-4"
>
<FlexBox
alignItems="items-center"
gap="gap-3"
className="min-h-touch-target"
>
<Skeleton shape="circle" className="size-10" />
<Skeleton className="h-4 w-32" />
</FlexBox>
<FlexBox gap="gap-2">
<Skeleton shape="pill" className="h-control-md flex-1" />
<Skeleton shape="pill" className="h-control-md w-32" />
</FlexBox>
</SkeletonRegion>
<FlexBox direction="flex-col" className="p-4">
<SkeletonPreset
preset="post-media"
delayed
label={t('post.loading')}
/>
</FlexBox>
<PostSkeleton delayed />
</FlexBox>
</>
);

View File

@ -1,12 +1,5 @@
import { ROUTES } from '@lumina/market/app/navigation';
import { POST_ID_PATTERN } from '@lumina/market/features/post';
import {
getChannel,
getRequestTime,
getPost,
postMetadata,
readOnServer,
} from '@lumina/market/server';
import { toChannelUsername } from '@lumina/market/shared/utils';
import type { Metadata } from 'next';
import { notFound, permanentRedirect } from 'next/navigation';
@ -17,65 +10,37 @@ import { PostTemplate } from './templates/post-template';
type PostPageProps = { params: Promise<{ username: string; id: string }> };
/** The channel and the post, read together; a post that isn't this channel's is missing. */
async function readPostPage(username: string, id: string) {
const [channel, post] = await Promise.all([
readOnServer(() => getChannel(username)),
POST_ID_PATTERN.test(id)
? readOnServer(() => getPost(id))
: ({ status: 'not-found' } as const),
]);
if (channel.status !== 'ok') return null;
const found =
post.status === 'ok' && post.data.creatorId === channel.data.creatorId
? post.data
: null;
return { channel: channel.data, post: found };
}
// The one kind of route whose metadata names its data (0055): it reads through the same per-request
// cache as the page, so the first byte, held for the metadata in <head> (0054), waits for that
// one read.
// From the address alone (0070): the server reads nothing for this page.
export async function generateMetadata({
params,
}: PostPageProps): Promise<Metadata> {
const { username: segment, id } = await params;
const username = toChannelUsername(segment);
const page = username ? await readPostPage(username, id) : null;
if (!page?.post || page.channel.suspended) {
return {
title: i18n.t('channel:meta.post-missing-title'),
robots: { index: false },
};
}
return postMetadata({
channel: page.channel,
post: page.post,
fallbackTitle: i18n.t('channel:meta.post-title', {
username: page.channel.username,
}),
});
const username = toChannelUsername((await params).username);
return {
title: username
? i18n.t('channel:meta.post-title', { username })
: i18n.t('channel:meta.post-missing-title'),
robots: { index: false },
};
}
/**
* One post, `/channels/username/posts/[id]`: where every shared link lands. The server renders it
* as every visitor sees it; a subscriber's or the creator's premium post opens in the browser. A
* deleted or unknown post keeps the channel's frame and leads back to the channel.
* One post, `/channels/username/posts/[id]`: where every shared link lands. It renders in the
* browser only (0070): the server reads nothing and sends the skeleton; a subscriber's or the
* creator's premium post arrives open. A deleted or unknown post keeps the channel's frame and
* leads back to the channel, as does an id that can't be a post's.
*/
export default async function PostPage({ params }: PostPageProps) {
const { username: segment, id } = await params;
const username = toChannelUsername(segment);
if (!username) notFound();
if (username !== segment) permanentRedirect(ROUTES.post(username, id));
const page = await readPostPage(username, id);
if (!page) notFound();
return (
<PostTemplate
channel={page.channel}
post={page.post}
username={username}
postId={POST_ID_PATTERN.test(id) ? id : null}
channelUrl={displayUrl(ROUTES.channel(username))}
now={getRequestTime()}
siteHost={displayUrl('')}
/>
);
}

View File

@ -0,0 +1,46 @@
'use client';
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { Skeleton, SkeletonRegion } from '@lumina/island/atoms/skeleton';
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
import { useTranslation } from 'react-i18next';
import type { PostSkeletonProps } from './types';
/**
* The post before it arrives, in the real layout (C4b ۱.۵), under the live top bar: the channel
* bar's band with the author row and the subscribe and follow row, then the post with its media.
* No lock is guessed meanwhile. The route's loading and the page's own wait share it.
*/
export function PostSkeleton({ delayed }: PostSkeletonProps) {
const { t } = useTranslation('channel');
return (
<>
<SkeletonRegion
delayed={delayed}
label={t('loading')}
className="border-b border-border-subtle bg-surface p-4"
>
<FlexBox
alignItems="items-center"
gap="gap-3"
className="min-h-touch-target"
>
<Skeleton shape="circle" className="size-10" />
<Skeleton className="h-4 w-32" />
</FlexBox>
<FlexBox gap="gap-2">
<Skeleton shape="pill" className="h-control-md flex-1" />
<Skeleton shape="pill" className="h-control-md w-32" />
</FlexBox>
</SkeletonRegion>
<FlexBox direction="flex-col" className="p-4">
<SkeletonPreset
preset="post-media"
delayed={delayed}
label={t('post.loading')}
/>
</FlexBox>
</>
);
}

View File

@ -1,3 +1,5 @@
'use client';
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { PartBoundary } from '@lumina/market/app/error-boundaries';
import { MobileTopBar, ROUTES } from '@lumina/market/app/navigation';
@ -6,67 +8,88 @@ import { ChannelUnavailable } from '@lumina/market/app/screens/(main)/channels/[
import { PostChannelBar } from '@lumina/market/app/screens/(main)/channels/[username]/posts/[id]/organisms/post-channel-bar';
import { PostMissing } from '@lumina/market/app/screens/(main)/channels/[username]/posts/[id]/organisms/post-missing';
import { PostView } from '@lumina/market/app/screens/(main)/channels/[username]/posts/[id]/organisms/post-view';
import { usePostPage } from '@lumina/market/features/post';
import type { ReactNode } from 'react';
import { useTranslation } from 'react-i18next';
import { i18n } from '../../../../../../../../i18n';
import { ChannelMissing } from '../../../../templates/channel-template';
import { PostSkeleton } from './PostSkeleton';
import type { PostTemplateProps } from './types';
/**
* The post on mobile, pushed from خانه or the channel: the creator with subscribe and follow,
* then the post in full. The action area loads in the browser.
* then the post in full. It renders in the browser only (0070): the server sends the top bar and
* the skeleton, which stay until the channel and the post arrive. The action area waits for the
* viewer.
*/
export function PostTemplate({
channel,
post,
username,
postId,
channelUrl,
now,
siteHost,
}: PostTemplateProps) {
const t = i18n.getFixedT(null, 'channel');
const { t, i18n } = useTranslation('channel');
const page = usePostPage(username, postId);
if (page.status === 'not-found') {
return <ChannelMissing title={t('top-bar.channel')} siteHost={siteHost} />;
}
let content: ReactNode;
if (page.status === 'pending') {
content = <PostSkeleton />;
} else if (page.channel.suspended) {
content = <ChannelUnavailable context="post" />;
} else if (page.status === 'ok') {
const { channel, post, now } = page;
content = (
<>
<PostChannelBar
channel={channel}
layout="mobile"
verifiedLabel={t('header.verified')}
actions={
<PartBoundary name="post-channel-actions">
<ChannelActions
creatorId={channel.creatorId}
username={channel.username}
channelUrl={channelUrl}
layout="mobile"
saleOpen={channel.saleOpen}
/>
</PartBoundary>
}
/>
<FlexBox direction="flex-col" className="p-4">
<PostView
post={post}
username={channel.username}
displayName={channel.displayName}
avatarUrl={channel.avatarUrl}
now={now}
layout="mobile"
/>
</FlexBox>
</>
);
} else {
content = (
<FlexBox direction="flex-col" className="flex-1 bg-surface px-4">
<PostMissing username={username} />
</FlexBox>
);
}
return (
<>
<MobileTopBar
title={t('top-bar.post')}
previewTitle={i18n.t('content:preview.title')}
parentHref={ROUTES.channel(channel.username)}
parentHref={ROUTES.channel(username)}
backToPrevious
/>
<FlexBox tag="main" direction="flex-col" className="flex-1">
{channel.suspended ? (
<ChannelUnavailable context="post" />
) : post ? (
<>
<PostChannelBar
channel={channel}
layout="mobile"
verifiedLabel={t('header.verified')}
actions={
<PartBoundary name="post-channel-actions">
<ChannelActions
creatorId={channel.creatorId}
username={channel.username}
channelUrl={channelUrl}
layout="mobile"
saleOpen={channel.saleOpen}
/>
</PartBoundary>
}
/>
<FlexBox direction="flex-col" className="p-4">
<PostView
post={post}
username={channel.username}
displayName={channel.displayName}
avatarUrl={channel.avatarUrl}
now={now}
layout="mobile"
/>
</FlexBox>
</>
) : (
<FlexBox direction="flex-col" className="flex-1 bg-surface px-4">
<PostMissing username={channel.username} />
</FlexBox>
)}
{content}
</FlexBox>
</>
);

View File

@ -1,2 +1,3 @@
export { PostSkeleton } from './PostSkeleton';
export { PostTemplate } from './PostTemplate';
export type { PostTemplateProps } from './types';
export type { PostSkeletonProps, PostTemplateProps } from './types';

View File

@ -1,12 +1,15 @@
import type { PublicCreatorPayload } from '@lumina/market/features/channel';
import type { PostPayload } from '@lumina/market/features/post';
export type PostTemplateProps = {
channel: PublicCreatorPayload;
/** `null`: deleted, unknown, or another channel's. */
post: PostPayload | null;
/** The channel's username as the API stores it (lower case). */
username: string;
/** `null`: the address can't name a post, so the post is missing. */
postId: string | null;
/** «lumina.ir/channels/sara_gold», for the guest's login prompt. */
channelUrl: string;
/** The render's time: the post's time counts from it. */
now: string;
/** «lumina.ir», for the channel's not-found state. */
siteHost: string;
};
export type PostSkeletonProps = {
/** The route's loading: shown only when the wait is long enough to notice. */
delayed?: boolean;
};

View File

@ -0,0 +1,23 @@
import { FlexBox } from '@lumina/island/atoms/flex-box';
import {
ChannelNotFound,
ChannelNotFoundTopBar,
} from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-not-found';
import type { ChannelMissingProps } from './types';
/**
* No channel at this address, or not any more. Its creator, before approval, sees their own tab
* here instead (C6 ۱.۲), under their tab bar; both are decided in the browser. The main is flush
* for that tab's banner strip and header; the message keeps its own inset.
*/
export function ChannelMissing({ title, siteHost }: ChannelMissingProps) {
return (
<>
<ChannelNotFoundTopBar title={title} />
<FlexBox tag="main" direction="flex-col" className="flex-1">
<ChannelNotFound layout="mobile" siteHost={siteHost} />
</FlexBox>
</>
);
}

View File

@ -0,0 +1,33 @@
'use client';
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
import { useTranslation } from 'react-i18next';
import type { ChannelSkeletonProps } from './types';
/**
* The channel before it arrives, in its reading order, under the real top bar: the header, the
* track record, then a post. The route's loading and the page's own wait share it.
*/
export function ChannelSkeleton({ delayed }: ChannelSkeletonProps) {
const { t } = useTranslation('channel');
return (
<>
{/* The skeleton draws the header's flush band itself. */}
<SkeletonPreset preset="header" delayed={delayed} label={t('loading')} />
<FlexBox direction="flex-col" gap="gap-4" className="p-4">
<SkeletonPreset
preset="stats"
delayed={delayed}
label={t('stats.loading')}
/>
<SkeletonPreset
preset="post-media"
delayed={delayed}
label={t('feed.loading')}
/>
</FlexBox>
</>
);
}

View File

@ -1,36 +1,67 @@
'use client';
import { FlexBox } from '@lumina/island/atoms/flex-box';
import { SkeletonPreset } from '@lumina/island/organisms/skeleton-preset';
import { PartBoundary } from '@lumina/market/app/error-boundaries';
import { MobileTopBar } from '@lumina/market/app/navigation';
import { ApprovedWelcome } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/approved-welcome';
import { ChannelActions } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-actions';
import { ChannelFeed } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-feed/server';
import { ChannelFeed } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-feed';
import {
ChannelHeader,
channelHeaderLabels,
} from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-header';
import { PendingChannelGate } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-not-found';
import { ChannelShare } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-share';
import { ChannelStats } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-stats/server';
import { ChannelStats } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-stats';
import { ChannelUnavailable } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/channel-unavailable';
import { FollowNotice } from '@lumina/market/app/screens/(main)/channels/[username]/organisms/follow-notice';
import { useChannelPage } from '@lumina/market/features/channel';
import { creatorStatsLabels } from '@lumina/market/shared/labels';
import { Suspense } from 'react';
import { useTranslation } from 'react-i18next';
import { i18n } from '../../../../../../i18n';
import { ChannelMissing } from './ChannelMissing';
import { ChannelSkeleton } from './ChannelSkeleton';
import type { ChannelTemplateProps } from './types';
/**
* The channel on mobile: a page pushed from خانه (the creator's own کانال tab). The header renders
* at once; the first follow's notice and the track record open the padded column, then the feed,
* streaming in reading order, each in its own boundary, and the action area loads in the browser.
* The channel on mobile: a page pushed from خانه (the creator's own کانال tab). It renders in the
* browser only (0070): the server sends the top bar and the skeleton, which stay until the
* channel arrives. Then the header renders at once; the first follow's notice and the track
* record open the padded column, then the feed, each loading in its own boundary, and the action
* area waits for the viewer.
*/
export function ChannelTemplate({
channel,
username,
channelUrl,
now,
siteHost,
}: ChannelTemplateProps) {
const t = i18n.getFixedT(null, 'channel');
const { t, i18n } = useTranslation('channel');
const page = useChannelPage(username);
if (page.status === 'not-found') {
return <ChannelMissing title={t('top-bar.channel')} siteHost={siteHost} />;
}
const channel = page.status === 'ok' ? page.channel : null;
const topBar = (
<MobileTopBar
title={t('top-bar.channel')}
tabOwnerId={channel?.creatorId}
/>
);
if (!channel) {
return (
<>
{topBar}
<FlexBox tag="main" direction="flex-col" className="flex-1">
<ChannelSkeleton />
</FlexBox>
</>
);
}
// Suspension outranks everything: no header, posts or actions, for anyone (U6 ۱.۳). Its creator
// sees their suspended tab under their tab bar (C6 ۱.۳); the browser decides. The main is flush
@ -38,10 +69,7 @@ export function ChannelTemplate({
if (channel.suspended) {
return (
<>
<MobileTopBar
title={t('top-bar.channel')}
tabOwnerId={channel.creatorId}
/>
{topBar}
<FlexBox tag="main" direction="flex-col" className="flex-1">
<ChannelUnavailable
context="channel"
@ -116,7 +144,7 @@ export function ChannelTemplate({
/>
}
>
<ChannelFeed channel={channel} now={now} layout="mobile" />
<ChannelFeed channel={channel} layout="mobile" />
</Suspense>
</PartBoundary>
</FlexBox>
@ -125,10 +153,7 @@ export function ChannelTemplate({
return (
<>
<MobileTopBar
title={t('top-bar.channel')}
tabOwnerId={channel.creatorId}
/>
{topBar}
<FlexBox tag="main" direction="flex-col" className="flex-1">
{channel.verificationPending ? (
<PendingChannelGate layout="mobile" channelUrl={channelUrl}>

View File

@ -1,2 +1,8 @@
export { ChannelMissing } from './ChannelMissing';
export { ChannelSkeleton } from './ChannelSkeleton';
export { ChannelTemplate } from './ChannelTemplate';
export type { ChannelTemplateProps } from './types';
export type {
ChannelMissingProps,
ChannelSkeletonProps,
ChannelTemplateProps,
} from './types';

View File

@ -1,9 +1,19 @@
import type { PublicCreatorPayload } from '@lumina/market/features/channel';
export type ChannelTemplateProps = {
channel: PublicCreatorPayload;
/** The username as the API stores it (lower case). */
username: string;
/** «lumina.ir/channels/sara_gold». */
channelUrl: string;
/** The render's time: the posts' relative times count from it. */
now: string;
/** «lumina.ir», for the not-found state. */
siteHost: string;
};
export type ChannelSkeletonProps = {
/** The route's loading: shown only when the wait is long enough to notice. */
delayed?: boolean;
};
export type ChannelMissingProps = {
/** The top bar's title: «کانال». */
title: string;
siteHost: string;
};

View File

@ -1,6 +1,6 @@
# 0021 A channel's feed starts from the server's first page as initial data
Status: Proposed · Area: architecture · Date: 2026-10-07 · Decided by: agent
Status: Superseded by 0070 · Area: architecture · Date: 2026-10-07 · Decided by: agent
## Context
The channel feed and the post page must be in the server HTML for search and first paint, stay live in the browser (older pages, edits, deletes, a subscriber's unlocked posts), and the platform can't reach the app's per-request `getQueryClient()` to prefetch and dehydrate.

View File

@ -1,6 +1,6 @@
# 0045 The channel's server read carries the public follower count
Status: Proposed · Area: architecture · Date: 2026-10-09 · Decided by: agent
Status: Superseded by 0070 · Area: architecture · Date: 2026-10-09 · Decided by: agent
## Context
The new channel header shows the follower count to everyone and «مشترک فعال» only to the owner (R15).

View File

@ -1,6 +1,6 @@
# 0055 Static `metadata` everywhere but the channel and post pages
Status: Accepted · Area: architecture · Date: 2026-10-09 · Decided by: user
Status: Superseded by 0070 · Area: architecture · Date: 2026-10-09 · Decided by: user
## Context
Adapted from kasra-pay's decision 0036. Under blocking metadata (0054), any data a `generateMetadata` awaits delays the page's first byte. Almost every Lumina route's title and description is fixed copy from i18next. The channel (`/@username`) and post (`/@username/posts/[id]`) pages are the exception: search results and shared-link previews need the channel's and post's name, image and noindex state.

View File

@ -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/<app>/`. 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/<page>.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.

View File

@ -0,0 +1,26 @@
# 0070 Render every page except the landing in the browser
Status: Accepted · Area: architecture · Date: 2026-10-21 · Decided by: user · Supersedes: 0021, 0045, 0055
## Context
A creator can announce a post for a set time, and tens of thousands of visitors may open the same channel or post at once. Each server render of a channel cost five back-end reads, a post four. The user wants the Next.js servers free of that pressure, and accepts losing search results and rich link previews for channels and posts.
## Decision
- The landing (`/`) is the only page whose content the server renders, all of it in the first flush, with no `loading.tsx`.
- Every other page renders its content in the browser, for guests and members alike. The server reads no back-end data: it sends the frame, a same-size skeleton, and the metadata. This now includes `/channels/[username]`, `/channels/[username]/posts/[id]`, `/checkout/[username]` and `/analysts`.
- Channel and post pages are `noindex` and keep a `loading.tsx`. Their `generateMetadata` reads only the URL's params; every other page exports static `metadata`.
- The server still checks a URL's shape without reading data: a username in another spelling answers 308, a malformed one 404.
## Alternatives
- Server-render the channel header and post text from one back-end-cached read (hybrid): keeps link previews and SEO for one cache hit per request. The user chose to keep the server free of reads.
- Server metadata only (one read per request) so link previews name the channel: rejected for the same reason.
## Consequences
- The back-end load stays: the same reads now come from browsers, with the session's cookies. The back end needs its own cache for public reads before a spike.
- Shared channel and post links show the generic site card, and search engines index no channel or post content.
- Channel and post content paints later on a first visit: after the JavaScript, then the read.
- A missing channel or post answers 200, and its not-found state renders in the browser.

View File

@ -0,0 +1,22 @@
# 0071 Index only the landing
Status: Accepted · Area: architecture · Date: 2026-10-21 · Decided by: user
## Context
After 0070, the landing is the only page whose content the server renders. The user confirmed that no page except the landing needs search engines: channels, posts and the rules pages included.
## Decision
- The landing (`/`) is the only indexable page in bull and bear.
- Every other page is `noindex`, set in its own or its layout's `metadata`, and has no canonical or JSON-LD. The rules pages (`/terms`, `/terms/subscription`) get it from the `terms` layout.
- A new page is `noindex` unless a later decision says otherwise.
## Alternatives
- Keep the rules pages indexable: they read no data and render on the server, but the user wants no search presence beyond the landing.
## Consequences
- A rendering doc's Index column is `no` for every section outside the landing, and the ready-for-review checks for `primary` and `secondary` rows apply only to the landing.
- A sitemap, if one is ever added, lists only `/`.

View File

@ -18,7 +18,6 @@
- 0052 Evict the service worker's least recently used entry first, with the key order kept in memory and older-half hits stored again.
- 0053 Ship bull and bear with the same worker options and `NEXT_PUBLIC_SERVICE_WORKER_ENABLED`; both serve the manifest from `platforms/market/src/app/manifest`.
- 0054 Set `htmlLimitedBots: /.*/` in both apps' `next.config.ts`, so every visitor gets metadata in `<head>`.
- 0055 Export static `metadata` from every layout and page; only the channel and post pages use `generateMetadata`, through the page's cached read.
- 0057 Back links to `parentHref` and traverses history only when that is the previous entry; `backToPrevious` pages (and pages without `parentHref`) accept any previous page.
- 0058 Opening notifications records "seen" and clears the bell; a row stays unread until tapped; creators filter one list by «همه · پیش‌بینی‌ها · مالی · حساب».
- 0059 Checkout and the channel save `?code=` into the per-creator checkout draft on arrival; checkout then strips it from the URL.
@ -28,6 +27,8 @@
- 0066 Give every app `INTERNAL_END_POINT` (server calls) and `NEXT_PUBLIC_CLIENT_END_POINT` (the API's public origin, called directly by the browser with credentials), both set in the bootstraps; no `next.config.ts` rewrite.
- 0067 Run each app as one container publishing `HTTP_PORT`, with no per-app nginx; `tools/deploy.sh` checks the new release's `/healthz` off to the side, then replaces the old release.
- 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.
## Proposed
@ -39,7 +40,6 @@
- 0016 architecture: Keep a creator who hasn't finished step 5 out of publishing and pricing through the session's `needsProfile`, with `OnboardingGuard` in those routes' layouts and `GuestGuard`.
- 0017 architecture: Give every auth and onboarding route its own `loading.tsx` matching its frame; an index route with nested steps sits in its own route group.
- 0020 architecture: Server-rendered platform organisms take their text as `labels` built by the app's template from its server i18n; client organisms use `useTranslation`.
- 0021 architecture: A channel's feed and post page start from the server's read as query `initialData`, re-read in the browser for the creator or a subscriber, and update in place after mutations.
- 0022 architecture: The API enforces post rules (2000 characters, four JPG/PNG/WebP images of 5 MB, 15-minute edit window, approved creators only); the composer mirrors them in `POST_LIMITS`.
- 0023 architecture: On desktop «پست جدید», post edit and «پیش‌بینی جدید» are dialogs over the page through bear's `@modal` intercepts; slots are emptied by explicit null pages, never a catch-all, and a hard load gets the full page.
- 0025 architecture: The investor's داشبورد is a tabbed section, one route per tab in `dashboard/(investor)`, whose layout holds the top bar or heading and `DashboardTabs`; each tab has its own loading.
@ -57,10 +57,10 @@
- 0041 architecture: Confirm sign-out, call `auth.logout`, then reload to the landing.
- 0042 architecture: When a session ends mid-use, show the session-ended state and keep drafts; only an explicit sign-out clears drafts and `session.*` keys.
- 0043 architecture: Freeze every network action offline with island `useOfflineFreeze`, showing the reason.
- 0045 architecture: The channel's server read carries the public follower count; the browser keeps it live and shows «مشترک فعال» only to the owner.
- 0046 architecture: Serve `/account/profile` in `(flow)` for both roles, switching investor form and creator profile edit in the browser.
- 0047 architecture: The pwa lib keeps the browser's install offer; offer install at `/account/install` and once on bull's خانه with a 30-day snooze; the manifest starts at `/feed`.
- 0049 design: A page error keeps the page's own bar, derived from the path; route groups without a frame pass `standalone`.
- 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.

89
docs/pages/README.md Normal file
View File

@ -0,0 +1,89 @@
# 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
Only `/` is indexable (0071), and it is the only page whose content the server renders (0070). Every other page is `noindex`; all but the rules pages render their content in the browser.
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`
Rendered on the server:
- `/` · [home.md](market/home.md) · index · FAQPage · browser: LandingRedirect
- `/terms` · [terms.md](market/terms.md) · noindex · none · browser: none
- `/terms/subscription` · [terms-subscription.md](market/terms-subscription.md) · noindex · none · browser: none
`(main)`:
- `/channels/[username]` · [channels-username.md](market/channels-username.md) · noindex · none · browser: every section (header, counts, actions, stats, feed, ChannelMissing, ChannelUnavailable), ApprovedWelcome, FollowNotice, Load more, PostLightbox
- `/channels/[username]/posts/[id]` · [channels-username-posts-id.md](market/channels-username-posts-id.md) · noindex · none · browser: every section (PostChannelBar, ChannelActions, PostView, PostMissing, ChannelMissing, ChannelUnavailable), PreviewBanner, PostLightbox, access-ended toast
- `/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, AnalystsDirectory (heading, note, AnalystList), 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: CheckoutCreator, 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

View File

@ -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).

View File

@ -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 `<span>`; 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 `<Suspense>` 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.

View File

@ -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`).

View File

@ -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 `<span>`; 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.

View File

@ -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 throws to `(main)/error.tsx` in the browser; no 404 or 403 case |
| loading.tsx | `(main)/analysts/loading.tsx`: the frame and three analyst cards |
| First flush | none: the server reads nothing (0070); `useAnalystsPage` reads `featuredCreatorsQuery()` in the browser, shared with خانه's featured row, and the directory shows `AnalystListSkeleton` (not delayed) until it arrives |
| 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 | `featuredCreatorsQuery()` | skeleton | hydrate | no | bull's H1 and the «chosen by Lumina, not a ranking» note |
| AnalystList | `featuredCreatorsQuery()` | skeleton | hydrate | no | every featured analyst in the admin's order, each card an `<a href>` 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 channel links render in the browser, and the channel pages are `noindex` too (0070): this page is no crawl path.

View File

@ -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 `<a href="/">` and support; no way back into login |
| AuthTemplate header (bear) | config | first flush | none | no | brand `<a href="/">` |
| 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 `<a href="/">`; 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.

View File

@ -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 | `<a href>` to `/auth/login`, keeping `?redirect=` |
| AuthTemplate header (bear) | config | first flush | none | no | brand `<a href="/">` |
| 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).

View File

@ -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 | `<a href="/">`, or straight to `?redirect=` (`leavesFlow`, J01-1e) |
| AuthTemplate header (bear) | config | first flush | none | no | brand `<a href="/">`; 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.

View File

@ -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 | `<a href="/">`, keeping `?redirect=` |
| AuthTemplate header (bear) | config | first flush | none | no | brand `<a href="/">` |
| 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.

View File

@ -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 | `<a href>` to `/auth/register`, keeping `?redirect=` |
| AuthTemplate header (bear) | config | first flush | none | no | brand `<a href="/">` |
| 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.

View File

@ -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 | `<a href>` to `/auth/register/phone`, keeping `?redirect=` |
| AuthTemplate header (bear) | config | first flush | none | no | brand `<a href="/">` |
| 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.

View File

@ -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 | `<a href>` to `/auth/login`, keeping `?redirect=` |
| AuthTemplate header (bear) | config | first flush | none | no | brand `<a href="/">` |
| 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.

View File

@ -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 | `noindex` (`generateMetadata`, from the URL's params only: title `پست @username`; no read, 0070) |
| Status | `200`; another spelling of the username redirects in the stream (meta refresh) to `ROUTES.post`, because `loading.tsx` wraps the page; `/@username/…` answers a real 308 (0064); a username that can't be one renders the channel's `not-found.tsx` (`ChannelMissing`), 200; an id that can't be a post's, or a missing post, renders `PostMissing` in the channel's frame, 200 |
| loading.tsx | `apps/{bull,bear}/src/app/(main)/channels/[username]/posts/[id]/loading.tsx`: bull: `MobileTopBar` and `PostSkeleton delayed`; bear: `DeskBack` and `PostSkeleton delayed`. The page shows the same `PostSkeleton` (not delayed) until its reads arrive |
| First flush | none: the server reads nothing (0070); `usePostPage` reads `channelPageQuery(username)` and `postKeys.detail(id)` in the browser |
| Canonical | none |
| H1 | none (debt) |
| JSON-LD | none |
| 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` from the URL, `backToPrevious`, 0057); the title waits for the viewer |
| DeskBack (bear) | — | streamed | hydrate | no | «بازگشت» to the channel, drawn while the reads load |
| PostChannelBar | `channelPageQuery(username)` | skeleton | hydrate | no | `<a href>` to the channel: avatar, name, `@username` |
| ↳ ChannelActions | viewer | skeleton | hydrate | no | follow and subscribe; own `PartBoundary` |
| PostView | `postKeys.detail(id)` | skeleton | hydrate | no | read with the session, so a subscriber's or the creator's premium post arrives open; read again if the session was restored after it |
| ↳ 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 | `postKeys.detail(id)` | none | hydrate | no | instead of `PostView` when the post is missing, another channel's, or the id can't be a post's; a link back to the channel |
| ChannelMissing | `channelPageQuery(username)` | none | hydrate | no | the channel is unknown |
| ChannelUnavailable | `channelPageQuery(username)` | none | hydrate | no | replaces the bar and post when the channel is suspended |
## Notes
- bull: under `MobileTopBar`, a padded column; bear: the 640px column under «بازگشت».
- A 404 on the post read is the `missing` state, not a boundary; any other failed first read throws to `(main)/error.tsx`. A deleted post's page renders again with `router.refresh()` and reads the post afresh.
- 0070's accepted cost: search engines get no post content, and a shared link shows the site card with the `پست @username` title.
- Debt: no H1 in either app. Make the post's first line the H1.

View File

@ -0,0 +1,44 @@
# 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 | `noindex` (`generateMetadata`, from the URL's params only: title `@username`, description `channel:meta.description`; no read, 0070) |
| Status | `200`; another spelling of the username redirects in the stream (meta refresh) to the stored one, keeping `?code=` (0059), because `loading.tsx` wraps the page; `/@username/…` answers a real 308 from `next.config.ts` (0064); a username that can't be one renders `not-found.tsx` (`ChannelMissing`), 200; an unknown channel renders `ChannelMissing` in the browser, 200 |
| loading.tsx | `apps/{bull,bear}/src/app/(main)/channels/[username]/loading.tsx`: bull: `MobileTopBar` and `ChannelSkeleton delayed`; bear: `DeskBack` and `ChannelSkeleton delayed`. The page shows the same `ChannelSkeleton` (not delayed) until its read arrives |
| First flush | none: the server reads nothing (0070); `channelPageQuery(username)` runs in the browser |
| Canonical | none |
| H1 | the display name, in `ChannelHeader`, rendered in the browser |
| JSON-LD | none |
| Scripts | none |
## Sections
In bull's document order.
| Section | Data | HTML | JS | Index | Notes |
| -------------------------- | --------------------------------- | -------- | ----------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| MobileTopBar (bull) | viewer | skeleton | hydrate | no | `tabOwnerId` once the channel is known: the creator on their own channel gets the tab bar |
| ChannelDeskBack (bear) | viewer | streamed | hydrate | no | «بازگشت», drawn while the channel loads; 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 | `channelPageQuery(username)` | skeleton | hydrate | no | avatar, name, `@username`, bio, markets, social links; bear: in a card |
| ↳ ChannelShare | — | skeleton | hydrate | no | the owner's share sheet opens on click |
| ↳ ChannelCounts | `channelPageQuery`, query | skeleton | hydrate | no | the follower count read with the channel, kept live in `channelKeys.followerCount`; the owner's «مشترک فعال» |
| ↳ 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 | `predictionKeys.stats(creatorId)` | skeleton | hydrate | no | `useCreatorStatsPart`, a suspense query in its own `<Suspense>` and `PartBoundary`; empty when the record isn't public |
| ChannelFeed | `postKeys.channelFeed(creatorId)` | skeleton | hydrate | no | `useChannelFeedPart`, a suspense infinite query sent with the session, in its own `<Suspense>` and `PartBoundary`; an `<a href>` per post |
| ↳ Locked post gate | viewer | skeleton | hydrate | no | guest: login back here; investor: checkout |
| ↳ Load more | query | none | hydrate | no | a `<button>` that reads the next page |
| ↳ PostLightbox | — | none | interaction | no | `next/dynamic`, mounted on the first image tap |
| ChannelMissing | `channelPageQuery(username)` | none | hydrate | no | an unknown channel; its creator before approval sees their own tab (C6 ۱.۲) |
| ChannelUnavailable | `channelPageQuery(username)` | none | hydrate | no | replaces everything when the channel is suspended |
## Notes
- 0070 supersedes 0021 and 0045: the feed, the stats and the follower count are browser reads, with no server `initialData`. Mutations update them in the query cache (`replaceCachedPost`, `removeCachedPost`, `applyClosedPrediction`).
- bull: under `MobileTopBar`, a padded column; bear: one 640px column under «بازگشت», the header in a card.
- A channel under review (`verificationPending`) renders behind `PendingChannelGate`, which decides for its owner in the browser.
- bear's `@modal/channels/[username]/page.tsx` returns `null`: it empties the `@modal` slot after publishing lands here (0023).
- 0070's accepted cost: search engines get no channel content, and a shared link shows the site card with the `@username` title and description. The back end needs its own cache for these public reads before a traffic spike.

View File

@ -0,0 +1,36 @@
# Checkout
`/checkout/[username]` · `apps/{bull,bear}/src/app/(flow)/checkout/[username]/page.tsx` · Type: cart and checkout · Layout: [layout.md](layout.md)
| Field | Value |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Robots | `noindex` (page `metadata`) |
| Status | `200`, because `loading.tsx` wraps the page: an invalid username renders the not-found UI in the stream; another spelling of the username redirects in the stream to the stored one, with `?code=` kept (0059), not a 308; an unknown channel shows `StatusEmptyState` (not-found) in the page; a suspended channel sends the visitor to the channel with `router.replace` in the browser (`useCheckoutChannel`) |
| loading.tsx | `checkout/[username]/loading.tsx`: bull: the bar; bear: the header and title; then `CheckoutSkeleton` with `CheckoutCreatorSkeleton`, `delayed` |
| First flush | none: the server reads nothing (0070); `useCheckoutChannel` reads `channelPageQuery(username)` in the browser, and the page shows `CheckoutSkeleton` (not delayed) until it arrives |
| Canonical | none: `noindex` |
| H1 | bull: none (the bar's name isn't a heading); bear: `DesktopPageTitle`, `payment:checkout.title` |
| JSON-LD | none |
| Scripts | none beyond the layout's |
## Sections
In bull's document order.
| Section | Data | HTML | JS | Index | Notes |
| ------------------------------------------------------- | ---------------------------- | -------- | ------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| MobileTopBar (bull) | config | streamed | hydrate | no | back to the channel (`parentHref` from the URL); no bottom nav |
| DesktopHeader (bear) | viewer | streamed | hydrate | no | rows as in [layout-main.md](layout-main.md) |
| DesktopPageTitle (bear) | config | streamed | hydrate | no | back to the channel, beside the title |
| CheckoutCreator | `channelPageQuery(username)` | skeleton | hydrate | no | avatar, name and @username; `CheckoutCreatorSkeleton` inside the page's skeleton until the read arrives |
| CheckoutPanel | viewer | skeleton | hydrate | no | `AuthGuard role="investor"`: a guest goes to login and back, a creator gets no-access; `useInviteLink` keeps `?code=` for this creator on arrival (0059, 0030); its own `PartBoundary` |
| ↳ CheckoutForm: tiers, invite note and code, pay footer | query | skeleton | hydrate | no | `useCheckoutPage`'s browser read; the skeleton stays while a payment left at the bank settles (0033); a reactivation shows the start-today note instead of the code (U11) |
| ↳ CheckoutHalts | query | none | hydrate | no | dialogs when the investor can't pay here |
| ↳ NoCodeSheet | `channelPageQuery(username)` | none | hydrate | no | «کد ندارم»: where to get a code, from the creator's links; mounts when opened |
## Notes
- bull pins the pay block to the bottom of the screen; bear sticks it to the bottom of the window in a 480 column. Same sections otherwise.
- The redirect and not-found cases run after the skeleton is sent, so they never set the status line. That is fine for a `noindex` page reached only from the channel's «اشتراک».
- 0070: the page shares `channelPageQuery` with the channel, so a visitor coming from the channel finds it cached.
- Debt: different H1 per app. bull has no `h1`; add a screen-reader `h1` to `CheckoutTemplate` in bull (`apps/bull/src/app/(flow)/checkout/[username]/templates/checkout-template/CheckoutTemplate.tsx:19`).

View File

@ -0,0 +1,31 @@
# Edit post
`/compose/post/[id]` · `apps/{bull,bear}/src/app/(flow)/compose/post/[id]/page.tsx`; bear's dialog: `apps/bear/src/app/(main)/@modal/(.)compose/post/[id]/page.tsx` · Type: account · Layout: [layout.md](layout.md); the dialog: [layout-main.md](layout-main.md)
| Field | Value |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Robots | `noindex` (page `metadata`) |
| Status | `200`: under `loading.tsx`, a malformed id (`POST_ID_PATTERN`) renders the not-found UI in the stream; the check exists because the API answers such an id with a 500 |
| loading.tsx | `compose/post/[id]/loading.tsx`: bull: the form skeleton only; bear: the header and the form skeleton; `delayed`. The dialog has none |
| First flush | none: the page entry awaits only `params` |
| Canonical | none: `noindex` |
| H1 | bull: none (the composer's bar names it, in the browser); bear: the composer card's header, `content:composer.edit-title`, in the browser |
| JSON-LD | none |
| Scripts | none beyond the layout's |
## Sections
In bull's document order. `compose/layout.tsx` is only `OnboardingGuard` (0016): it renders nothing, and sends a creator who hasn't finished step 5 to the creator profile.
| 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) |
| PostComposer | viewer | skeleton | hydrate | no | `AuthGuard role="creator"`, fallback `SkeletonPreset form`; `usePublishAccess`: pending keeps the skeleton, blocked sends the creator to their channel (0060) |
| ↳ EditComposer | query | skeleton | hydrate | no | `useEditablePost(postId)` in the browser; past the 15-minute window or not the creator's own, an `EmptyState` says why (0022); else `ComposerForm` filled with the post |
| ↳ LeaveConfirm | — | none | hydrate | no | mounts when leaving with changes |
| PostComposerDialog (bear) | viewer | none | interaction | no | the `@modal` intercept (J08-4-D, 0023), on a soft navigation from a main page: «ویرایش پست» as a 640 dialog over that page; fallback `PostComposerDialogSkeleton edit`; the same id check calls `notFound()` |
## Notes
- A hard load of the URL gets the full page; a soft navigation from a `(main)` page gets the dialog over it (see [compose-post.md](compose-post.md)).
- Debt: different H1 per app. bull has no `h1`; add a screen-reader `h1` to `ComposerForm`'s mobile branch (`platforms/market/src/app/screens/(flow)/compose/post/organisms/post-composer/components/ComposerForm.tsx:64`).

View File

@ -0,0 +1,32 @@
# New post
`/compose/post` · `apps/{bull,bear}/src/app/(flow)/compose/post/page.tsx`; bear's dialog: `apps/bear/src/app/(main)/@modal/(.)compose/post/page.tsx` · Type: account · Layout: [layout.md](layout.md); the dialog: [layout-main.md](layout-main.md)
| Field | Value |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| Robots | `noindex` (page `metadata`) |
| Status | `200` for every viewer: a guest goes to login in the browser, an investor sees `AuthGuard`'s page-size no-access state |
| loading.tsx | `compose/post/loading.tsx`: bull: the form skeleton only; bear: the header and the form skeleton; `delayed`. The dialog has none |
| First flush | none |
| Canonical | none: `noindex` |
| H1 | bull: none (the composer's bar names it, in the browser); bear: the composer card's header, `content:composer.new-title`, in the browser |
| JSON-LD | none |
| Scripts | none beyond the layout's |
## Sections
In bull's document order. `compose/layout.tsx` is only `OnboardingGuard` (0016): it renders nothing, and sends a creator who hasn't finished step 5 to the creator profile.
| 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) |
| PostComposer | viewer | skeleton | hydrate | no | `AuthGuard role="creator"`, fallback `SkeletonPreset form`; then `usePublishAccess`: pending keeps the skeleton, blocked sends the creator to their channel (`ComposerLockedRedirect`, 0060) |
| ↳ ComposerForm | viewer | skeleton | hydrate | no | bull: `MobileTopBar`, the «انصراف» row, the body, and a pinned footer with add image, count and submit; bear: a 640 card with its `h1` header; the draft lives in the persisted post-draft store; rules from `POST_LIMITS` (0022); publish sends an `Idempotency-Key` (0060) |
| ↳ LeaveConfirm | — | none | hydrate | no | mounts when leaving with something to lose |
| PostComposerDialog (bear) | viewer | none | interaction | no | the `@modal` intercept (0023), on a soft navigation from a main page: the composer as a 640 dialog over that page; fallback `PostComposerDialogSkeleton`; anyone but a creator gets no-access inside the dialog; its route chunk loads with the navigation |
## Notes
- A hard load or refresh of `/compose/post` gets the full page; a soft navigation from a `(main)` page gets the dialog over it. When nothing in `(main)` is under the dialog, `(main)/default.tsx` loads the URL again, so the full page takes over. `@modal/feed` and `@modal/channels/[username]` are null pages that empty the slot after publishing (0023).
- bull's server HTML holds only the form skeleton: no top bar until the browser knows the viewer.
- Debt: different H1 per app. bull has no `h1`; add a screen-reader `h1` to `ComposerForm`'s mobile branch (`platforms/market/src/app/screens/(flow)/compose/post/organisms/post-composer/components/ComposerForm.tsx:64`).

View File

@ -0,0 +1,32 @@
# New prediction
`/compose/prediction` · `apps/{bull,bear}/src/app/(flow)/compose/prediction/page.tsx`; bear's dialog: `apps/bear/src/app/(main)/@modal/(.)compose/prediction/page.tsx` · Type: account · Layout: [layout.md](layout.md); the dialog: [layout-main.md](layout-main.md)
| Field | Value |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Robots | `noindex` (page `metadata`) |
| Status | `200` for every viewer: a guest goes to login in the browser, an investor sees `AuthGuard`'s page-size no-access state |
| loading.tsx | `compose/prediction/loading.tsx`: bull: the form skeleton only; bear: the header and the form skeleton; `delayed`. The dialog has none |
| First flush | none |
| Canonical | none: `noindex` |
| H1 | bull: none (the composer's bar names it, in the browser); bear: the 960 card's header, `predictions:composer.title`, in the browser |
| JSON-LD | none |
| Scripts | none beyond the layout's |
## Sections
In bull's document order. `compose/layout.tsx` is only `OnboardingGuard` (0016): it renders nothing, and sends a creator who hasn't finished step 5 to the creator profile.
| 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) |
| PredictionComposer | viewer | skeleton | hydrate | no | `AuthGuard role="creator"`, fallback `SkeletonPreset form`; `usePublishAccess`: pending keeps the skeleton, blocked sends the creator to their channel (J09-1e, 0060) |
| ↳ ComposerPage | viewer | skeleton | hydrate | no | bull: `MobileTopBar`, the «انصراف» row, the fields, the preview, and «انتشار پیش‌بینی» pinned; bear: a 960 card drawn as the dialog, with its `h1`, the fields beside the preview; published, it replaces itself with the creator's channel |
| ↳ SymbolPicker | query | none | hydrate | no | «انتخاب نماد»: bull: a sheet; bear: a modal; mounts on open, then searches symbols in the browser |
| ↳ ConfirmPublish, LeaveConfirm | — | none | hydrate | no | mount on publish and on leaving with something to lose |
| PredictionComposerDialog (bear) | viewer | none | interaction | no | the `@modal` intercept (J09-1-D, 0023), on a soft navigation from a main page: the 960 dialog over that page; fallback `PredictionComposerDialogSkeleton`; anyone but a creator gets no-access inside the dialog |
## Notes
- A hard load or refresh gets the full page; a soft navigation from a `(main)` page gets the dialog over it (see [compose-post.md](compose-post.md)).
- Debt: different H1 per app. bull has no `h1`; add a screen-reader `h1` to `ComposerPage`'s mobile branch (`platforms/market/src/app/screens/(flow)/compose/prediction/organisms/prediction-composer/components/ComposerPage.tsx:57`).

View File

@ -0,0 +1,33 @@
# Dashboard: finance
`/dashboard/finance` · `apps/{bull,bear}/src/app/(main)/dashboard/(creator)/finance/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 no-access state under the payout notice |
| loading.tsx | `(creator)/finance/loading.tsx`: the payout notice in place, then the three skeletons, `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
In bull's document order.
| Section | Data | HTML | JS | Index | Notes |
| -------------------- | ------ | ----------- | ------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------- |
| PayoutScheduleNotice | config | first flush | none | no | the payout weekday from `PAYOUT_WEEKDAY`; the same for every creator, outside `AuthGuard` |
| BalanceSummary | viewer | skeleton | hydrate | no | in `AuthGuard role="creator"`; `BalanceSummaryBoundary` outside its `<Suspense>`, so a failed balance never hides the ledger (J10-6f) |
| PayoutAccount | viewer | skeleton | hydrate | no | the شبا form or the saved account; own `PartBoundary` and `<Suspense>`; the account menu links here with `#payout-account` |
| ↳ ReadBackDialog | viewer | none | hydrate | no | mounts when the creator confirms a شبا |
| Ledger | viewer | skeleton | hydrate | no | گردش حساب: filter tabs in `?ledger=`, «بیشتر» loads the next page; own `PartBoundary` and `<Suspense>` |
| ↳ LedgerDetail | viewer | none | hydrate | no | opened from a row, or by `?entry=` or `?payout=`; bull: a bottom sheet; bear: a side sheet, with the open row marked selected |
| ↳ Receipt Lightbox | viewer | none | hydrate | no | mounts when a payout receipt opens (0037) |
## Notes
- bull and bear differ only in `layout` for `PayoutAccount`, `Ledger` and their skeletons.
- The three parts read only in the browser: `AuthGuard` returns its skeletons on the server.

View File

@ -0,0 +1,27 @@
# Dashboard: following
`/dashboard/following` · `apps/{bull,bear}/src/app/(main)/dashboard/(investor)/following/page.tsx` · Type: account · Layout: [layout-dashboard-investor.md](layout-dashboard-investor.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, a creator sees `AuthGuard`'s page-size no-access state |
| loading.tsx | `(investor)/following/loading.tsx`: `SkeletonPreset` list rows, `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
In bull's document order.
| Section | Data | HTML | JS | Index | Notes |
| ----------------- | ------ | -------- | ------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| FollowingList | viewer | skeleton | hydrate | no | in `PartBoundary` (framed) › `AuthGuard role="investor"` › `<Suspense>`; each row links to its channel; «بیشتر» loads the next page (`useSuspenseInfiniteQuery`), or `FollowingEmpty`; unfollow freezes offline (0043) |
| ↳ UnfollowConfirm | viewer | none | hydrate | no | mounts when unfollow is tapped |
## Notes
- bull and bear differ only in `layout`.

View File

@ -0,0 +1,30 @@
# Dashboard: plans
`/dashboard/plans` · `apps/{bull,bear}/src/app/(main)/dashboard/(creator)/plans/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)/plans/loading.tsx`: the three cards' skeletons, `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
In bull's document order. Everything sits in `AuthGuard role="creator"`, whose fallback is the three skeletons, so the server HTML is only skeletons.
| Section | Data | HTML | JS | Index | Notes |
| ----------------------------------------- | ------ | -------- | ------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 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 |
## Notes
- bull: cards 12px apart; bear: 16px apart, desktop card layouts. Same sections in both apps.
- The cards' queries run only in the browser: `AuthGuard` returns its fallback on the server, so no `useSuspenseQuery` sends a request from the server.

View File

@ -0,0 +1,32 @@
# Dashboard: all predictions
`/dashboard/predictions/all` · `apps/{bull,bear}/src/app/(main)/dashboard/predictions/all/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 | `dashboard/predictions/all/loading.tsx`: the real top bar (bull) or page title (bear) over `PredictionListSkeleton`, `delayed` |
| First flush | none |
| Canonical | none: `noindex` |
| H1 | bull: none, the bar's «همه پیش‌بینی‌ها» is a `<span>`; bear: «همه پیش‌بینی‌ها» in `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 to `/dashboard/predictions` (0057) and support |
| ↳ Page name (bull) | viewer | skeleton | hydrate | no | the bar shows the name only to a member, so the server HTML holds a skeleton in its place |
| DesktopPageTitle (bear) | config | first flush | hydrate | no | «بازگشت» (`DeskBack`) to `/dashboard/predictions`, then the `<h1>` |
| PredictionList | viewer | skeleton | hydrate | no | in `PartBoundary` › `AuthGuard role="creator"` › `<Suspense>`; status chips in `?status=` (open by default), «بیشتر» loads the next page (`useSuspenseInfiniteQuery`) |
| ↳ ClosePredictionSheet | viewer | none | interaction | no | `next/dynamic`, rendered on the first «بستن زودهنگام» tap of an open card |
## Notes
- Not in the `(creator)` group, so it has neither the tabs nor the dashboard heading. Its own `layout.tsx` is only `OnboardingGuard`, which sends a creator who hasn't finished step 5 to onboarding once the browser knows the viewer (0016), and renders nothing itself.
- bear's `PartBoundary` is `framed`; bull's isn't.
- Debt: bull has no `<h1>` and its page name is a skeleton until the viewer is known, while bear's `<h1>` is server HTML, `apps/bull/src/app/(main)/dashboard/predictions/all/page.tsx:30`. Render the pushed page's name in the bar's server HTML as an `<h1>`, as bear does.

View File

@ -0,0 +1,31 @@
# Dashboard: predictions
`/dashboard/predictions` · `apps/{bull,bear}/src/app/(main)/dashboard/(creator)/predictions/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)/predictions/loading.tsx`: `PredictionsTabSkeleton`, `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
In bull's document order. Everything sits in `AuthGuard role="creator"`, whose fallback is `PredictionsTabSkeleton`.
| Section | Data | HTML | JS | Index | Notes |
| --------------------------------------- | ------ | -------- | ----------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| PredictionsTab | viewer | skeleton | hydrate | no | `useQuery` for open and closed; before the first prediction, only the empty state with «پیش‌بینی جدید» to `/compose/prediction` (J10-3c) |
| ↳ TrackRecord | viewer | skeleton | hydrate | no | the record or its progress to public; own `PartBoundary` and `<Suspense>` |
| ↳ PredictionSection «باز» | viewer | skeleton | hydrate | no | every open prediction as `OwnPredictionCard`; not drawn when empty; loads and fails on its own |
| ↳↳ ClosePredictionSheet | viewer | none | interaction | no | `next/dynamic`, rendered on the first «بستن زودهنگام» tap; its price poll loads with it |
| ↳ PredictionSection «بسته‌شده‌های اخیر» | viewer | skeleton | hydrate | no | the two closed most recently; then «همه پیش‌بینی‌ها», an `<a href>` to `/dashboard/predictions/all` |
## Notes
- bull and bear differ only in `layout` (card and sheet placement). A card's tap opens its post.
- `/dashboard/predictions/all` is a separate page outside the `(creator)` group, under its own `OnboardingGuard` layout: [dashboard-predictions-all.md](dashboard-predictions-all.md).

View File

@ -0,0 +1,31 @@
# Pricing editor
`/dashboard/pricing` · `apps/{bull,bear}/src/app/(flow)/dashboard/pricing/page.tsx` · Type: account · Layout: [layout.md](layout.md)
| Field | Value |
| ----------- | ----------------------------------------------------------------------------------------------------------------- |
| Robots | `noindex` (page `metadata`) |
| Status | `200` for every viewer: a guest goes to login in the browser, an investor sees `AuthGuard`'s no-access state |
| loading.tsx | `dashboard/pricing/loading.tsx`: bull: the bar; bear: the header and title; then `PricingFormSkeleton`, `delayed` |
| First flush | none |
| Canonical | none: `noindex` |
| H1 | bull: none (the bar's name isn't a heading); bear: `DesktopPageTitle`, `pricing:title` |
| JSON-LD | none |
| Scripts | none beyond the layout's |
## Sections
In bull's document order. `dashboard/pricing/layout.tsx` is only `OnboardingGuard` (0016): it renders nothing, and sends a creator who hasn't finished step 5 to the creator profile (C7 sits in `(flow)`, 0034).
| 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) |
| PricingEditor's bar: MobileTopBar (bull) or DesktopPageTitle (bear) | config | first flush | hydrate | no | back to `/dashboard/plans` (R14); with unsaved changes, back and any in-app link open the leave sheet (`useLeaveGuard`, J10-4n) |
| PricingForm | viewer | skeleton | hydrate | no | `PartBoundary`, then `AuthGuard role="creator"` and `<Suspense>`, both with `PricingFormSkeleton`; `usePricingPage`'s `useSuspenseQuery` runs only in the browser; tier cards, the promotion block and save; the 7-day lock keeps standing prices read-only (0036) |
| ↳ DateTimeDialog | — | none | hydrate | no | the promotion's Shamsi date and time with island `Select`s (0035); mounts on open |
| ↳ ConfirmDialog, leave sheet | — | none | hydrate | no | mount on save and on leaving with changes |
## Notes
- bull: the form pads itself and pins save to the bottom; bear: the form in the 560 column.
- Debt: different H1 per app. bull has no `h1`; add a screen-reader `h1` to `PricingEditor`'s mobile branch (`platforms/market/src/app/screens/(flow)/dashboard/pricing/organisms/pricing-editor/PricingEditor.tsx`, the `MobileTopBar` return).

View File

@ -0,0 +1,29 @@
# Dashboard: subscriptions
`/dashboard/subscriptions` · `apps/{bull,bear}/src/app/(main)/dashboard/(investor)/subscriptions/page.tsx` · Type: account · Layout: [layout-dashboard-investor.md](layout-dashboard-investor.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, a creator sees `AuthGuard`'s page-size no-access state |
| loading.tsx | `(investor)/subscriptions/loading.tsx`: `SkeletonPreset` list of cards, `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
In bull's document order.
| Section | Data | HTML | JS | Index | Notes |
| ---------------- | ------ | -------- | ------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SubscriptionList | viewer | skeleton | hydrate | no | in `PartBoundary size="page"` › `AuthGuard role="investor"` › `<Suspense>`; active and expired subscriptions from two browser reads (`useSuspenseQueries`), or `SubscriptionsEmpty` |
| ↳ RenewalSheet | viewer | none | hydrate | no | mounts when renew or reactivate opens, also from `?reactivate=<id>`; its form has its own `PartBoundary` and `<Suspense>`; bull: a bottom sheet; bear: a modal |
| ↳ SupportDialog | — | none | hydrate | no | mounts when a subscription's support entry opens |
## Notes
- bull's skeleton cards are `md`, bear's `lg`; the list differs only in `layout`.
- A failed read replaces the list with the page-size error; the tabs stay (U2 ۳.۴).

View File

@ -0,0 +1,28 @@
# Dashboard: transactions
`/dashboard/transactions` · `apps/{bull,bear}/src/app/(main)/dashboard/(investor)/transactions/page.tsx` · Type: account · Layout: [layout-dashboard-investor.md](layout-dashboard-investor.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, a creator sees `AuthGuard`'s page-size no-access state |
| loading.tsx | `(investor)/transactions/loading.tsx`: `SkeletonPreset` list rows without avatars, `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
In bull's document order.
| Section | Data | HTML | JS | Index | Notes |
| ------------------- | ------ | -------- | ------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| TransactionList | viewer | skeleton | hydrate | no | in `PartBoundary size="page"` › `AuthGuard role="investor"` › `<Suspense>`; status chips in `?status=`, «بیشتر» loads the next page (`useSuspenseInfiniteQuery`), or `TransactionsEmpty` |
| ↳ TransactionDetail | viewer | none | hydrate | no | mounts when a row opens |
## Notes
- bull and bear differ only in `layout`.
- A failed read replaces the list, without the chips; the tabs stay (U4 ۴.۳).

35
docs/pages/market/feed.md Normal file
View File

@ -0,0 +1,35 @@
# خانه (home feed)
`/feed` · `apps/{bull,bear}/src/app/(main)/feed/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 and a creator to their channel, in the browser |
| loading.tsx | `(main)/feed/loading.tsx`: the frame and three post skeletons |
| First flush | none: the page entry reads nothing; the feed is read in the browser with the session |
| Canonical | none |
| H1 | none in either app: bull's tab bar has no title, bear's column has no heading |
| 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 | the tab bar (`isTab`): brand and support |
| ↳ Bell, account avatar or login link (bull) | viewer | skeleton | hydrate | no | an invisible «ورود/ثبت‌نام» holds the place until the viewer is known |
| HomeGuard | viewer | skeleton | hydrate | no | `HomeFeedSkeleton` until the viewer is known; a creator is replaced to `homeRoute`, a guest goes to login via `AuthGuard role="investor"` |
| HomeFeed | query | skeleton | hydrate | no | `useSuspenseInfiniteQuery(feedKeys.home())` inside `<Suspense>` and `PartBoundary name="home-feed"`; bear: `framed` |
| ↳ FeaturedRow | query | skeleton | hydrate | no | `useFeaturedCreatorsPart`, prefetched beside the feed; links to `/analysts` |
| ↳ ChannelPostCard list | query | skeleton | hydrate | no | each card links its post and channel; «بیشتر» loads the next page on click |
| ↳ HomeFeedEmpty, FeaturedMore | query | skeleton | hydrate | no | the featured analysts to follow while the viewer follows nobody |
| ↳ PostLightbox | — | none | interaction | no | `next/dynamic`, rendered on the first image tap |
| InstallPrompt (bull) | viewer | none | hydrate | no | the install sheet once for a signed-in investor, 30-day snooze (0047) |
## Notes
- bear: `@modal/feed/page.tsx` renders null, so a «پست جدید» dialog closes when a navigation lands on خانه (0023).
- Debt: no H1 in either app. Give the page an `sr-only` H1, as `GeneralRules` does.

43
docs/pages/market/home.md Normal file
View File

@ -0,0 +1,43 @@
# Landing
`/` · `apps/{bull,bear}/src/app/(landing)/page.tsx` · Type: home · Layout: [layout.md](layout.md)
| Field | Value |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Robots | `index` |
| Status | `200`; prerendered with `force-static` and `revalidate = 600` (0026), so a failed revalidation keeps serving the last good page |
| loading.tsx | `none`: the whole landing is in the first flush (0070) |
| First flush | `loadLandingPage()` → `getFeaturedCreators()`, awaited by the page entry at build and at each revalidation; the metadata is fixed, in the `metadata` export (`landingMetadata`) |
| Canonical | `/`, from `landingMetadata` |
| H1 | `landing:hero.title` from i18n, in `LandingHero` |
| JSON-LD | `faqJsonLd(faqEntries(labels.faq))`: `FAQPage`, a raw `<script type="application/ld+json">` after the template |
| Scripts | none |
## Sections
In bull's document order. The header and footer belong to `LandingTemplate`, not a layout.
| Section | Data | HTML | JS | Index | Notes |
| ------------------------ | ----------------------- | ----------- | ------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| LandingHeader | config | first flush | none | no | brand `<a href="#top">`, login `<a href>` to `/auth/login` |
| ↳ Section links (bear) | config | first flush | none | no | in-page `#fragment` links to the bands |
| ↳ SupportEntry | config | first flush | hydrate | no | the icon trigger; its `SupportDialog` mounts closed, bull: bottom sheet, bear: popover |
| LandingHero, with the H1 | config | first flush | none | primary | register `<a href>` (investor) and `#how` |
| LandingTrust | config | first flush | none | secondary | |
| LandingMarkets | config | first flush | hydrate | secondary | `MarketTabs`: every panel in the DOM, closed ones `hidden`; sample data at the fixed `SAMPLE_NOW` |
| FeaturedAnalysts | `getFeaturedCreators()` | first flush | hydrate | primary | an `AnalystCard` `<a href>` per channel, the landing's only links to channels; `AnalystCarousel` only scrolls; left out, with its header link, below `FEATURED_MIN_COUNT` |
| LandingRecord | config | first flush | none | secondary | sample track record at `SAMPLE_NOW` |
| LandingSteps | config | first flush | none | secondary | |
| LandingPlans | config | first flush | hydrate | secondary | a sample locked `PostCard` as a guest sees it; its share popover is the client leaf |
| LandingForAnalysts | config | first flush | none | secondary | apply `<a href>` to creator registration |
| LandingFaq | config | first flush | hydrate | primary | `<details>`, every answer in the DOM, the first open; the support link is the client leaf |
| LandingClosing | config | first flush | none | secondary | register and login `<a href>` |
| LandingFooter | config | first flush | none | primary | `#fragment` links, `/terms/subscription`, Bale and Telegram chats |
| LandingRedirect | viewer | none | hydrate | no | renders nothing; sends a member to `homeRoute` with `router.replace` (0027) |
## Notes
- 0070: the landing is the only page whose content the server renders; every other page reads its data in the browser.
- bull: `layout="mobile"`; bear: `layout="desktop"`, which adds the header's section links and opens support as a popover. Both apps hold the same primary and secondary sections.
- `force-static` contradicts the skill's "never static rendering"; accepted decision 0026 overrides it. The page reads no session, so the prerender is the same for every visitor.
- Debt: `FAQPage` markup (`platforms/market/src/app/seo/landing.ts:31`), which Google no longer shows; the home page gets `Organization` and `WebSite` from config instead. The graph is a raw `Element` script after the template (`apps/{bull,bear}/src/app/(landing)/page.tsx:58`), not one `<JsonLd>` before it: the repo has no json-ld lib or island `JsonLd` yet.

View File

@ -0,0 +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
| 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 |
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 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

@ -0,0 +1,17 @@
# Layout: dashboard (investor)
`apps/{bull,bear}/src/app/(main)/dashboard/(investor)/layout.tsx` · wraps `/dashboard/subscriptions`, `/dashboard/transactions` and `/dashboard/following` · it awaits no read, so it adds nothing to any page's first flush; it sits outside each section's `loading.tsx`, so the bar and the tabs stay while a section loads
| Section | Data | HTML | JS | Index | Notes |
| -------------------------------------------- | ------ | ----------- | ------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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 | island `TabLinks`, an `<a href>` per section «اشتراک‌ها» · «تراکنش‌ها» · «دنبال‌شده‌ها» (0025); the active one comes from `usePathname`, so the server HTML already marks it |
Scripts: none beyond the root layout's.
## Notes
- No guard in the layout: each page's `AuthGuard role="investor"` sends a guest to login and shows a creator the page-size no-access state, under these tabs. A creator's داشبورد is [layout-dashboard-creator.md](layout-dashboard-creator.md); the two groups' URLs don't overlap.
- Debt: bull has no `<h1>` (the bar's «داشبورد» is a `<span>`), bear has one, `apps/bull/src/app/(main)/dashboard/(investor)/layout.tsx:21`. Same fix as the creator layout.

View File

@ -0,0 +1,28 @@
# Layout: main
`apps/{bull,bear}/src/app/(main)/layout.tsx` · wraps every page in `(main)` · it reads nothing on the server, so it holds no page's first byte; `force-dynamic` (0026) · inside [layout.md](layout.md)
| Section | Data | HTML | JS | Index | Notes |
| ------------------------------------ | ------ | ----------- | ----------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| DesktopHeader (bear) | config | first flush | hydrate | no | sticky; holds the NetworkBar under it in the same sticky box |
| ↳ Brand link (bear) | viewer | first flush | hydrate | no | `useHomeHref`: `/feed` while the viewer is unknown (so in the server HTML), `/` for a guest, `homeRoute` for a member |
| ↳ Nav: خانه or کانال, داشبورد (bear) | viewer | none | hydrate | no | members only; `HeaderNavLink` is `next/link` |
| ↳ SearchField (bear) | viewer | none | hydrate | no | investors only, not on `/search`; Enter calls `router.push('/search?q=…')` |
| ↳ PublishMenu (bear) | viewer | none | hydrate | no | creators only; «پست جدید» and «پیش‌بینی جدید» open the `@modal` intercepts (0023) |
| ↳ SupportEntry (bear) | config | first flush | hydrate | no | the icon trigger; its `SupportDialog` popover renders only while open |
| ↳ NotificationBell (bear) | viewer | none | hydrate | no | members only; the unread count is a browser `useQuery` |
| ↳ NotificationPanel (bear) | query | none | interaction | no | the bell's side panel: `next/dynamic` with `ssr: false`, mounted on the bell's first click |
| ↳ Login button or AccountMenu (bear) | viewer | skeleton | hydrate | no | while the viewer is unknown, an invisible «ورود/ثبت‌نام» holds the place; a guest gets the login link, a member the account menu |
| `@modal` slot (bear) | — | none | interaction | no | `@modal/default.tsx` renders null; the `(.)compose/*` intercepts load with a soft navigation to `/compose/*`; `@modal/feed` and `@modal/channels/[username]` are null pages that empty the slot |
| BottomNav (bull) | viewer | none | hydrate | no | members only, not in a creator's preview; nothing renders until the viewer is known, and the bar is fixed, so nothing moves; a creator's middle tab is PublishMenu |
Scripts: none.
## Notes
- Each page brings its own top bar: bull's `MobileTopBar`, bear's `DeskBack`, `DesktopPageTitle` or `PageHeader`. They are rows of the page docs.
- bull and bear build separately, so a client component that one app renders never ships to the other.
- `apps/bear/src/app/(main)/default.tsx` is the `children` default: when a soft navigation lands on a `@modal` intercept with no main page under it, it reloads the URL so the full `/compose/*` page renders.
- A failed page shows `(main)/error.tsx`: `PageError` with the page's own bar (0049); bull keeps the BottomNav under it.
- Debt: the server HTML links the brand to `/feed`, a `noindex` page behind `AuthGuard`, on every main page (`platforms/market/src/app/navigation/hooks/use-home-href.ts:18`). Low priority since 0070 made every `(main)` page `noindex`. Link `/` while the viewer is unknown; `LandingRedirect` sends a member on (0027).
- Debt: the header search is not a `GET` form to `/search`, so it does nothing before hydration (`platforms/market/src/app/navigation/components/desktop-header/DesktopHeader.tsx:46`). It is member-only, so the cost is low.

View File

@ -0,0 +1,16 @@
# Layout: terms
`apps/{bull,bear}/src/app/(flow)/terms/layout.tsx` · wraps `/terms` and `/terms/subscription` · it awaits no read: its text is server i18n (`rules`), so it adds nothing to the first byte
| Section | Data | HTML | JS | Index | Notes |
| ------------------------------------ | ------ | ----------- | ------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| MobileTopBar (bull) | viewer | skeleton | hydrate | no | back to where the rules were opened, and support, in the first flush; the title «قوانین لومینا» waits for the viewer |
| DesktopHeader (bear) | viewer | skeleton | hydrate | no | brand `<a href>` and support in the first flush; nav, bell, account menu and login wait for the viewer ([layout-main.md](layout-main.md)) |
| DesktopPageTitle, with the H1 (bear) | config | first flush | hydrate | no | «بازگشت» and the H1 `rules:title`; bull puts its H1 in each page instead |
| RulesTabs | config | first flush | hydrate | no | `TabLinks`: `<a href>` to `/terms` and `/terms/subscription`; `usePathname` marks the current tab |
Scripts: none.
- (flow) adds `force-dynamic` and no UI. The layout's static `metadata` gives `rules:meta-title` and `rules:meta-description`; each page overrides them.
- bull: a white page with no bottom nav; bear: `DesktopHeader` over the 640px column, since (flow) has no header of its own.
- Debt: bear's H1 lives here, so `/terms/subscription` gets «قوانین لومینا» on bear and «شرایط اشتراک» on bull (`apps/bear/src/app/(flow)/terms/layout.tsx:40`). Pass each page's own title to `DesktopPageTitle`, or render the H1 in the page as bull does.

View File

@ -0,0 +1,21 @@
# Layout: root
`apps/{bull,bear}/src/app/layout.tsx` · wraps every page of both apps · it awaits no read, so it adds nothing to any page's first flush and can't answer 500 on its own
| Section | Data | HTML | JS | Index | Notes |
| ----------------------------------------------- | ------ | ----------- | ------- | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `<html lang dir>` and the critical font preload | config | first flush | none | no | `lang` and `dir` from the app's server i18n; only `CRITICAL_FONT_URL` is preloaded (0011) |
| AppProviders › AppShell | — | first flush | hydrate | no | the client bootstrap, query client, i18n, and the browser-only hooks: `useSession` (the viewer is read once per load, so every auth-dependent part waits in its skeleton), `useSuspendedHalt`, `useSettleAbandonedPayment` (0033), `usePwa` (0047), and the persisted drafts' rehydrate |
| ↳ NetworkBoundary › NetworkStatus | — | none | hydrate | no | renders only offline, reconnecting, or after a slow first read; a page's own top bar or header draws it through `NetworkBar` (0040), and this one draws only when no bar registered |
| ToastPlacementMarker (bear) | config | none | hydrate | no | desktop toasts 32px from the bottom (0039) |
| ↳ Toaster | — | none | hydrate | no | sonner's region; empty until an action toasts (0019) |
Scripts: none. No `next/script` in either app or `packages/integrations`.
## Notes
- Metadata: `rootMetadata()` from `apps/*/src/configs/seo.ts` gives `metadataBase`, the title template `%s · <brand>`, and the description; pages add their own title and robots. `htmlLimitedBots: /.*/` keeps all of it in `<head>` (0054).
- Viewport: bull sets `maximumScale: 1` (0056); bear keeps Next.js's default viewport.
- The manifest (`app/manifest.ts`, the same for both apps, 0053) and `/sw.js` (pwa lib) are linked from here. `next.config.ts` 308-redirects `/@username/…` to `/channels/username/…` before any render (0064).
- The `(flow)`, `(auth)` and `(onboarding)` layouts render nothing; they only set `dynamic = 'force-dynamic'` (0026). The `(main)` layout is [layout-main.md](layout-main.md).
- AppShell is a client component around every page, but it adds no `<Suspense>` around `children`, so it doesn't stream any page.

View File

@ -0,0 +1,29 @@
# Not-found and error
`apps/{bull,bear}/src/app/not-found.tsx`, `global-error.tsx`, and each route group's `error.tsx` · Layout: [layout.md](layout.md)
Every case below is `noindex`. No page answers 410, and the repo sets up no reverse proxy, so 503 under overload comes from whatever sits in front of the app's port.
| Case | Status | The server HTML holds |
| ----------------------------------------------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| A URL no route matches | 404 | the root `not-found.tsx`: `noindex` from its `metadata`, `StatusEmptyState` (not-found, page size) in the first flush; bull: the `MobileTopBar` behind a same-size frame; bear: the `DesktopHeader` behind one (both read the address in the browser) |
| `/@username/…` | 308 to `/channels/username/…` | nothing; `redirects()` in `next.config.ts` answers before any render (0064) |
| A channel or post that doesn't exist | 200 | `noindex` and the page's skeleton: the server reads nothing (0070), so the browser's read finds the channel or post missing and renders `ChannelMissing` or `PostMissing` in the page's frame. See [channels-username.md](channels-username.md) and [channels-username-posts-id.md](channels-username-posts-id.md) |
| `notFound()` on any other page, all under a `loading.tsx` | 200 | the skeleton and `noindex`; the not-found UI renders in the browser |
| A failed browser read of a page's data | 200 | the skeleton and the page's `noindex`; the read throws to the group's `error.tsx`, which renders `PageError` with its own `noindex` |
| A failed read on a page with no `loading.tsx` above it | 500 | `noindex` and an empty `<body>`; the group's `error.tsx` renders in the browser. Only the landing reads data on the server, and it is prerendered (0026): a failed revalidation keeps the last good page |
| An error the group boundaries don't catch (root layout, AppShell) | 500 | `global-error.tsx`: its own document with `AppCrash` and `<meta name="robots" content="noindex">`, rendered in the browser |
## Boundaries
| File | Renders |
| ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `(main)/error.tsx` | `PageError` with the page's own bar, derived from the path (0049); bull: `layout="mobile"`, the layout keeps the bottom nav; bear: `layout="desktop"` under the header |
| `(flow)`, `(auth)`, `(onboarding)` `error.tsx` | `PageError` with `standalone`, a full-height page with its own top bar (0049) |
| `(landing)/error.tsx` | `PageError` with `standalone` |
| `global-error.tsx` | `AppCrash`: the brand and the way back, in its own `<html>` with the client bootstrap, styles, and i18n |
## Notes
- `PageError` and `global-error.tsx` render `<meta name="robots" content="noindex">`; the root `not-found.tsx` sets it in `metadata`.
- A missing channel or post answers 200 by design: both pages are `noindex` and read in the browser (0070).

View File

@ -0,0 +1,32 @@
# اعلان‌ها (notification centre)
`/notifications` · `apps/{bull,bear}/src/app/(main)/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)/notifications/loading.tsx`: the bar or title, then list rows |
| First flush | none: the page entry reads nothing; the inbox is read in the browser with the session |
| Canonical | none |
| H1 | bull: none, the top bar's title is a `<span>`; 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 |
| NotificationCentre | viewer, query | skeleton | hydrate | no | `AuthGuard`, then `<Suspense>` and `PartBoundary name="notification-centre"`; `useSuspenseQuery` of the inbox; opening clears the bell (0058); bear: `framed` |
| ↳ FilterChips | viewer | skeleton | hydrate | no | creators only: «همه · پیش‌بینی‌ها · مالی · حساب», filtered in place (0058) |
| ↳ NotificationItem list | query | skeleton | hydrate | no | each row leads to its target; a row stays unread until tapped |
## Notes
- bear's header bell opens the same centre as a side panel; this page serves a direct load or a link.
- Debt: bull has no H1 while bear has one. Give bull an `sr-only` H1 with the same text.

View File

@ -0,0 +1,32 @@
# Onboarding: creator profile done
`/onboarding/creator-profile/done` · `apps/{bull,bear}/src/app/(onboarding)/onboarding/creator-profile/done/page.tsx` · Type: account · Layout: [layout.md](layout.md)
| Field | Value |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Robots | `noindex` (page `metadata`) |
| Status | `200`; a guest is replaced to login and an investor sees the no-access state, in the browser (`AuthGuard role="creator"`); an incomplete profile goes back to `/onboarding/creator-profile` in the browser |
| loading.tsx | `apps/{bull,bear}/src/app/(onboarding)/onboarding/creator-profile/done/loading.tsx` |
| First flush | `none` |
| Canonical | none set |
| H1 | `auth:register.profile.done.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 `<a href="/feed">` and support |
| AuthTemplate header (bear) | config | first flush | none | no | brand `<a href="/feed">`; the step in the 560 card |
| 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 |
| CreatorProfileDoneStep | viewer, query | skeleton | hydrate | no | `AuthGuard` fallback, then `<Suspense>` with `CreatorProfileDoneStepSkeleton` while `useSuspenseQuery(profileKeys.mine())` loads in the browser; result panel with the pending verification badge, next-steps list |
| ↳ Actions | query | skeleton | hydrate | no | `<a href>` to the channel or `?redirect=`, and to `/dashboard/pricing`; support link |
## Notes
- Decision 0015 (proposed): the end of registration has its own route because its frame differs from the form's.
- The `<Suspense>` sits inside `AuthGuard`, so the query runs only in the browser. Focus moves to the heading.

View File

@ -0,0 +1,36 @@
# Onboarding: creator profile
`/onboarding/creator-profile` · `apps/{bull,bear}/src/app/(onboarding)/onboarding/creator-profile/(form)/page.tsx` · Type: account · Layout: [layout.md](layout.md)
| Field | Value |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Robots | `noindex` (page `metadata`) |
| Status | `200`; a guest is replaced to `/auth/login?redirect=` and an investor sees the page-size no-access state, both in the browser (`AuthGuard role="creator"`) |
| loading.tsx | `apps/{bull,bear}/src/app/(onboarding)/onboarding/creator-profile/(form)/loading.tsx` |
| First flush | `none` |
| Canonical | none set |
| H1 | `auth:register.profile.creator.title` in `ProfileForm`; 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 | `auth:register.header` only: no back, no brand |
| AuthTemplate header (bear) | config | first flush | none | no | brand `<a href="/feed">`; `framed={false}`, so form and preview sit side by side |
| 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 |
| CreatorProfileStep | viewer, query | skeleton | hydrate | no | `AuthGuard` fallback, then `<Suspense>` with the same `CreatorProfileStepSkeleton` while `useSuspenseQuery(profileKeys.mine())` loads the draft in the browser |
| ↳ ProfileForm | query | skeleton | hydrate | no | resume banner, `RegisterProgress`, H1, photo, fields; autosaves the draft (`PATCH`, proposed 0014); «تکمیل ثبت‌نام» opens `/onboarding/creator-profile/done` |
| ↳ SaveStatus | query | skeleton | hydrate | no | the autosave state beside the submit button |
| ↳ ProfilePreview (bull) | query | none | hydrate | no | in a `Sheet` opened by «پیش‌نمایش»; mounts when open |
| ↳ ProfilePreview (bear) | query | skeleton | hydrate | no | live preview card in the aside, beside the form |
## Notes
- The `(onboarding)` layout renders nothing; it only sets `dynamic = 'force-dynamic'`.
- The `<Suspense>` sits inside `AuthGuard`, a client component that returns its fallback on the server, so the query never runs on the server.
- A creator who already finished goes on to their channel or `?redirect=` behind the skeleton.

View File

@ -0,0 +1,31 @@
# Onboarding: investor profile
`/onboarding/investor-profile` · `apps/{bull,bear}/src/app/(onboarding)/onboarding/investor-profile/page.tsx` · Type: account · Layout: [layout.md](layout.md)
| Field | Value |
| ----------- | ------------------------------------------------------------------------------------------------------------------------ |
| Robots | `noindex` (page `metadata`) |
| Status | `200`; a guest is replaced to login and a creator sees the no-access state, in the browser (`AuthGuard role="investor"`) |
| loading.tsx | `apps/{bull,bear}/src/app/(onboarding)/onboarding/investor-profile/loading.tsx` |
| First flush | `none` |
| Canonical | none set |
| H1 | `auth:register.profile.investor.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 | `auth:register.header` only: no back, no brand |
| AuthTemplate header (bear) | config | first flush | none | no | brand `<a href="/feed">`; the step in the 560 card |
| 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 |
| InvestorProfileStep | viewer | skeleton | hydrate | no | `AuthGuard` fallback `InvestorProfileStepSkeleton`; optional step: `RegisterProgress`, H1, photo, market chips, «ذخیره و ورود» and «بعداً», both to `?redirect=` or `/feed` |
## Notes
- No read: the step starts from the auth store's account, so it has no `<Suspense>`.
- The `(onboarding)` layout renders nothing; it only sets `dynamic = 'force-dynamic'`.

View File

@ -0,0 +1,30 @@
# Payment result
`/payment/result/[paymentId]` · `apps/{bull,bear}/src/app/(flow)/payment/result/[paymentId]/page.tsx` · Type: cart and checkout · Layout: [layout.md](layout.md)
| Field | Value |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------- |
| Robots | `noindex` (page `metadata`) |
| Status | `200` for every viewer and every id: a failed first read (an unknown payment, another account's) shows the part's `PartBoundary` |
| loading.tsx | `payment/result/[paymentId]/loading.tsx`: bull: the bar; bear: the header and «بازگشت»; then `PaymentResultSkeleton`, `delayed` |
| First flush | none: the page entry awaits only `params` |
| Canonical | none: `noindex` |
| H1 | none in either app: `ResultHead` is an `h2` |
| JSON-LD | none |
| Scripts | none beyond the layout's |
## Sections
In bull's document order. Every payment ends here (0029).
| Section | Data | HTML | JS | Index | Notes |
| -------------------- | ------ | ----------- | ------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| MobileTopBar (bull) | config | first flush | hydrate | no | `payment:result.title`; back to `/dashboard/subscriptions` until the payment loads, then to the channel paid for (`useBackTarget`, R14), never to the bank |
| DesktopHeader (bear) | viewer | first flush | hydrate | no | rows as in [layout-main.md](layout-main.md) |
| DeskBack (bear) | config | first flush | hydrate | no | the same targets as bull's back |
| PaymentResult | viewer | skeleton | hydrate | no | `PartBoundary`, then `AuthGuard role="investor"` with `PaymentResultSkeleton`; `usePaymentResultPage` reads the payment in the browser; while the bank settles it reads again every 2 s, up to 30 s with the return page's reads; success, failed or in review, with the receipt, the bank's reference to copy, the note, and support on a failure or review |
| ↳ ResultActions | viewer | skeleton | hydrate | no | the two ways on; bull: pinned to the bottom; bear: in the 480 panel |
## Notes
- Debt: no `h1` in either app. Make `ResultHead`'s heading the `h1` (`platforms/market/src/app/screens/(flow)/payment/result/[paymentId]/organisms/payment-result/components/ResultHead.tsx:30`).

View File

@ -0,0 +1,28 @@
# Payment return
`/payment/return` · `apps/{bull,bear}/src/app/(flow)/payment/return/page.tsx` · Type: cart and checkout · Layout: [layout.md](layout.md)
| Field | Value |
| ----------- | --------------------------------------------------------------------------------------------------------------- |
| Robots | `noindex` (page `metadata`) |
| Status | `200`; without `?paymentId=`, the browser replaces the page with `/dashboard/transactions` |
| loading.tsx | `payment/return/loading.tsx`: the confirming screen itself, so nothing else shows on the way back from the bank |
| First flush | none: the page entry awaits only `searchParams` |
| Canonical | none: `noindex` |
| H1 | `PaymentConfirming`, `payment:confirm.title`, in both apps |
| JSON-LD | none |
| Scripts | none beyond the layout's |
## Sections
In bull's document order. Where the API's bank callback returns the browser (0029).
| Section | Data | HTML | JS | Index | Notes |
| ----------------- | ------ | ----------- | ------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| PaymentConfirming | config | first flush | none | no | «در حال تأیید پرداخت...»: full screen and centred, a spinner, the `h1` and the description; no bar, header or link (U10 ۱.۱); the same screen is `AuthGuard`'s fallback and `PaymentReturn`'s children, so nothing changes while the viewer and the payment load |
| PaymentReturn | viewer | none | hydrate | no | renders nothing of its own: `usePaymentReturnPage` polls the payment in the browser until it settles, for 30 s at most, then replaces this page with `/payment/result/[paymentId]`; a failed read keeps polling; its own `PartBoundary` |
## Notes
- bear has no `DesktopHeader` here: both apps show only the confirming screen.
- `AuthGuard role="investor"` sends a guest to login with a return path, so the payment is still read after sign-in.

View File

@ -0,0 +1,34 @@
# جستجو (analyst search)
`/search?q=` · `apps/{bull,bear}/src/app/(main)/search/page.tsx` · Type: search results · Layout: [layout-main.md](layout-main.md), [layout.md](layout.md)
| Field | Value |
| ----------- | ------------------------------------------------------------------------------------------------------ |
| Robots | `noindex` (page `metadata`); not blocked, since no app has `robots.ts` |
| Status | `200` for every query; a guest is sent to login and a creator gets the no-access state, in the browser |
| loading.tsx | `(main)/search/loading.tsx`: the frame, the field and featured-analyst cards |
| First flush | none: the page entry reads nothing; the search runs in the browser |
| Canonical | none |
| H1 | bull: none, the tab bar's «جستجو» is a `<span>`; bear: `PageHeader` «جستجو» |
| 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 | the tab bar with «جستجو» centred, no back |
| ↳ Bell, account avatar or login link (bull) | viewer | skeleton | hydrate | no | |
| DeskBack, PageHeader (bear) | config | first flush | hydrate | no | «بازگشت» then the H1; the header's search field opened the page, so it is pushed |
| SearchPanel | viewer, query | skeleton | hydrate | no | `AuthGuard role="investor"`, then `<Suspense>` and `PartBoundary name="search"`; bear: `framed` |
| ↳ SearchField | — | skeleton | hydrate | no | the query lives in `?q=` (`useSearchPage`), so back from a channel restores the results |
| ↳ RecentSearches | viewer | skeleton | hydrate | no | under 2 characters; the persisted `recent-searches` store |
| ↳ SearchFeatured | query | skeleton | hydrate | no | under 2 characters; the featured analysts |
| ↳ SearchResults, SearchNoResults | query | skeleton | hydrate | no | `useCreatorSearchPart`; each card links its channel; a failed search is a part-size `ErrorFallback` with retry |
## Notes
- Search is for signed-in investors, not crawlers: every analyst's channel is reachable from `/analysts` and from post pages.
- Debt: bull has no H1 while bear has one. Render the `PageHeader` title as an `sr-only` H1 in bull too.

View File

@ -0,0 +1,28 @@
# Subscription terms
`/terms/subscription` · `apps/{bull,bear}/src/app/(flow)/terms/subscription/page.tsx` · Type: static and policy · Layout: [layout-terms.md](layout-terms.md), [layout.md](layout.md)
| Field | Value |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| Robots | `noindex` (`terms` layout `metadata`, 0071) |
| Status | `200` |
| loading.tsx | `apps/{bull,bear}/src/app/(flow)/terms/subscription/loading.tsx` (debt, Notes) |
| First flush | none: config, server i18n (`terms`, `auth`) and `getEnv().supportHours` |
| Canonical | none: `noindex` |
| H1 | bull: `terms:title` «شرایط اشتراک», screen-reader-only, in `SubscriptionTerms`; bear: `rules:title` «قوانین لومینا» from the layout (debt) |
| JSON-LD | none |
| Scripts | none |
## Sections
In bull's document order.
| Section | Data | HTML | JS | Index | Notes |
| ------------------------- | ------ | ----------- | ---- | ----- | ---------------------------------------------------------------------------------------------- |
| SubscriptionTerms | config | first flush | none | no | one `<section>` per term with its heading; bear: in a `Card` |
| ↳ Support hours and chats | config | first flush | none | no | island `SupportSheet` rows: `<a href>` to the Bale and Telegram chats, inside the last section |
## Notes
- The landing footer links here; checkout, a suspended card and the support sheet open it too.
- Debt: the H1 differs between the apps ([layout-terms.md](layout-terms.md)).

View File

@ -0,0 +1,24 @@
# General rules
`/terms` · `apps/{bull,bear}/src/app/(flow)/terms/page.tsx` · Type: static and policy · Layout: [layout-terms.md](layout-terms.md), [layout.md](layout.md)
| Field | Value |
| ----------- | ------------------------------------------------------------------------------------------------------ |
| Robots | `noindex` (`terms` layout `metadata`, 0071) |
| Status | `200` |
| loading.tsx | `apps/{bull,bear}/src/app/(flow)/terms/loading.tsx` (debt, Notes) |
| First flush | none: config and server i18n (`rules`) |
| Canonical | none: `noindex` |
| H1 | `rules:title`; bull: a screen-reader-only H1 in `GeneralRules`; bear: `DesktopPageTitle` in the layout |
| JSON-LD | none |
| Scripts | none |
## Sections
In bull's document order.
| Section | Data | HTML | JS | Index | Notes |
| ------------ | ------ | ----------- | ---- | ----- | ---------------------------------------------------------------------------------------- |
| GeneralRules | config | first flush | none | no | one `<section>` per rule with its heading, then the last-updated line; bear: in a `Card` |
## Notes

View File

@ -0,0 +1,26 @@
# Analyst
`/analysts/[id]` · `apps/wall-street-plaza/src/app/(panel)/analysts/[id]/page.tsx` · Type: account (back office) · Layout: [layout-panel.md](layout-panel.md)
| Field | Value |
| ----------- | ------------------------------------------------------------------------------------------------------------------ |
| Robots | `noindex` (root layout `metadata`, `src/configs/seo.ts`) |
| Status | `200`, also for an unknown id: the browser read's 404 shows the not-found state in the page's `PartBoundary` |
| loading.tsx | `(panel)/analysts/[id]/loading.tsx` |
| First flush | none; the page entry awaits only `params` |
| Canonical | none |
| H1 | in the browser, the analyst's `fullName` (`AnalystDetail`); the server HTML's skeleton has `analysts:detail.title` |
| JSON-LD | none |
| Scripts | none |
## Sections
One read, `useAnalystDetailPage(id)` with `useSuspenseQuery`, fills every row. `AdminGuard` › `PartBoundary` › `<Suspense>`, all with `DetailSkeleton`: a `PageHeader` with the generic title and the back link, over two card skeletons.
| Section | Data | HTML | JS | Index | Notes |
| ---------------------------------------------- | ----- | -------- | ------- | ----- | ---------------------------------------------------------------------------------------------------------------------- |
| PageHeader, with the H1 | query | skeleton | hydrate | no | the name, `@username`, the back link to `/analysts`; desktop: the account states and the one account action at its end |
| AccountBadges and AccountActionButton (mobile) | query | skeleton | hydrate | no | `desktop:hidden`; full width under the title |
| AnalystFacts | query | skeleton | hydrate | no | the 432px column on desktop |
| AuditLog | query | skeleton | hydrate | no | garden-roof `screens/AuditLog`, beside the facts on desktop |
| AccountDialogs | query | none | hydrate | no | suspend and reinstate, mounted only while open; the page updates in place |

View File

@ -0,0 +1,28 @@
# Analysts
`/analysts` · `apps/wall-street-plaza/src/app/(panel)/analysts/page.tsx` · Type: account (back office) · Layout: [layout-panel.md](layout-panel.md)
| Field | Value |
| ----------- | -------------------------------------------------------------- |
| Robots | `noindex` (root layout `metadata`, `src/configs/seo.ts`) |
| Status | `200`; a search with no match shows the empty state with `200` |
| loading.tsx | `(panel)/analysts/loading.tsx` |
| First flush | none |
| Canonical | none |
| H1 | `analysts:list.title` from i18n, in `PageHeader` |
| JSON-LD | none |
| Scripts | none |
## Sections
| Section | Data | HTML | JS | Index | Notes |
| ----------------------- | ------ | ----------- | ------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| PageHeader, with the H1 | config | first flush | none | no | |
| AnalystsList | — | skeleton | hydrate | no | `AdminGuard` › `<Suspense>`; both fallbacks are `ListSkeleton` (the table preset) |
| ↳ SearchField | — | skeleton | hydrate | no | the search in the URL |
| ↳ AnalystRows | query | skeleton | hydrate | no | `useSuspenseQuery` behind its own `<Suspense>` and a `PartBoundary` keyed by search and page; each row an `<a href>` to `/analysts/[id]`, and the row activates on click |
| ↳ AccountDialogs | query | none | hydrate | no | suspend and reinstate, mounted only while open; the rows reload under them |
## Notes
- Debt: the guard's fallback (`analysts/page.tsx:16`, `ListSkeleton`) has no box for the search field that `AnalystsList` draws above the table, so the table moves down when the admin is known. Give the fallback the search field's box.

View File

@ -0,0 +1,32 @@
# Featured analysts
`/featured` · `apps/wall-street-plaza/src/app/(panel)/featured/page.tsx` · Type: account (back office) · Layout: [layout-panel.md](layout-panel.md)
| Field | Value |
| ----------- | ------------------------------------------------------------ |
| Robots | `noindex` (root layout `metadata`, `src/configs/seo.ts`) |
| Status | `200`; no featured analysts shows the empty state with `200` |
| loading.tsx | `(panel)/featured/loading.tsx` |
| First flush | none |
| Canonical | none |
| H1 | `featured:page.title` from i18n, in `PageHeader` |
| JSON-LD | none |
| Scripts | none |
## Sections
| Section | Data | HTML | JS | Index | Notes |
| --------------------------------------- | ------ | ----------- | ------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| PageHeader, with the H1 | config | first flush | none | no | the title and what the order drives |
| ↳ AddFeaturedButton | config | first flush | hydrate | no | a link to `/featured?add=1`, so a reload keeps the dialog open |
| FeaturedList | query | skeleton | hydrate | no | `AdminGuard` › `PartBoundary` › `<Suspense>`, all with `FeaturedSkeleton` (the table and three cards); `useFeaturedPage` with `useSuspenseQuery` |
| ↳ FewerBanner | query | skeleton | hydrate | no | only while fewer than three analysts are visible |
| ↳ FeaturedTable, or EmptyState | query | skeleton | hydrate | no | reorder by drag, keyboard or the row menu, saved on drop, with no drag library |
| ↳ PageVisibility | query | skeleton | hydrate | no | only while fewer than three are visible |
| ↳ FeaturedPreview | query | skeleton | hydrate | no | the first three visible cards, drawn by island's `AnalystCard` as the public pages draw them |
| ↳ AuditLog | query | skeleton | hydrate | no | folded |
| RemoveFeaturedDialog, AddFeaturedDialog | query | none | hydrate | no | mounted only while open; the add dialog loads its candidates inside, on its own |
## Notes
- Debt: `featured/loading.tsx:10` draws the header without «افزودن تحلیلگر», so the header can change height when the page arrives. Draw the button, or a same-size box, in the loading frame.

View File

@ -0,0 +1,26 @@
# Beta health: secondary
`/health/secondary` · `apps/wall-street-plaza/src/app/(panel)/health/secondary/page.tsx` · Type: account (back office) · Layout: [layout-panel.md](layout-panel.md)
| Field | Value |
| ----------- | ---------------------------------------------------------------------------------------------------------- |
| Robots | `noindex` (root layout `metadata`, `src/configs/seo.ts`) |
| Status | `200`; before the first day, the pre-launch state; with no start date, the not-scheduled state; both `200` |
| loading.tsx | `(panel)/health/secondary/loading.tsx` |
| First flush | none |
| Canonical | none |
| H1 | `health:title` from i18n, in `PageHeader` (the same as `/health`; the tab names the view) |
| JSON-LD | none |
| Scripts | none |
## Sections
| Section | Data | HTML | JS | Index | Notes |
| ----------------------- | ------ | ----------- | ------- | ----- | ------------------------------------------------------------------------------------------------------------------- |
| PageHeader, with the H1 | config | first flush | none | no | |
| ↳ BetaSubtitle | query | skeleton | hydrate | no | as on [health.md](health.md) |
| ↳ BetaUpdatedAt | query | skeleton | hydrate | no | as on [health.md](health.md) |
| HealthTabs | config | first flush | hydrate | no | «شاخص‌های ثانویه» active; drawn by the guard's skeleton too |
| BetaHealth | query | skeleton | hydrate | no | `AdminGuard` › page-size `PartBoundary` › `<Suspense>`; the overview picks the parts, `PreLaunch` or `NotScheduled` |
| ↳ SecondaryMetrics | query | skeleton | hydrate | no | its own `<Suspense>` and framed `PartBoundary`; fails alone |
| ↳ AnalystFunnel | query | skeleton | hydrate | no | the same |

View File

@ -0,0 +1,32 @@
# Beta health: main
`/health` · `apps/wall-street-plaza/src/app/(panel)/health/page.tsx` · Type: account (back office) · Layout: [layout-panel.md](layout-panel.md)
| Field | Value |
| ----------- | ---------------------------------------------------------------------------------------------------------- |
| Robots | `noindex` (root layout `metadata`, `src/configs/seo.ts`) |
| Status | `200`; before the first day, the pre-launch state; with no start date, the not-scheduled state; both `200` |
| loading.tsx | `(panel)/health/loading.tsx` |
| First flush | none |
| Canonical | none |
| H1 | `health:title` from i18n, in `PageHeader` |
| JSON-LD | none |
| Scripts | none |
## Sections
| Section | Data | HTML | JS | Index | Notes |
| ----------------------------------- | ------ | ----------- | ------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| PageHeader, with the H1 | config | first flush | none | no | |
| ↳ BetaSubtitle | query | skeleton | hydrate | no | «روز ۱۸ از ۳۰ · …» from `useBetaHeader`, enabled once the admin is known and refetched every `HEALTH_REFRESH_MS`; the start date before the beta |
| ↳ BetaUpdatedAt | query | skeleton | hydrate | no | when the API last computed the metrics; nothing before the beta |
| HealthTabs | config | first flush | hydrate | no | `TabLinks` to `/health` and `/health/secondary`; the guard's skeleton draws them too, so they work before the admin is known |
| BetaHealth | query | skeleton | hydrate | no | `AdminGuard` › page-size `PartBoundary` › `<Suspense>`; `useBetaHealthPage` reads the overview with `useSuspenseQuery` and picks the parts, `PreLaunch` or `NotScheduled` |
| ↳ ExitMetrics | query | skeleton | hydrate | no | its own `<Suspense>` and framed `PartBoundary`; fails alone |
| ↳ InvestorFunnel, with BetaTimeline | query | skeleton | hydrate | no | the same |
| ↳ BetaAnalysts | query | skeleton | hydrate | no | the same |
## Notes
- The header line and the page share the overview's query key, so the overview is read once. The header line stays empty when that read fails, since the page's boundary already says what failed.
- `/health` is `HOME_ROUTE`: where a signed-in admin lands and where the brand links.

View File

@ -0,0 +1,23 @@
# Invite codes: capacity requests
`/invite-codes/requests` · `apps/wall-street-plaza/src/app/(panel)/invite-codes/requests/page.tsx` · Type: account (back office) · Layout: [layout-panel.md](layout-panel.md), [layout-invite-codes.md](layout-invite-codes.md)
| Field | Value |
| ----------- | ---------------------------------------------------------- |
| Robots | `noindex` (root layout `metadata`, `src/configs/seo.ts`) |
| Status | `200`; no pending request shows the empty state with `200` |
| loading.tsx | `(panel)/invite-codes/requests/loading.tsx` |
| First flush | none |
| Canonical | none |
| H1 | in the layout's `PageHeader`: `codes:header.title` |
| JSON-LD | none |
| Scripts | none |
## Sections
The layout's header, search and tabs come first ([layout-invite-codes.md](layout-invite-codes.md)).
| Section | Data | HTML | JS | Index | Notes |
| ------------------------------ | ----- | -------- | ------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| CapacityRequests › RequestRows | query | skeleton | hydrate | no | `AdminGuard` › `<Suspense>` with `TableSkeleton`; the pending requests read with `useSuspenseQuery` behind their own `<Suspense>` and a `PartBoundary` keyed by search and page |
| CodeDialogs | query | none | hydrate | no | approve and reject, mounted only while open; a decision drops the row and lowers the tab's and the sidebar's counts together |

View File

@ -0,0 +1,24 @@
# Invite codes
`/invite-codes` · `apps/wall-street-plaza/src/app/(panel)/invite-codes/page.tsx` · Type: account (back office) · Layout: [layout-panel.md](layout-panel.md), [layout-invite-codes.md](layout-invite-codes.md)
| Field | Value |
| ----------- | -------------------------------------------------------------------------------------- |
| Robots | `noindex` (root layout `metadata`, `src/configs/seo.ts`) |
| Status | `200`; an unknown `?code=` shows the not-found state inside the side sheet, with `200` |
| loading.tsx | `(panel)/invite-codes/loading.tsx` |
| First flush | none |
| Canonical | none |
| H1 | in the layout's `PageHeader`: `codes:header.title` |
| JSON-LD | none |
| Scripts | none |
## Sections
The layout's header, search and tabs come first ([layout-invite-codes.md](layout-invite-codes.md)).
| Section | Data | HTML | JS | Index | Notes |
| ---------------------- | ----- | -------- | ------- | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| InviteCodes › CodeRows | query | skeleton | hydrate | no | `AdminGuard` › `<Suspense>` with `TableSkeleton`; the rows read with `useSuspenseQuery` behind their own `<Suspense>` and a `PartBoundary` keyed by search and page; `ListPager`; a code's link opens its detail through `?code=` (`replace`); a link to `/invite-codes/requests` |
| CodeDetailSheet | query | none | hydrate | no | a side `Sheet` while the URL has `?code=`; the code loads inside, behind its own skeleton and boundary |
| CodeDialogs | query | none | hydrate | no | `CapacityDialog` and `CodeReasonDialog`, mounted only while open |

View File

@ -0,0 +1,17 @@
# Layout: invite-codes
`apps/wall-street-plaza/src/app/(panel)/invite-codes/layout.tsx` · wraps `/invite-codes` and `/invite-codes/requests`, inside [layout-panel.md](layout-panel.md) · it reads nothing on the server
| Section | Data | HTML | JS | Index | Notes |
| ----------------------- | ------ | ----------- | ------- | ----- | ----------------------------------------------------------------------------------------------------- |
| PageHeader, with the H1 | config | first flush | none | no | `codes:header.title` and its subtitle |
| ↳ CodesSearch | — | first flush | hydrate | no | `SearchField` with the URL's `q`, written to the URL once typing pauses; both tabs filter by it |
| CodesTabs | config | first flush | hydrate | no | `TabLinks` to «همه کدها» and «درخواست‌های افزایش», each keeping `q` |
| ↳ Pending count | query | none | hydrate | no | the sidebar's `usePanelCounts` read; the badge shows once the admin is known and the count is above 0 |
Scripts: none.
## Notes
- Both tabs keep this frame, so the search keeps its value and position between them.
- The header and tabs sit outside the page's `AdminGuard`: a guest sees them until the redirect.

View File

@ -0,0 +1,22 @@
# Layout: panel
`apps/wall-street-plaza/src/app/(panel)/layout.tsx` · wraps every page in `(panel)`, inside [layout.md](layout.md) · it reads nothing on the server; `dynamic = 'force-dynamic'`
| Section | Data | HTML | JS | Index | Notes |
| ---------------------- | ------------- | ----------- | ------- | ----- | --------------------------------------------------------------------------------------------------------------------------- |
| AdminSidebar (desktop) | config | first flush | hydrate | no | `hidden desktop:flex`, so it is in the DOM on phones too; the brand links to `/health` |
| ↳ NavList | config | first flush | hydrate | no | a `next/link` per section, `aria-current` from the path; «به‌زودی» items as plain text |
| ↳ Section counts | query | none | hydrate | no | `usePanelCounts`, enabled once the admin is known and refetched on an interval; a `CountBadge` only when a count is above 0 |
| ↳ AdminIdentity | viewer | skeleton | hydrate | no | avatar, name, `@username` and sign-out once the admin is known |
| AdminTopBar (mobile) | config | first flush | hydrate | no | `desktop:hidden`, sticky; the brand and the menu button |
| ↳ Menu sheet | config, query | none | hydrate | no | island `Sheet` mounts the `NavList` and sign-out only while open |
| SignOutDialog | — | none | hydrate | no | one in each bar; mounted only while open |
| Page column `<main>` | — | first flush | none | no | each page renders its own `AdminGuard` and skeleton |
Scripts: none.
## Notes
- The frame is not guarded: a guest sees the sidebar or top bar, with an identity skeleton, until the page's `AdminGuard` sends them to `/login?returnTo=<path>`. When the session ends on a page, the guard shows `SessionEnded` in the page's place.
- Both bars hydrate on every device, because one DOM holds both templates.
- Debt: the `AdminGuard` comment says the `(panel)` layout renders it (`platforms/garden-roof/src/app/guards/admin-guard/AdminGuard.tsx:13`), but every page renders its own guard. Fix the comment.

Some files were not shown because too many files have changed in this diff Show More