From b78bc7df4bacd1bf436212fc4272293064fb633f Mon Sep 17 00:00:00 2001 From: Bretton <36870434+BrettM86@users.noreply.github.com> Date: Thu, 16 Jul 2026 00:23:56 -0700 Subject: [PATCH] fix(community): gate unmigrated settings routes behind a clear 404 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /c//settings blank-crashed reading the legacy Lemmy community_view shape, and settings/team rendered a moderator-management UI with no access checks that couldn't work — the Coves API has no community-update or moderator endpoints yet. Gate both routes with an explanatory 404 until those APIs exist. Co-Authored-By: Claude Fable 5 --- .../c/[handle=handle]/settings/+layout.ts | 33 +++++++------------ 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/src/routes/c/[handle=handle]/settings/+layout.ts b/src/routes/c/[handle=handle]/settings/+layout.ts index be47eedb..3f46c3a0 100644 --- a/src/routes/c/[handle=handle]/settings/+layout.ts +++ b/src/routes/c/[handle=handle]/settings/+layout.ts @@ -1,24 +1,13 @@ -import { coves } from '$lib/api/client.svelte' -import type { Handle } from '$lib/types/atproto' -import { communityHandleFromSlug, ReactiveState } from '$lib/app/util.svelte' -import CommunityCard from '$lib/feature/community/CommunityCard.svelte' +import type { CommunityViewDetailed } from '$lib/api/coves/types' +import type { ReactiveState } from '$lib/app/util.svelte' +import { error } from '@sveltejs/kit' -export async function load({ fetch, params }) { - const handle = communityHandleFromSlug(params.handle) as Handle - - const community = await coves({ func: fetch }).getCommunity({ - community: handle, - }) - - return { - community: new ReactiveState(community), - slots: { - sidebar: { - component: CommunityCard, - props: { - community: community, - }, - }, - }, - } +// TODO(coves-migration): The community settings pages under this layout are +// unmigrated Lemmy code, and the Coves API has no community-update or +// moderator-management endpoints yet. Without this gate they render a blank +// crash (legacy `community_view` shape) or a management UI that cannot work. +// Remove the gate and migrate the pages once those APIs exist. The declared +// return type keeps the (currently unreachable) pages type-checking. +export function load(): { community: ReactiveState } { + error(404, 'Community settings are not available yet') } -- 2.51.2