feat(editor): references side panel with filter, search and counts

Non-modal panel in a relative container after the tab row (scrim over the
tab panels, which are inert while it is open). Chip "Citées par" opened
from a finding's Citations block, "Tout afficher (N)", accent- and
case-insensitive search on citation, DOI and URL, "citée n fois" per card
(citationCounts, memoised TS read; the core stays the authority for
refused deletions). Up/down only without filter or search. "Aller à" a
reference clears a hiding search then focuses the card.

Rewritten assertions (R-24): editor-shell "the references panel keeps its
form text and no id repeats" closes the panel before reaching the inert
tab panels. Added: Chromium clickability at 1 024 and 1 280 px (top and
scrolled), editor-structures count and search, unit
editor-references-panel, editor-citations, navigation clear_cited_by.
This commit is contained in:
bchanot committed 2026-11-08 17:33:26 +01:00
1 parent cf9c300c80
commit ab51ea764d
19 files changed
+891 -85

No files matched your search

@@ -6,6 +6,7 @@ import TextField from '@/components/editor/fields/TextField'
import { FOCUS_CLASS, focusAttrs } from '@/editor/focusRequest'
import { isBlank, nullable } from '@/editor/sheetDocument'
import { useEditCommand } from '@/editor/useEditCommand'
import { usePlural } from '@/editor/plural'
import { useT } from '@/i18n/useT'
import { REFERENCE_TYPES } from './referenceTypes'
@@ -16,15 +17,23 @@ export default function ReferenceRow({
reference,
index,
count,
cited,
movable,
readOnly,
onDelete,
}: {
reference: Reference
/** Position in the whole bibliography, not in a filtered list. */
index: number
count: number
/** How many findings cite it. */
cited: number
/** ↑ / ↓ only while neither the finding filter nor the search narrows the list. */
movable: boolean
readOnly: boolean
onDelete: () => void
}) {
const plural = usePlural()
const t = useT()
const edit = useEditCommand()
const key = { kind: 'reference', id: reference.id } as const
@@ -41,7 +50,10 @@ export default function ReferenceRow({
const prefix = `reference-${reference.id}`
return (
<li {...focusAttrs(key)} className={`${CARD} ${FOCUS_CLASS}`}>
<div className="grid gap-3 md:grid-cols-2">
<p className="text-right text-sm text-[var(--color-ink-muted)]">
{plural('editor.references.cited', cited)}
</p>
<div className="grid gap-3">
<SelectField
id={`${prefix}-type`}
label={t('editor.reference.type')}
@@ -82,12 +94,16 @@ export default function ReferenceRow({
/>
</div>
<div className="flex flex-wrap items-center justify-end gap-1">
<MoveButtons
index={index}
count={count}
readOnly={readOnly}
onMove={(position) => edit.run('move', { op: 'move', key, position })}
/>
{movable && (
<MoveButtons
index={index}
count={count}
readOnly={readOnly}
onMove={(position) =>
edit.run('move', { op: 'move', key, position })
}
/>
)}
<ActionButton
readOnly={readOnly}
variant="danger"