feat(web): redesign onboarding and home after design critique

Onboarding:
- Keep the current step in ?step= so the device back gesture moves one
  step back; effectiveStep guards skipping the plan and re-opening the
  group form after the group exists. Show Back on mobile.
- Format prices with the chosen country's currency (form prefix and
  confirmation).
- Welcome describes the real flow and previews the WhatsApp payment
  reminder; the last step shares the group's invite link instead of
  listing settings chores.
- Accessibility: named stepper steps with aria-current, focus moves to
  the new step heading, alerts on errors, reduced-motion and
  direction-aware step animation, 48px primary actions.
- Group form split into "classes" and "billing", due day hidden for
  per-class billing; Stripe skips the empty Pro confirmation; Free
  features read "in Pro" instead of struck through.

Home:
- Payments section follows the plan: Free gets a locked preview with
  an upgrade link and is never asked to link Mercado Pago.
- Secondary text meets 4.5:1 contrast; accent-fg for links in dark.
- Class times use a 24h clock in Spanish and Portuguese.
- Drop the summary tiles; one hero for the current or next class, the
  rest of the day as compact rows; two columns on desktop.
- "Para atender" reads the shared ['attention'] query, so resolved
  alerts match "Requiere atención", with WhatsApp shortcuts and a link
  to the full list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jose Selesan
2026-11-06 09:58:08 -03:00
parent 70ef049f34
commit 2d80af082f
48 changed files with 1507 additions and 784 deletions

View File

@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
import type { OnboardingStatusDto } from '@gruperly/shared'
import { resumeStep, visibleSteps } from '../src/features/onboarding/steps'
import { effectiveStep, parseStep, resumeStep, visibleSteps } from '../src/features/onboarding/steps'
function status(overrides: Partial<OnboardingStatusDto> = {}): OnboardingStatusDto {
return {
@@ -46,3 +46,30 @@ describe('pasos del onboarding', () => {
).toBe('group')
})
})
describe('paso pedido por la URL', () => {
test('solo acepta ids de pasos conocidos', () => {
expect(parseStep('plan')).toBe('plan')
expect(parseStep('nope')).toBeUndefined()
expect(parseStep(undefined)).toBeUndefined()
expect(parseStep(3)).toBeUndefined()
})
test('sin plan elegido no se pasa del paso Plan', () => {
expect(effectiveStep('group', { plan: null, hasCreatedGroup: false })).toBe('plan')
expect(effectiveStep('payment', { plan: null, hasCreatedGroup: false })).toBe('plan')
expect(effectiveStep('country', { plan: null, hasCreatedGroup: false })).toBe('country')
})
test('con Free no se muestran Cobros ni WhatsApp', () => {
expect(effectiveStep('payment', { plan: 'FREE', hasCreatedGroup: false })).toBe('group')
expect(effectiveStep('whatsapp', { plan: 'FREE', hasCreatedGroup: false })).toBe('group')
expect(effectiveStep('payment', { plan: 'PRO', hasCreatedGroup: false })).toBe('payment')
})
test('"Listo" necesita el grupo creado, y con el grupo creado no se vuelve al formulario', () => {
expect(effectiveStep('done', { plan: 'PRO', hasCreatedGroup: false })).toBe('group')
expect(effectiveStep('group', { plan: 'PRO', hasCreatedGroup: true })).toBe('done')
expect(effectiveStep('plan', { plan: 'FREE', hasCreatedGroup: true })).toBe('done')
})
})