Skip to content

feat: Phase 4 frontend — gamification, Astra identity, onboarding, referral, social types - #323

Merged
thomasluizon merged 6 commits into
mainfrom
feature/phase-4
Jun 27, 2026
Merged

feat: Phase 4 frontend — gamification, Astra identity, onboarding, referral, social types#323
thomasluizon merged 6 commits into
mainfrom
feature/phase-4

Conversation

@thomasluizon

Copy link
Copy Markdown
Owner

Phase 4 — frontend + shared (orbit-ui-mobile)

Frontend/shared half of the Phase 4 growth/social batch. Pairs with orbit-api#261 (backend).

Issues

Validation

type-check clean (3 workspaces) · lint 0 errors · tests shared 1119 · web 1696 · mobile 664 — all green. web/mobile parity + en/pt-BR throughout.

🤖 Generated with Claude Code

thomasluizon and others added 6 commits June 27, 2026 00:13
…pes (#186, #190)

Free users see streak/XP/level gated on canViewGamification; next-reward carrot teases Pro rewards. Recap endpoint + Zod types + query key + share-url helper. Web+mobile parity, en + pt-BR.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
New AstraMark/AstraAvatar SVG primitive (violet core + satellite on orbit ring, token-driven, reduced-motion-gated); swapped into nav tab, chat header (additive AppBar titleIcon), meet-astra. Satisfies #185. i18n chat.astraAvatarLabel en+pt-BR.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a quantified Suite-health metric (share of suite that's happy-path-only vs pins all three axes), bound the adversarial skeptic pass (Criticals get own skeptic, Highs batched/capped at top-15) + a Fix-first top-10 list, and a Tests-to-delete/rewrite section for false-safety tests. Rubric gains a delete-vs-rewrite + aggregate-rollup note.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
15 social schemas/types, data-export rows, friends.* + profile.handle/socialOptIn endpoints, friendKeys/cheerKeys. Additive.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… no-card copy (#187, #188, #189, #192)

Starter template packs (single-pack->customize->bulk-create) + wizard pack-picker keeping create-my-own (#187). Progressive disclosure >=5 habits + first-run coach-marks via tour engine, auto-tour retired for new users (#188). Auto-tracked setup-checklist Today card + onboarding achievement (#189). Onboarding-complete no-card trial copy (#192). web+mobile parity, both locales.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ts (#191)

Profile referral card under stat tiles + dismissible Today entry (removed from About). One-shot milestone prompt on streak 7/30/100 + level-ups via the existing celebration queue (no stacking), persisted referral-prompt-store w/ 14-day cooldown. web+mobile parity. No backend change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
orbit-ui-mobile-web Ignored Ignored Jun 27, 2026 7:24am

Request Review

@sonarqubecloud

Copy link
Copy Markdown

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: PR 323 - APPROVE

Summary: Phase 4 is a large well-structured batch landing gamification carrot, Astra identity, template packs, coach-marks, setup checklist, referral prompt, and social Zod types across web, mobile, and shared (98 files). Clean implementation, thorough parity, i18n fully in sync. No Critical or High findings survive adversarial review.

CRITICAL/HIGH: None.

MEDIUM-1: use-coach-mark.ts (mobile) bare catch {} swallows AsyncStorage errors silently

  • location: apps/mobile/hooks/use-coach-mark.ts:36
  • issue: Any AsyncStorage failure is silently discarded. Transient storage corruption suppresses all coach-marks permanently.
  • fix: catch (error) { if (DEV) console.warn(error) } - same fix needed in web readSeenSections/markSectionSeen helpers.
  • reference: CLAUDE.md rule 8

MEDIUM-2: sendFriendRequestSchema allows empty body - both handle and referralCode are optional

  • location: packages/shared/src/types/social.ts:101-104
  • issue: A {} body passes Zod validation. UI code that forgets to set either field silently passes the frontend guard.
  • fix: .refine((d) => d.handle != null || d.referralCode != null, { message: "handle or referralCode required" })
  • reference: CLAUDE.md rule 8

Subagents:
parity-checker: PAIRED (14 pairs verified; NextRewardCarrot props difference is valid platform adapter)
i18n-syncer: IN SYNC (all new keys in both en.json and pt-BR.json)
contract-aligner: UNVERIFIABLE (orbit-api not accessible from CI; no confirmed TS-side drifts)
security-reviewer: N/A (diff does not touch orbit-api; inline: no XSS, no auth leakage, no hardcoded secrets)

Adversarial pass:
nextReward required field (initially Critical): DOWNGRADED to non-finding. apiClient does not call Zod .parse() - it type-casts JSON. deriveNextRewardCarrot guards with canViewGamification which is optional on profileSchema and defaults to false on old API responses, so the early return fires before nextReward is accessed. Safe.
userDataExportSchema new required fields (initially High): REFUTED. Schema never invoked via .parse() in production. Export handler has catch wrapper. Not a runtime risk.

Validation: Lint PASS. Type-check PASS (3 workspaces). Tests PASS (shared 1119, web 1696, mobile 664). API build N/A.

Deferred: Contract drift (backend) unverifiable from CI - social schemas, gamification DTO new fields, recap schema not verified against orbit-api DTOs. Recommend manual spot-check of orbit-api#261 before merge.

What is good: Referral prompt store is exemplary (shared factory, platform adapters, cooldown guard, de-duplication, migration, 201-assertion tests). AstraMark/AstraAvatar are LucideProps-compatible with reduced-motion gating and correct a11y roles. Template packs compute i18n keys from stable identifiers. COACH_MARK_SECTIONS exclusion centralized in tour-store.ts. No console.log, no any in production, no narration comments, no raw slate/rgba values.

APPROVE. Two Medium findings are non-blocking follow-ups. Error-swallowing in use-coach-mark first; sendFriendRequestSchema refinement before Social UI in Phase 5.

Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant