Add a section nav to the admin editor and fold repeater rows
Every record editor gets a sticky "On this page" column listing its field groups and collections (with row counts), lighting the one in view and marking any with a save error. Below lg it becomes a sticky "Jump to" menu. Editor pages widen to fit it through a small layout context; other admin pages keep their width. Each collection now sits in its own card, and repeater rows fold to their title line. Rows start folded, with Expand all and Collapse all; a new row, or one the server rejected, opens itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
eaff23839f
commit
8186aff62f
5 changed files with 402 additions and 67 deletions
26
src/lib/adminWidth.tsx
Normal file
26
src/lib/adminWidth.tsx
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/* ═══════════════════════════════════════════════════════════════
|
||||
ADMIN PAGE WIDTH
|
||||
|
||||
The admin column is max-w-5xl. The record editor wants more: its
|
||||
section nav sits to the left of a form that keeps that width.
|
||||
Like the title (adminTitle.tsx), the page asks and the layout
|
||||
decides, so AdminLayout stays the one place that sets <main>'s
|
||||
width.
|
||||
|
||||
Clears on unmount, so leaving the editor puts the list pages
|
||||
back to their usual width.
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
import { createContext, useContext, useEffect } from "react";
|
||||
|
||||
export const AdminWidthContext = createContext<((wide: boolean) => void) | null>(null);
|
||||
|
||||
export function useWideAdminPage() {
|
||||
const setWide = useContext(AdminWidthContext);
|
||||
|
||||
useEffect(() => {
|
||||
if (!setWide) return undefined;
|
||||
setWide(true);
|
||||
return () => setWide(false);
|
||||
}, [setWide]);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue