PURPOSE
Guided first-time experience flow that renders the current prologue beat with a title, description, progress indicator, and CTA button. Currently a click-through placeholder that advances beats via progress counters; tutorial run integration is deferred to a follow-up pass. Beat 4 is intended to surface mission and pull flows once wired.
OWNS
- The
PrologueScreenReact component (named export). - Local visual structure: title block, progress dots, step counter, beat name heading, description paragraph, and CTA button — all inline-styled.
- The
handleAdvancecallback that grants the current beat’s reward, advances the beat, and routes to the hub on completion. - Redirect-to-hub logic when the prologue is already complete or no current beat is available.
READS FROM
useOnboardingStore— selectsprologueComplete,currentBeatIndex,completeBeat, andgetCurrentBeat.PROLOGUE_BEATSfrom@starship-survivors/data/prologue-config— used for total count and rendering the progress dots.beat.reward(gems,tickets),beat.id,beat.name,beat.description, andbeat.ctaTextfrom the current beat returned bygetCurrentBeat().useNavigatefromreact-router-domfor hub redirects.
PUSHES TO
useWalletStore.getState().earnGems(...)andearnPullTickets(...)when the current beat’s reward has gems or tickets.useRewardQueueStore.getState().enqueue(...)with reward items built viamakeRewardItemusingREWARD_PRIORITY.gemsandREWARD_PRIORITY.tickets, source label'Prologue', and icons💎/🎫.completeBeat(beat.id)on the onboarding store to advance the prologue.navigate('/')to return to the hub when the prologue is already complete, no beat is current, or the final beat has just been completed.
DOES NOT
- Does not launch a tutorial run or any gameplay session — the placeholder only counts beats forward.
- Does not show mission selection or pull flows on beat 4 (deferred).
- Does not read or write any persistence layer directly; all state changes go through the onboarding, wallet, and reward queue stores.
- Does not gate advancement on any condition — every CTA press completes the current beat unconditionally.
- Does not render any layout chrome beyond what
OnboardingShellprovides.
Signals
- Renders
nullafter triggering a redirect whenprologueCompleteis true orgetCurrentBeat()returns falsy. progressis computed ascurrentBeatIndex + 1;totalisPROLOGUE_BEATS.length.- Progress dot color: green (
#34d399) for completed beats, orange (#f97316) for the current beat, faint white for upcoming. - Final-beat detection uses
currentBeatIndex >= PROLOGUE_BEATS.length - 1aftercompleteBeatis called.
Entry points
- Mounted by the metagame router as the prologue screen.
- The single user interaction is the CTA button, which invokes
handleAdvance.
Pattern notes
- All store reads use individual Zustand selectors; mutations use
getState()inside the event handler rather than subscribing. - Reward grant and enqueue happens before
completeBeat, so the reward queue is populated against the current beat state. - The component composes
OnboardingShellfor the outer frame and supplies all inner content as children with inline styles. Fonts are'Cal Sans'throughout. - Both early-return paths call
navigate('/')synchronously inside the render body, which schedules navigation as a side effect during render.