docs(decisions): record 0026–0028, supersede 0024

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Amiram_se 2026-10-07 23:02:58 +04:00
parent 45c5551e18
commit 495f800f1f
5 changed files with 62 additions and 2 deletions

View File

@ -1,6 +1,6 @@
# 0024 خانه is the investor's feed, read in the browser # 0024 خانه is the investor's feed, read in the browser
Status: Proposed · Area: architecture · Date: 2026-10-07 · Decided by: agent Status: Superseded by 0027 · Area: architecture · Date: 2026-10-07 · Decided by: agent
## Context ## Context
`/` (خانه) is drawn for investors only: their followed creators' posts, premium ones open when subscribed. A creator's home tab is their own channel, no board draws a guest's home, and the API answers 401 to a guest and 403 to a creator. Every link home (the brand, back with no history, «بازگشت به خانه», login with no return path) lands there. `/` (خانه) is drawn for investors only: their followed creators' posts, premium ones open when subscribed. A creator's home tab is their own channel, no board draws a guest's home, and the API answers 401 to a guest and 403 to a creator. Every link home (the brand, back with no history, «بازگشت به خانه», login with no return path) lands there.

View File

@ -0,0 +1,21 @@
# 0026 The landing is prerendered and revalidated
Status: Accepted · Area: architecture · Date: 2026-10-07 · Decided by: user
## Context
`/` became the guest landing (design, Oct 2026). It changes rarely, reads no session, and its only live data is the featured analysts. The skill renders every page fresh per request with no server cache, and both root layouts declared `dynamic = 'force-dynamic'`, which made any static page impossible.
## Decision
- `(landing)/page.tsx` in bull and bear declares `dynamic = 'force-static'` and `revalidate = 600`: the page is prerendered and its featured analysts are read again every 10 minutes.
- `force-dynamic` moves from the root layouts to each route group's layout (`(main)`, `(auth)`, `(flow)`, `(onboarding)`), so every other route still renders fresh per request.
- A failed read of the featured analysts (`loadLandingPage`) hides their section during `next build` (the app passes `NEXT_PHASE` from its server env), so the build never depends on the API; at a revalidation it throws, so Next keeps serving the last good page.
## Alternatives
- Render it fresh per request like every other page: rejected by the user; the page is the same for everyone and rarely changes.
- Static with no revalidation: rejected; the featured analysts are live.
## Consequences
- An exception to the skill's "no server cache" and "fresh page per request" rules, for `/` only. The response carries `s-maxage=600`, so a CDN may cache it too.
- A new route group must declare `force-dynamic` in its own layout; the root layout no longer does. The root `not-found` page is now static.
- A page built while the API was down has no analysts section until the first successful revalidation.
- The `landing` namespace is server-only (`SERVER_RESOURCES`), added to the i18n instance by each app's server bootstrap, so no client bundle carries it.

View File

@ -0,0 +1,19 @@
# 0027 خانه lives at /feed; the landing sends signed-in people on in the browser
Status: Accepted · Area: architecture · Date: 2026-10-07 · Decided by: user · Supersedes: 0024
## Context
The design moved the investor's feed from `/` to `/feed` when `/` became the guest landing, and asks for signed-in visitors to be redirected in middleware from the session cookie. The server render never depends on auth here, and the Next.js proxy was removed for that reason.
## Decision
- خانه, the investor's feed, is `/feed` (`ROUTES.home`); the landing is `/` (`ROUTES.landing`). The feed keeps 0024's rules: read only in the browser behind a same-size skeleton, `HomeGuard` sends a guest to login and a creator to their channel.
- On `/`, `LandingRedirect` waits for the browser's session and then `router.replace`s a member to `homeRoute`: step 5 while `needsProfile`, a creator's own channel, or `/feed`. Guests and expired sessions stay. No proxy, no cookie read on the server.
- A guest's brand link (top bars, desktop header, auth frames) goes to `/`.
## Alternatives
- Proxy (`proxy.ts`) redirect on the session cookie, as the design asks: rejected by the user; it brings back the proxy, can't tell a creator from an investor, and misses sessions whose 15-minute access cookie expired.
## Consequences
- A signed-in person who opens `/` sees the landing briefly before the redirect.
- «بازگشت به خانه» buttons still lead to `/feed`, so a guest there lands on login.
- After «خروج», the account page (not built yet) should send the person to `/`.

View File

@ -0,0 +1,18 @@
# 0028 Landing-only tokens in island
Status: Proposed · Area: design · Date: 2026-10-07 · Decided by: agent
## Context
The landing's spec has page-only type (h1 28/40 → 34/50 → 46/66, section titles 24/36 → 30/44), a 1184px content width, a black gradient under white text on the hero image, and a 720px step inside bull's range for its wider grids. None had a token, and raw sizes are not allowed where a token can exist.
## Decision
- island `theme.css` gains `--breakpoint-tablet: 720px`, `--text-hero`, `--text-hero-md`, `--text-hero-lg`, `--text-section`, `--text-section-lg`, `--container-page: 74rem` and `--image-shade`.
- Typography gains `hero` and `section` variants, which step up at `tablet` and `desktop`.
- `tablet:` is for the landing's grids only; navigation and app layout still switch only at `desktop` (1024px).
## Alternatives
- Arbitrary values (`min-[720px]:`, `text-[28px]`): rejected; raw sizes spread and drift.
- The design system's `display` and `heading-lg` instead: rejected; they don't match the spec's sizes.
## Consequences
Other marketing pages can reuse the tokens. Using `tablet:` outside the landing needs a new decision.

View File

@ -12,6 +12,8 @@
- 0012 Wrap each app's `next.config` in island's `withIconSprite` and `withFontCopy`; they write `symbol-defs.svg` and the fonts into `public/` unhashed, served immutable; link the sprite as `?v=<ICON_SPRITE_VERSION>`. - 0012 Wrap each app's `next.config` in island's `withIconSprite` and `withFontCopy`; they write `symbol-defs.svg` and the fonts into `public/` unhashed, served immutable; link the sprite as `?v=<ICON_SPRITE_VERSION>`.
- 0013 Render every `(auth)` page's steps only in the browser behind `GuestGuard`: the server sends the frame, a same-size skeleton and `noindex`; flow state stays in memory, never in the URL or storage. - 0013 Render every `(auth)` page's steps only in the browser behind `GuestGuard`: the server sends the frame, a same-size skeleton and `noindex`; flow state stays in memory, never in the URL or storage.
- 0018 Call the API from the browser only on the app's own origin under `/api`, rewritten by `next.config.ts` to `API_INTERNAL_ORIGIN`; media URLs use the same path, and the server render calls the gateway directly. - 0018 Call the API from the browser only on the app's own origin under `/api`, rewritten by `next.config.ts` to `API_INTERNAL_ORIGIN`; media URLs use the same path, and the server render calls the gateway directly.
- 0026 Prerender the landing (`/`) with `force-static` and `revalidate = 600`; every other route keeps `force-dynamic` in its route group's layout, never the root's.
- 0027 Serve خانه at `/feed` and the landing at `/`; send a signed-in visitor of `/` to `homeRoute` in the browser with `LandingRedirect`, never in a proxy.
## Proposed ## Proposed
@ -26,5 +28,5 @@
- 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. - 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`. - 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 «پست جدید» is a dialog over the page through bear's `@modal` intercept of /compose/post; slots are emptied by explicit null pages, never a catch-all, and a hard load gets the full page. - 0023 architecture: On desktop «پست جدید» is a dialog over the page through bear's `@modal` intercept of /compose/post; slots are emptied by explicit null pages, never a catch-all, and a hard load gets the full page.
- 0024 architecture: `/` (خانه) is the investor's feed, read only in the browser with the session behind a same-size skeleton; a guest goes to login with a return to `/`, a creator to their own channel.
- 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. - 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.
- 0028 design: Landing-only island tokens: `tablet` (720px, the landing's grids only), `hero` and `section` type, `container-page` and `image-shade`.