|
| 1 | +--- |
| 2 | +status: done |
| 3 | +depends: [] |
| 4 | +specs: |
| 5 | + - specs/screens/home.md |
| 6 | +issues: [] |
| 7 | +pr: 128 |
| 8 | +--- |
| 9 | + |
| 10 | +# Plan: fix the home "Start a Project" CTA for logged-out visitors |
| 11 | + |
| 12 | +## Scope |
| 13 | + |
| 14 | +Leadership-team feedback (Kat + Travis, #0-leadership-team, June 2026, with |
| 15 | +mobile screenshots) reported the home page's "Start a Project" card landing on |
| 16 | +a dead page — `codeforphilly.gitbook.io/.../first-steps` now returns "Content |
| 17 | +owner not found". The reported "works on laptop, not phone" symptom was really |
| 18 | +**logged-in vs logged-out**, not responsive: the card branches on `person`, and |
| 19 | +the anonymous branch pointed at the legacy GitBook URL. |
| 20 | + |
| 21 | +What ships: |
| 22 | + |
| 23 | +- **Spec fix first.** `specs/screens/home.md` prescribed the GitBook URL for the |
| 24 | + anonymous case — the spec was wrong, so it leads. Anonymous now routes through |
| 25 | + `/login?return=/projects/create`, matching the already-correct Volunteer |
| 26 | + screen convention (`volunteer.md:52`). |
| 27 | +- **Code fix.** `Home.tsx` anonymous branch → `/login?return=/projects/create`; |
| 28 | + both branches are now in-app routes, so the `target="_blank"`/`rel` props drop |
| 29 | + away (no more external navigation through react-router `<Link>`). |
| 30 | + |
| 31 | +## Implements |
| 32 | + |
| 33 | +- [home.md](../specs/screens/home.md) — Get-involved card table + Authorization |
| 34 | + table: anonymous "Start a Project" routes through `/login?return=/projects/create`. |
| 35 | + |
| 36 | +## Approach |
| 37 | + |
| 38 | +### 1. Spec change (specops, source of truth first) |
| 39 | + |
| 40 | +`specs/screens/home.md` — Get-involved card link cell and the Authorization |
| 41 | +row both updated so the anonymous case is `/login?return=/projects/create` |
| 42 | +instead of the external GitBook URL. |
| 43 | + |
| 44 | +### 2. SPA: `apps/web/src/screens/Home.tsx` |
| 45 | + |
| 46 | +`to={person ? '/projects/create' : '/login?return=/projects/create'}` and |
| 47 | +remove the now-dead `target`/`rel` conditionals. Mirrors `Volunteer.tsx`. |
| 48 | + |
| 49 | +## Validation |
| 50 | + |
| 51 | +- [x] Spec updated: anonymous "Start a Project" → `/login?return=/projects/create`. |
| 52 | +- [x] `Home.tsx` anonymous branch routes in-app; no external GitBook URL remains. |
| 53 | +- [x] `target="_blank"`/`rel` props removed (both branches internal). |
| 54 | +- [x] Browser test: logged-out home → "Start a Project" → `/login?return=/projects/create` |
| 55 | + renders the real sign-in page; GitHub link carries `return=%2Fprojects%2Fcreate`. |
| 56 | +- [x] `npm run type-check && npm run lint && npm test` clean (web 74/74, shared 75/75). |
| 57 | + |
| 58 | +## Risks |
| 59 | + |
| 60 | +- Low. One-line behavior change on a well-trodden auth-redirect path already |
| 61 | + used by the Volunteer screen. `/login` honors `return` already. |
| 62 | + |
| 63 | +## Notes |
| 64 | + |
| 65 | +- The reported "works on laptop, not phone" was a misdiagnosis by the reporters: |
| 66 | + the card never branched on viewport, only on auth state (`person`). They were |
| 67 | + signed in on desktop, signed out on mobile. Worth remembering when triaging |
| 68 | + future "mobile-only" reports against this SPA — check auth state first. |
| 69 | +- The footer's "Start a Project" link (`AppFooter.tsx`) always points at |
| 70 | + `/projects/create` unconditionally; for an anon user that hits the route's own |
| 71 | + auth guard rather than the friendly login redirect. Left as-is — out of scope, |
| 72 | + and the route guard handles it — but noted in case we want footer parity later. |
| 73 | + |
| 74 | +## Follow-ups |
| 75 | + |
| 76 | +Separately surfaced in the same Slack thread, **not** part of this plan's scope |
| 77 | +(distinct features, not deferrals of this work): |
| 78 | + |
| 79 | +- **Issue:** admin can edit but not delete users (project "Danger Zone" has |
| 80 | + delete; users don't) — parity gap reported by Travis. |
| 81 | +- **Issue:** legacy image fallback — serve old-site images for users/projects |
| 82 | + (relates to the `codeforphilly-data-snapshot` work, #115). |
| 83 | + |
| 84 | +These are unrelated to the CTA fix and should be filed/triaged on their own; the |
| 85 | +CTA scope here is **None** outstanding. |
0 commit comments