From 3cb76b33c8d31c9a3c308ebdb413e7624f6ea457 Mon Sep 17 00:00:00 2001 From: Jonathan Hvid Date: Mon, 11 May 2026 14:47:28 +0200 Subject: [PATCH] feat(home): role-based / redirect via homeRouteForRole cab and fenja are sent to /pulse on landing; pilot continues to see the existing editorial home content in place. Uses the same helper the test suite already covers, so behaviour is locked in. Adds a minimal /pulse stub so the redirect target resolves; step 7 replaces it with the full member view. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/pages/index.astro | 7 +++++++ src/pages/pulse.astro | 28 ++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 src/pages/pulse.astro diff --git a/src/pages/index.astro b/src/pages/index.astro index 2556cb9..4e38b85 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -2,10 +2,17 @@ import AppLayout from '../layouts/AppLayout.astro'; import ProjectLockup from '../components/ProjectLockup.astro'; import { hasJoinRequest } from '../lib/db'; +import { homeRouteForRole } from '../lib/routing'; import { existsSync } from 'fs'; import { join } from 'path'; const user = Astro.locals.user; + +// Council members (cab) and Fenja team (fenja) land on /pulse; pilots see +// the existing editorial home below — the right audience for that content. +const redirectTo = homeRouteForRole(user.role); +if (redirectTo) return Astro.redirect(redirectTo); + const firstName = user.name.split(' ')[0]; const alreadyJoined = hasJoinRequest(user.id); const innofoundarLogoExists = existsSync(join(process.cwd(), 'public/innofounder-logo.png')); diff --git a/src/pages/pulse.astro b/src/pages/pulse.astro new file mode 100644 index 0000000..1b976c2 --- /dev/null +++ b/src/pages/pulse.astro @@ -0,0 +1,28 @@ +--- +import AppLayout from '../layouts/AppLayout.astro'; + +const user = Astro.locals.user; +const firstName = user.name.split(' ')[0]; +--- + +
+

Pulse

+

Welcome back, {firstName}.

+

The full member view lands in the next commit.

+
+
+ +