wealth/docs/decisions
Amiram_se 1b8d1df265 feat(dashboard): finish the overview tab and document it
Keeps tile tips on the label's line, moves the share button under the banner
text on a phone, and records the new default tab, the overview and the
subscriber list in the decisions and page docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 19:19:20 +04:00
..
0001-one-platform-shared-by-mobile-and-desktop.md
…
0002-island-layout-and-element-over-native-tags.md
…
0003-semantic-tokens-only-in-theme.md
…
0004-self-hosted-yekan-bakh.md
…
0005-island-components-take-text-as-props.md
…
0006-pnpm-workspaces-and-package-exports.md
…
0007-yekan-bakh-from-public-or-cdn.md
…
0008-island-asset-plugin.md
…
0009-versioned-yekan-bakh-never-hashed.md
…
0010-island-sprite-and-font-plugins.md
…
0011-yekan-bakh-under-fixed-names.md
…
0012-sprite-version-in-link.md
…
0013-auth-pages-render-in-the-browser.md
…
0014-registration-step-5-on-the-session.md
…
0015-a-view-with-its-own-frame-gets-its-own-route.md
…
0016-unfinished-creators-stay-on-step-5.md
…
0017-each-step-owns-its-loading-skeleton.md
…
0018-browser-calls-the-api-through-a-next-rewrite.md feat: update configs 2026-10-17 13:58:30 +04:00
0019-every-toast-closes-by-itself.md
…
0020-server-organisms-take-labels-from-the-app.md
…
0021-channel-feed-starts-from-the-server-page.md feat: render every page except the landing in the browser 2026-10-21 15:40:47 +04:00
0022-post-rules-live-in-the-api.md
…
0023-desktop-composer-is-an-intercepted-dialog.md chore(apps,decisions): three-tab creator layouts, intercepts without loading files; propose 0050, note 0023 intercept loading 2026-10-09 19:34:24 +04:00
0024-home-is-the-investors-browser-feed.md
…
0025-investor-dashboard-is-a-tabbed-section.md
…
0026-landing-is-prerendered.md
…
0027-feed-at-feed-landing-redirects-in-browser.md
…
0028-landing-only-tokens.md
…
0029-every-payment-ends-on-its-result-page.md
…
0030-checkout-draft-survives-the-bank.md
…
0031-renewal-periods-are-tier-options.md
…
0032-notification-centre-page-and-panel.md docs(decisions): accept 0058–0060 (notifications seen and read, invite code from checkout link, compose lock on own channel), supersede 0032, 0044, 0048, reword 0036 2026-10-10 13:29:48 +04:00
0033-abandoned-payment-is-settled-on-return.md
…
0034-creator-dashboard-routes.md feat(dashboard): finish the overview tab and document it 2026-11-05 19:19:20 +04:00
0035-promotion-date-picker-native-selects.md
…
0036-promotions-save-during-lock.md docs(decisions): accept 0058–0060 (notifications seen and read, invite code from checkout link, compose lock on own channel), supersede 0032, 0044, 0048, reword 0036 2026-10-10 13:29:48 +04:00
0037-payout-receipts-through-the-session.md
…
0038-back-resolution-and-desk-back.md docs(decisions): accept 0051–0057, supersede 0038 with 0057 2026-10-10 12:19:43 +04:00
0039-toast-placement-declared-by-edges.md
…
0040-connection-bar-under-the-bars.md
…
0041-sign-out-reloads-to-the-landing.md
…
0042-session-expiry-keeps-drafts.md
…
0043-network-actions-freeze-offline.md
…
0044-invite-codes-kept-per-creator.md docs(decisions): accept 0058–0060 (notifications seen and read, invite code from checkout link, compose lock on own channel), supersede 0032, 0044, 0048, reword 0036 2026-10-10 13:29:48 +04:00
0045-channel-read-carries-follower-count.md feat: render every page except the landing in the browser 2026-10-21 15:40:47 +04:00
0046-account-profile-one-route.md
…
0047-pwa-install-offer.md
…
0048-publish-guard-and-idempotency.md docs(decisions): accept 0058–0060 (notifications seen and read, invite code from checkout link, compose lock on own channel), supersede 0032, 0044, 0048, reword 0036 2026-10-10 13:29:48 +04:00
0049-page-error-keeps-the-bar.md
…
0050-access-ended-toast.md chore(apps,decisions): three-tab creator layouts, intercepts without loading files; propose 0050, note 0023 intercept loading 2026-10-09 19:34:24 +04:00
0051-cache-first-for-next-static.md docs(decisions): accept 0051–0057, supersede 0038 with 0057 2026-10-10 12:19:43 +04:00
0052-least-recently-used-eviction.md docs(decisions): accept 0051–0057, supersede 0038 with 0057 2026-10-10 12:19:43 +04:00
0053-one-origin-one-worker.md docs(decisions): accept 0051–0057, supersede 0038 with 0057 2026-10-10 12:19:43 +04:00
0054-blocking-metadata-in-head.md docs(decisions): accept 0051–0057, supersede 0038 with 0057 2026-10-10 12:19:43 +04:00
0055-static-metadata-except-channel-and-post.md feat: render every page except the landing in the browser 2026-10-21 15:40:47 +04:00
0056-no-input-zoom-on-iphone.md docs(decisions): accept 0051–0057, supersede 0038 with 0057 2026-10-10 12:19:43 +04:00
0057-back-goes-to-its-parent.md docs(decisions): accept 0051–0057, supersede 0038 with 0057 2026-10-10 12:19:43 +04:00
0058-notifications-seen-and-read.md docs(decisions): accept 0058–0060 (notifications seen and read, invite code from checkout link, compose lock on own channel), supersede 0032, 0044, 0048, reword 0036 2026-10-10 13:29:48 +04:00
0059-invite-code-in-checkout-link.md docs(decisions): accept 0058–0060 (notifications seen and read, invite code from checkout link, compose lock on own channel), supersede 0032, 0044, 0048, reword 0036 2026-10-10 13:29:48 +04:00
0060-compose-lock-on-own-channel.md docs(decisions): accept 0058–0060 (notifications seen and read, invite code from checkout link, compose lock on own channel), supersede 0032, 0044, 0048, reword 0036 2026-10-10 13:29:48 +04:00
0061-admin-app-and-platform.md feat: update configs 2026-10-17 13:58:30 +04:00
0062-admin-renders-in-the-browser.md feat(admin): wall-street-plaza admin panel on garden-roof, bound to admin-api 2026-10-11 19:06:38 +04:00
0063-one-responsive-admin-app.md feat(admin): wall-street-plaza admin panel on garden-roof, bound to admin-api 2026-10-11 19:06:38 +04:00
0064-channels-at-channels-path.md feat: update creator route 2026-10-16 15:30:43 +04:00
0065-api-end-points-per-side.md feat: update configs 2026-10-17 13:58:30 +04:00
0066-browser-calls-the-api-directly.md feat: update configs 2026-10-17 13:58:30 +04:00
0067-no-per-app-nginx.md feat: update configs 2026-10-17 13:58:30 +04:00
0068-keep-the-previous-release-for-rollback.md feat: update configs 2026-10-17 13:58:30 +04:00
0069-one-rendering-doc-per-market-route.md feat: render patterns 2026-10-21 13:16:11 +04:00
0070-render-every-page-except-the-landing-in-the-browser.md feat: render every page except the landing in the browser 2026-10-21 15:40:47 +04:00
0071-index-only-the-landing.md feat: render every page except the landing in the browser 2026-10-21 15:40:47 +04:00
0072-analyst-overview-is-the-default-tab.md feat(dashboard): finish the overview tab and document it 2026-11-05 19:19:20 +04:00
README.md feat(dashboard): finish the overview tab and document it 2026-11-05 19:19:20 +04:00

README.md

Decisions

Design (DDR)

  • 0002 Render every tag through island Element, flex layouts through FlexBox, grid layouts through GridBox; never native JSX tags or flex/grid classes, island included.
  • 0011 Serve Yekan Bakh FaNum (font-sans, all UI text) and Yekan Bakh (font-latin, شبا and bank codes only) from public/fonts/ under fixed names declared in island fonts.css; no version, never hashed, never next/font; a changed font gets a new name.
  • 0019 Close every toast by itself: success and info after 4 s (6 with an action), errors after 8 s (10 with an action); hovering, focus or a hidden tab pauses it; callers never pass duration: Infinity.
  • 0056 Set maximum-scale=1 in bull's root viewport so iPhones never zoom into fields under 16px; bear keeps the default viewport.

Architecture (ADR)

  • 0001 Share one platform, platforms/market, between apps/bull and apps/bear; tag all three scope:market.
  • 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.
  • 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.
  • 0051 Serve /_next/static/ JS and CSS cache first in the service worker; strategy (default stale-while-revalidate) applies to fonts and the sprite only.
  • 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>.
  • 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.
  • 0060 Composers send a creator who can't publish to their own channel with the locked dialog; every publish carries a stable Idempotency-Key.
  • 0061 Build the admin panel as apps/wall-street-plaza with platforms/garden-roof, tagged scope:admin; it calls only the back end's admin-api.
  • 0064 Serve a channel at /channels/username, built only through ROUTES; both apps 308-redirect /@username/… there, and no other code reads «@» in a path.
  • 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.
  • 0072 Make /dashboard/overview the analyst's default tab, «نمای کلی» · «طرح‌های اشتراک» · «سیگنال‌ها» · «مالی»; the plans tab lists subscribers instead of audience counts, and /dashboard/subscribers lists them all.

Proposed

  • 0003 design: Only semantic tokens, named as in the Lumina Design System, produce Tailwind utilities (@theme inline); primitives stay plain :root variables and Tailwind's defaults are removed.
  • 0005 design: Island holds Lumina's product components and status-to-tone map; they take every text as props (children or labels) and never import i18next or platform code.
  • 0006 architecture: Make every non-app project a pnpm workspace package @lumina/<name> with subpath exports; third-party dependencies stay in the root package.json.
  • 0014 architecture: Serve registration step 5 under (onboarding) behind AuthGuard; a creator's profile autosaves as a server draft (PATCH) and completes only through POST …/profile/complete.
  • 0015 architecture: Serve a login or onboarding view whose frame differs from its step on its own route (/auth/login/suspended, /onboarding/creator-profile/done); browser-only data stays in memory.
  • 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.
  • 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.
  • 0028 design: Landing-only island tokens: tablet (720px, the landing's grids only), hero and section type, container-page and image-shade.
  • 0029 architecture: End every payment on /payment/result/[paymentId]; the API's bank callback returns to /payment/return, which polls the payment until settled (30 s at most) and replaces itself.
  • 0030 architecture: Keep the last checkout's period, invite code and bank payment in the persisted session.checkout-draft store from payment start until success, and restore them on the same creator's checkout.
  • 0031 design: List renew and reactivate periods as island TierOption cards, as checkout does, instead of R3's chip grid.
  • 0033 architecture: Keep the payment sent to the bank in the checkout draft and settle it through POST /subscriptions/payments/:id/abandon only on the page that came back from the bank (bfcache or a history load), triggered by the app shell and awaited by checkout's screen read.
  • 0034 architecture: Serve the creator's داشبورد from dashboard/(creator) as /dashboard/plans, /dashboard/predictions and /dashboard/finance (0072 adds the default, /dashboard/overview), and C7 at /dashboard/pricing in (flow); the شبا form and ledger details open in place.
  • 0035 design: Pick a promotion's Shamsi date and time with island Selects in a sheet or modal, not a drawn wheel.
  • 0036 architecture: During the 7-day lock the save button reads «ذخیره تخفیف» and saves promotion changes; standing prices and period switches stay read-only.
  • 0037 architecture: Open payout receipts from the API's session-authorized /payouts/me/payouts/:id/receipt through /api, not signed expiring URLs.
  • 0039 design: Place toasts above whatever draws the bottom edge, declared by that part (nav 80, pinned footer 152, desktop 32, low in sheets).
  • 0040 architecture: Render the connection bar under the sticky bars, inside their sticky box, never above or over content.
  • 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.
  • 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.