6.5 KiB
6.5 KiB
AI Growth Analyst UX Spec
- Status: Approved — implementation authorized 2026-08-21
- Route:
/growth - Language/direction: Persian, RTL
Experience
- Add
تحلیلگر رشدto the authenticated sidebar and a compact dashboard teaser linking to it. - Reuse the global terminal selector. Merchant scope may show peers; terminal scope explains that peer comparison is unavailable.
- Keep the previous successful report visible during refresh. Initial and uncached states use visible light/dark skeletons; no state renders an empty page.
- Header states the 90-day horizon starts after the latest complete dataset date. A daily
بهروزرسانی تحلیلaction showsnextRefreshAt, loading, and typed rate-limit feedback. - Render a responsive, keyboard-accessible forecast chart with count/amount mode, hover/focus points, P10–P90 band, axes/units, chart summary, and a non-visual data alternative.
- Show historical wins, up to five upcoming opportunities, up to three gentle low-period warnings, and a peer card when permitted.
- Rank up to three upcoming events as a shared-baseline priority histogram. Rank 1 is the physical-right column in RTL. Each column's literal height equals its integer planning-priority percentage; the displayed percentages are positive, descend by rank, and total exactly
100. When only one or two relevant candidates exist, say so explicitly and divide the total only among the available candidates. - State visibly that event priority is a relative planning allocation, not a probability of growth or guaranteed demand. Repeat rank and percentage in text so height and color are never the only carriers of meaning.
- Pair the compact histogram with one evidence card per displayed event. On desktop, up to three cards form RTL columns aligned by rank; on mobile, the compact histogram keeps its shared baseline and evidence cards stack for readable analysis.
- Prefer evidence from the merchant's matching prior occasion window. Show the prior start/end dates, observation count, paid-session uplift, amount uplift, and an explicit promote, prepare, or caution stance. Material decline must produce a visible caution recommendation.
- When matching historical evidence is unavailable, ground the explanation in onboarding profile signals. Show the matched category, niche, or sales-channel signals and, when provided, the reason history was unavailable.
- Label every event explanation as either
بر پایه تجربه شماorبر پایه شناخت کسبوکار. The label must agree with both deterministic evidence and the recommendation'sinsightBasis. - Each brief contains server-rendered timing/range/evidence plus validated AI headline, interpretation, offer/message suggestion, one preparation step, confidence, and limitation.
PARTIALkeeps deterministic charts/cards and visibly explains that the written AI interpretation was unavailable.INSUFFICIENT_EVENT_CANDIDATESadditionally states the exact number of available events instead of implying that three were ranked.LOWkeeps the forecast visible with an explicit limited-history or high-variance warning.INSUFFICIENT_DATAis reserved for scopes with no historical observations.FAILEDoffers safe retry without hiding an older successful report.- Motion is restrained, supports reduced motion, and does not block reading. All interactive targets are at least 44 px.
Copy rules
- Use natural professional Persian, Persian
ی/ک, appropriate نیمفاصله, Persian digits, and Rial. - Keep tone constructive: describe opportunity, preparation, and uncertainty; do not shame the merchant or claim guaranteed outcomes.
- Every recommendation visibly cites its deterministic evidence card. AI is labeled advisory.
- Event reasons explain why the occasion is relevant to this merchant and must not turn planning priority into a forecast claim.
- No chat, notifications, campaign execution, user memory, provider/model names, token usage, or internal failure details appear in merchant UI.
Event priority contract
occasionKeyis the stable identity used to join an upcoming occurrence to prior occurrences;eventVariantis one ofPRIMARY,CAMPAIGN_WINDOW, orOPERATIONAL_WINDOWand distinguishes materially different variants without changing that identity.HISTORICALis preferred whenever matching prior-window evidence is eligible.BUSINESS_PROFILEis used only when that evidence is unavailable.historicalEvidencecontains deterministic dates, sample size, basis-point uplifts, and material-win/material-decline flags. AI copy may interpret these values but may not invent or alter them.profileEvidence.matchedSignalscontains onboarding-derived evidence and may be empty. Empty signals produce truthful general-profile copy rather than invented alignment chips.historyUnavailableReasonis an optional typed code and is always translated to natural Persian; raw backend codes never appear.- Deterministic events form a discriminated evidence union:
HISTORICALrequireshistoricalEvidence, whileBUSINESS_PROFILErequiresprofileEvidence. Recommendation basis must match the deterministic event basis; mismatched recommendation copy is discarded rather than overriding evidence authority. priorityPercentis an integer from1to98. A valid AI recommendation collection contains exactly three items, is sorted descending, and totals exactly100; reports with fewer candidates omit AI copy and use the explicit limited-candidatePARTIALstate.- Upcoming-event filtering compares inclusive calendar dates in
Asia/Tehran, so an event remains visible through its entireendDatein the merchant calendar. stanceis one ofPROMOTE,PREPARE, orCAUTION; color always appears with its Persian text label.
Acceptance
- Works at 360, 768, 1024, and wide desktop widths in light/dark RTL layouts.
- The event chart keeps three readable columns at 360 px, places rank 1 physically right, and exposes an equivalent ordered text alternative to assistive technology.
- Event evidence and reasons are visible without hover or pointer interaction, and histogram height transitions are removed under
prefers-reduced-motion. - All job, cache, refresh, partial, insufficient, unauthorized, and recoverable error states are accessible and tested.
- Generated OpenAPI types are used; no handwritten duplicate growth DTOs or browser secrets exist.
- Cached navigation performs no generation request. Manual retry remains available while the current scope has no persisted AI-written summary; after one exists, refresh is limited once per merchant per Tehran day.