Skip to content

Homepage refactor: 3-step checklist, language dropdown, RTL polish - #46

Merged
jokroese merged 11 commits into
mainfrom
homepage-refactor
May 9, 2026
Merged

Homepage refactor: 3-step checklist, language dropdown, RTL polish#46
jokroese merged 11 commits into
mainfrom
homepage-refactor

Conversation

@solsarratea

@solsarratea solsarratea commented May 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replaces the home page with a 3-step checklist (eligibility → documents → submission) that persists across visits via localStorage, and overhauls the result page + chrome to match.

Home (/[locale]/)

  • New 3-step checklist UI with per-document sub-checkboxes; tick state persisted in localStorage per device.
  • Active step is visually emphasised (primary-tinted background + glow + bigger title) so the next action is obvious on entry.
  • Step 1 (eligibility) auto-checks when the user reaches /result; the toggle is locked while the screener has been completed.
  • New "Borrar mi progreso" SvelteKit form action clears both the journey cookie and localStorage without navigating away.
  • Step 2's parent toggle cascades up/down with its document children.

Layout / chrome

  • Language switcher swapped from NativeSelect → shadcn Select (click-to-open, white-bg panel).
  • <html lang> and <html dir> are synced on client-side navigation via $effect, so switching to/from Arabic flips RTL immediately (no refresh).
  • Removed <noscript> fallback and orphaned .language-list/.language-link CSS.
  • Header nav defaulted back to "Inicio" / "Home" / "Accueil" / "الرئيسية".

Result page

  • "Recibir apoyo" panel only renders when the result is non-eligible.
  • "Cómo continuar" panel + "Ir a mi solicitud" CTA links back to the home checklist.
  • Redirects /result → home when there are no journey answers (clean state instead of a faulty render).

Translations (es/en/fr/ar)

  • New keys: pages.home.clear_progress_action, pages.result.continue_*, pages.result.summary_actions_*.
  • Removed obsolete: pages.home.note_*, pages.home.seo_*, pages.home.choose, pages.home.directory_*, pages.home.quiz_body, etc.
  • Tightened result.checklist.item.official_document_requirements copy.

Accessibility

  • pa11y + axe-core (WCAG2AA) clean across /es, /en, /fr, /ar, /es/screener, /es/organisations.
  • Fixed one finding: the footer "Radical Data" attribution link now has an underline (link-in-text-block).
  • Spot-checked text/contrast: foreground-on-card and primary-on-card both clear AA. Only borderline note: --muted-foreground (used by CardDescription etc.) sits at ~4.04:1 on white. Not changed in this PR — flagged in conversation for the team to decide whether to bump the global token.

Code quality

  • Audited against the Svelte 5 best-practices skill: only $state for truly reactive values, $derived/$derived.by for everything computed, $effect only for external DOM sync. Repeated step-card header extracted into a {#snippet}. enhance handler typed with SubmitFunction.
  • Format / lint / typecheck / 37 tests all green.

Test plan

  • /es (and /en, /fr, /ar) renders the 3-step home page; lead text reads "Sigue estos tres pasos para preparar tu solicitud. Marca cada paso al completarlo."
  • Tick a document in step 2 and refresh — state persists. Same for step 3 toggle.
  • Click a per-doc checkbox until all 3 are ticked → step 2 parent auto-ticks. Untick one → parent unticks.
  • Toggle step 2 parent → cascades to all child docs.
  • Active step (highlighted card) advances as you tick steps in order.
  • Switch language to Arabic from the dropdown without refreshing → page flips to RTL immediately. Switch back to Spanish → flips back.
  • Complete the screener (/screener/result) → step 1 on home is auto-checked, toggle is locked, "Ver resultado" button visible.
  • Click "Borrar mi progreso" on home → all 3 steps reset, no navigation, journey cookie also cleared (verify by reaching /result afterwards is redirected back home).
  • Visit /es/result with no cookies → redirected to /es.
  • Run pnpm format && pnpm lint && pnpm --filter @primer-paso/public typecheck && pnpm --filter @primer-paso/public test.

🤖 Generated with Claude Code

@netlify

netlify Bot commented May 7, 2026

Copy link
Copy Markdown

Deploy Preview for primer-paso ready!

Name Link
🔨 Latest commit a2eed32
🔍 Latest deploy log https://app.netlify.com/projects/primer-paso/deploys/69ff9d5e6dac870008e751b4
😎 Deploy Preview https://deploy-preview-46--primer-paso.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented May 7, 2026

Copy link
Copy Markdown

Deploy Preview for primer-paso-research canceled.

Name Link
🔨 Latest commit a2eed32
🔍 Latest deploy log https://app.netlify.com/projects/primer-paso-research/deploys/69ff9d5efe7dfa0008152c88

@netlify

netlify Bot commented May 7, 2026

Copy link
Copy Markdown

Deploy Preview for primer-paso-org-portal canceled.

Name Link
🔨 Latest commit a2eed32
🔍 Latest deploy log https://app.netlify.com/projects/primer-paso-org-portal/deploys/69ff9d5e76586000085cef95

solsarratea and others added 7 commits May 7, 2026 22:23
- Highlight the next active step with stronger contrast (bigger title, primary-tinted bg/glow, foreground-coloured eyebrow/hint).
- Lock step 1 toggle once the screener has been completed; add a "Borrar mi progreso" form action that clears journey cookie + localStorage without navigating.
- Sync <html lang>/<dir> on client-side language change via $effect so RTL takes effect without a refresh.
- Replace native select with shadcn Select for the language switcher (white-bg dropdown panel, click-to-open).
- Default home nav back to "Inicio" after iterating on copy.
- Trim "Recibir apoyo" to !isEligible only; unify result-page handover/restart into one panel and link to the home with "Ir a mi solicitud".
- Fix a11y: footer attribution link now underlined (axe link-in-text-block); remove unused noscript fallback + dead language-list/link CSS.
- Extract repeated step-card header into a {#snippet}; tighten enhance handler with SubmitFunction typing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@solsarratea
solsarratea force-pushed the homepage-refactor branch from adb856f to 135c7ba Compare May 7, 2026 20:24
@solsarratea
solsarratea marked this pull request as ready for review May 7, 2026 20:25
@solsarratea
solsarratea requested a review from jokroese as a code owner May 7, 2026 20:25
Comment thread apps/public/src/routes/[lang=lang]/result/+page.server.ts
Comment thread apps/public/src/lib/home-checklist.ts
Comment thread apps/public/src/routes/[lang=lang]/+page.svelte
Comment thread apps/public/src/routes/[lang=lang]/+page.svelte
@solsarratea
solsarratea force-pushed the homepage-refactor branch from 7b0d30d to 517086d Compare May 9, 2026 20:44
@jokroese
jokroese dismissed their stale review May 9, 2026 20:49

fixed :)

@jokroese
jokroese merged commit fa5fd94 into main May 9, 2026
14 checks passed
@jokroese
jokroese deleted the homepage-refactor branch May 9, 2026 20:50
jokroese added a commit that referenced this pull request May 11, 2026
* Initialize homepage refactor

* clean up code with svelte best practices skill

* Update navigation and step 1 on path

* Update layout on language change

* highlight step 1 and update generic text

* refine homepage step polish, lock + clear, and a11y

- Highlight the next active step with stronger contrast (bigger title, primary-tinted bg/glow, foreground-coloured eyebrow/hint).
- Lock step 1 toggle once the screener has been completed; add a "Borrar mi progreso" form action that clears journey cookie + localStorage without navigating.
- Sync <html lang>/<dir> on client-side language change via $effect so RTL takes effect without a refresh.
- Replace native select with shadcn Select for the language switcher (white-bg dropdown panel, click-to-open).
- Default home nav back to "Inicio" after iterating on copy.
- Trim "Recibir apoyo" to !isEligible only; unify result-page handover/restart into one panel and link to the home with "Ir a mi solicitud".
- Fix a11y: footer attribution link now underlined (axe link-in-text-block); remove unused noscript fallback + dead language-list/link CSS.
- Extract repeated step-card header into a {#snippet}; tighten enhance handler with SubmitFunction typing.

* Update background color for step cards

* fix(public): tidy home checklist state handling

* Restore results to main and add a pop up for confirmation on delete answers

* update gitignore

* fix format

---------

Co-authored-by: Jo Kroese <jo@jokroese.com>
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.

2 participants