fix(app): Administration home cards laid out as board 29 B

- the grid aligns its cards at the start; Espèces and Accès et
  habilitations stack in one right-hand column at their own height
- when the sheets card is refused, that column spans the grid and lays
  its cards side by side, so no half of the page stays empty
- the card's sheet name links are 44 px tall on the phone, unchanged
  from sm up
- the card item keeps the list row's rhythm (space-y-1), a larger gap
  only above the working copy action

No test changed.
This commit is contained in:
bchanot committed 2026-11-16 17:59:47 +01:00
1 parent 1758276087
commit 8bb2486a34
1 file changed
+21 -6
@@ -35,6 +35,20 @@ const SUBHEADING =
const LINK = const LINK =
'inline-flex min-h-11 items-center text-sm font-medium text-[var(--color-accent-strong)] underline underline-offset-2' 'inline-flex min-h-11 items-center text-sm font-medium text-[var(--color-accent-strong)] underline underline-offset-2'
/** The sheet's name: a 44 px target on the phone, plain text height from `sm` up. */
const SHEET_LINK =
'mr-auto min-w-0 font-medium text-[var(--color-ink)] underline-offset-2 hover:underline ' +
'max-sm:inline-flex max-sm:min-h-11 max-sm:items-center'
/**
* Board 29 B: the sheets card on the left, the entry cards stacked on the right at
* their own height. Alone (the sheets card refused), the column spans the grid and
* lays its cards side by side, so no half of the page stays empty.
*/
const CARDS = 'grid items-start gap-4 md:grid-cols-2'
const ENTRY_COLUMN =
'grid items-start gap-4 md:only:col-span-2 md:only:grid-cols-2'
/** « Vos habilitations : … · rôle propriétaire · session renforcée … active. » (board 10). */ /** « Vos habilitations : … · rôle propriétaire · session renforcée … active. » (board 10). */
function permissionsLine(t: Translate, permissions: AdminPermissions): string { function permissionsLine(t: Translate, permissions: AdminPermissions): string {
const list = permissions.capabilities.map((kind) => const list = permissions.capabilities.map((kind) =>
@@ -70,12 +84,9 @@ function SheetItem({ sheet, species, editor }: SheetItemProps) {
const t = useT() const t = useT()
const locale = useLocaleStore((s) => s.locale) const locale = useLocaleStore((s) => s.locale)
return ( return (
<li className="space-y-2 py-3 first:pt-0 last:pb-0"> <li className="space-y-1 py-3 first:pt-0 last:pb-0">
<div className="flex flex-wrap items-center gap-2"> <div className="flex flex-wrap items-center gap-2">
<Link <Link to={`/app/admin/sheets/${sheet.sheet_id}`} className={SHEET_LINK}>
to={`/app/admin/sheets/${sheet.sheet_id}`}
className="mr-auto min-w-0 font-medium text-[var(--color-ink)] underline-offset-2 hover:underline"
>
{localized(sheet.name, locale)} {localized(sheet.name, locale)}
</Link> </Link>
<SheetBadges sheet={sheet} /> <SheetBadges sheet={sheet} />
@@ -88,11 +99,13 @@ function SheetItem({ sheet, species, editor }: SheetItemProps) {
</p> </p>
{/* The working copy action (W1): editors only, on the historical sheet. */} {/* The working copy action (W1): editors only, on the historical sheet. */}
{sheet.historical && editor && ( {sheet.historical && editor && (
<div className="pt-1">
<WorkingCopyAction <WorkingCopyAction
slug={sheet.slug} slug={sheet.slug}
sourceVersionId={sheet.latest_version?.version_id ?? null} sourceVersionId={sheet.latest_version?.version_id ?? null}
copyActive={sheet.working_copy_active === true} copyActive={sheet.working_copy_active === true}
/> />
</div>
)} )}
</li> </li>
) )
@@ -260,8 +273,9 @@ export default function AdminHomeRoute() {
)} )}
</div> </div>
</header> </header>
<div className="grid gap-4 md:grid-cols-2"> <div className={CARDS}>
<SheetsCard editor={permissions.editor} /> <SheetsCard editor={permissions.editor} />
<div className={ENTRY_COLUMN}>
<EntryCard <EntryCard
id="admin-species-title" id="admin-species-title"
title={t('admin.species.title')} title={t('admin.species.title')}
@@ -278,5 +292,6 @@ export default function AdminHomeRoute() {
)} )}
</div> </div>
</div> </div>
</div>
) )
} }