Project picker names the connected Supabase organization, and says to change it on the approval page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
minimus7andClaude Opus 5.5 committed 2026-11-09 12:11:40 -06:00
1 parent c7df0dba8f
commit cb56fd11a0
3 files changed
+18 -4

No files matched your search

+5 -2
View File
@@ -214,10 +214,11 @@ type Project = { id: string; name: string; region?: string; status?: string };
// public key and creates the tables (POST /api/setup/supabase/project).
export function ProjectPicker({ onDone }: { onDone: () => void }) {
const [projects, setProjects] = useState<Project[] | null>(null);
const [orgs, setOrgs] = useState<string[]>([]);
const [busy, setBusy] = useState<string | null>(null);
const [msg, setMsg] = useState("");
useEffect(() => {
fetch("/api/setup/supabase/project").then((r) => r.json()).then((b: { projects?: Project[]; error?: string }) => (b.error ? setMsg(b.error) : setProjects(b.projects ?? []))).catch(() => setMsg("Couldn't reach broke. Is it still running?"));
fetch("/api/setup/supabase/project").then((r) => r.json()).then((b: { projects?: Project[]; orgs?: string[]; error?: string }) => { if (b.error) setMsg(b.error); else { setProjects(b.projects ?? []); setOrgs(b.orgs ?? []); } }).catch(() => setMsg("Couldn't reach broke. Is it still running?"));
}, []);
async function use(body: { ref?: string; create?: boolean }, label: string) {
setBusy(label);
@@ -229,8 +230,10 @@ export function ProjectPicker({ onDone }: { onDone: () => void }) {
else setMsg(b?.error ?? "That didn't work. Try again.");
}
if (!projects && !msg) return <p className="text-sm text-muted">Finding your projects…</p>;
const where = orgs.length ? `Supabase organization${orgs.length > 1 ? "s" : ""} ${orgs.map((o) => `“${o}”`).join(", ")}` : "your Supabase account";
return (
<div className="space-y-3">
<p className="text-sm text-muted">{projects?.length ? `Projects in ${where}:` : `Connected to ${where}, which has no projects yet.`}</p>
{!!projects?.length && (
<ul className="space-y-2">
{projects.map((p) => (
@@ -247,7 +250,7 @@ export function ProjectPicker({ onDone }: { onDone: () => void }) {
{msg && <p className="text-sm text-bad">{msg}</p>}
<div className="pt-1 space-y-1">
<ConnectSupabaseButton onDone={onDone} fresh quiet label="Use a different Supabase organization" />
<p className="text-xs text-muted">Signs in to Supabase again, so you can choose the organization that has the project you want.</p>
<p className="text-xs text-muted">Signs in to Supabase again. On Supabase&apos;s approval page, change the organization to the one that has the project you want before you approve.</p>
</div>
</div>
);