refactor(web): Admin, Settings and Collection share one rail layout (DRY W7)

The three areas each repeated the same title, left rail and content grid.
SectionLayout now draws it once, with the rail and any lines under the
title as snippets.

Admin pages now get the content cap Settings has (max-w-[100rem]): both lay
their groups out in SettingsColumns, and without it Admin's two columns
stretched across a very wide screen. The Collection keeps its uncapped
lists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-27 03:23:10 -05:00
co-authored by Claude Opus 5.5
parent f298c44ecd
commit abf30b1295
4 changed files with 63 additions and 45 deletions
@@ -0,0 +1,40 @@
<script lang="ts">
import type { Snippet } from 'svelte';
// An area laid out as one page per section down a left rail: Settings,
// Admin and the Collection, so the sections sit in the same place
// everywhere. On a phone the rail stacks above the page.
let {
title,
intro,
rail,
contentClass = 'max-w-[100rem] space-y-6',
children
}: {
title: string;
/** Lines under the title. */
intro?: Snippet;
rail: Snippet;
/** Pages laid out in SettingsColumns keep the default: the cap only stops
the columns stretching on a very wide screen. */
contentClass?: string;
children?: Snippet;
} = $props();
</script>
<div class="space-y-4">
<header class="space-y-1">
<h1 class="font-display text-2xl font-medium text-text-primary">{title}</h1>
{@render intro?.()}
</header>
<div class="md:grid md:grid-cols-[11rem_minmax(0,1fr)] md:gap-6">
<div class="mb-4 md:mb-0">
<div class="md:sticky md:top-4">
{@render rail()}
</div>
</div>
<div class="min-w-0 {contentClass}">
{@render children?.()}
</div>
</div>
</div>