From 43c3ef8b6b68d7a06357d0abb2aee0da4ab59a47 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 28 Sep 2026 10:54:17 +0000 Subject: [PATCH] Redirect to a new Discover page after saving profile The Save button was working (PATCH /api/profile succeeded), but the only feedback was a small "Saved." text with no page change - easy to read as "nothing happened," especially with no next step to move to. Added a placeholder /discover page (protected, same as /profile) and redirect there after a successful save, once the "Saved." confirmation has been visible for a moment. This is a stand-in for the real browse-other-members feature that's next on the roadmap, not the full feature itself. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01VL5YUEf2B9LG4xdVUQwcSg --- src/app/discover/page.tsx | 27 +++++++++++++++++++++++++++ src/app/profile/profile-editor.tsx | 25 +++++++++++++++++++------ src/proxy.ts | 2 +- 3 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 src/app/discover/page.tsx diff --git a/src/app/discover/page.tsx b/src/app/discover/page.tsx new file mode 100644 index 0000000..99bb9f7 --- /dev/null +++ b/src/app/discover/page.tsx @@ -0,0 +1,27 @@ +import Link from "next/link"; +import { getServerSession } from "next-auth"; +import { redirect } from "next/navigation"; +import { authOptions } from "@/lib/auth"; + +export default async function DiscoverPage() { + const session = await getServerSession(authOptions); + if (!session?.user?.id) { + redirect("/login"); + } + + return ( +
+

You're all set!

+

+ Your profile is saved. Browsing other members isn't built yet — that's next on the + roadmap. +

+ + Back to your profile + +
+ ); +} diff --git a/src/app/profile/profile-editor.tsx b/src/app/profile/profile-editor.tsx index bf5094c..f03b78a 100644 --- a/src/app/profile/profile-editor.tsx +++ b/src/app/profile/profile-editor.tsx @@ -17,13 +17,26 @@ export default function ProfileEditor({ e.preventDefault(); setStatus("saving"); - const res = await fetch("/api/profile", { - method: "PATCH", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ name, bio }), - }); + try { + const res = await fetch("/api/profile", { + method: "PATCH", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ name, bio }), + }); - setStatus(res.ok ? "saved" : "error"); + if (!res.ok) { + setStatus("error"); + return; + } + + setStatus("saved"); + // Give the "Saved." confirmation a moment to be seen before moving on. + setTimeout(() => { + window.location.href = "/discover"; + }, 700); + } catch { + setStatus("error"); + } } return ( diff --git a/src/proxy.ts b/src/proxy.ts index 783e4db..3f774da 100644 --- a/src/proxy.ts +++ b/src/proxy.ts @@ -14,5 +14,5 @@ export default async function proxy(request: NextRequest) { } export const config = { - matcher: ["/profile/:path*"], + matcher: ["/profile/:path*", "/discover/:path*"], };