feat(editor): references dialog over the finding, view mode

A modal Dialog replaces the citations side sheet; families open it too
(isCitable). The finding dialog shows only « Références citées » and
« X références », also at zero; its edit form no longer carries
reference_ids. A dirty form refusing « Aller à » or « Tout afficher »
closes the clean references dialog first.
This commit is contained in:
bchanot committed 2026-11-15 16:13:57 +01:00
1 parent ff21b0315e
commit abc781df52
29 files changed
+432 -858

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@ type User = ReturnType<typeof userEvent.setup>
export const treeRow = (name: RegExp) => screen.getByRole('treeitem', { name })
/** The open finding dialog: the layer dialog that is not the citations sheet. */
/** The open finding dialog: the layer dialog that is not the references dialog. */
export const findingDialog = () =>
[...document.querySelectorAll<HTMLElement>('dialog[open][data-layer]')].find(
(dialog) => !dialog.querySelector('[data-testid="editor-citations-panel"]'),
+3 -5
View File
@@ -1,6 +1,6 @@
import { vi } from 'vitest'
import type { FindingLayer } from '@/editor/tabs'
import CitationsSheet from '@/components/editor/references/CitationsSheet'
import CitationsDialog from '@/components/editor/references/CitationsDialog'
import FindingsTab from '@/components/editor/tabs/FindingsTab'
import { findingLayerOf } from '@/editor/findingLayer'
import { citationsOfView } from '@/editor/navigation'
@@ -8,7 +8,7 @@ import { useEditorNavigation } from '@/editor/useEditorNavigation'
import { ReadOnlyContext } from '@/editor/editingContext'
/**
* Constats with the navigation that drives its dialog and the sheet over it (what the
* Constats with the navigation that drives its dialog and the references dialog over it (what the
* workspace gives it), without the rest of the editor.
*/
export default function FindingsHost({
@@ -25,13 +25,11 @@ export default function FindingsHost({
reloadSheet={vi.fn()}
layer={findingLayerOf(nav)}
/>
<CitationsSheet
<CitationsDialog
citedBy={citationsOfView(nav.state)}
readOnly={readOnly}
onClose={nav.closeCitations}
onShowAll={() => undefined}
navigate={nav.navigate}
onEdit={nav.references.open}
returnFocus={nav.citationsTrigger}
/>
</ReadOnlyContext>