feat(editor): kept-mounted tabs, sections and references panel

Each visited tab, Annotations section and the references panel stay
mounted in a KeptPlace (hidden, nested visibility). Composed canvases
detach while hidden. One JSON.parse per document text. Focus requests
reach only their owning place.

Rewritten assertions (R-24):
- editor-route.test.tsx:127: annotations testid toBeNull -> not.toBeVisible
- editor-sections.test.tsx: place('annotations.drawing') toBeNull -> not.toBeVisible
- editor-journey.spec.ts:311: page-wide getByLabel('Nom (FR)') -> scoped to place 'general'
- editor-tabs-lists.test.tsx: ReferencesPanel `open` prop dropped (the wrapper hides it)
- editor-annotations-tab, editor-focus-request, editor-sections tests: props gain `visited`
No assertion removed.
This commit is contained in:
bchanot committed 2026-11-06 20:50:40 +01:00
1 parent ca184da4d9
commit 6689827a8d
18 files changed
+847 -81

No files matched your search

@@ -44,7 +44,7 @@ describe('Références', () => {
it('adds a reference only with a type and a citation', async () => {
await openReady()
const user = userEvent.setup()
render(<ReferencesPanel {...props} open onClose={vi.fn()} />)
render(<ReferencesPanel {...props} onClose={vi.fn()} />)
await user.click(
screen.getByRole('button', { name: 'Ajouter la référence' }),
)
@@ -72,7 +72,7 @@ describe('Références', () => {
)
await openReady({ text })
const user = userEvent.setup()
render(<ReferencesPanel {...props} open onClose={vi.fn()} />)
render(<ReferencesPanel {...props} onClose={vi.fn()} />)
const url = screen.getByLabelText('Adresse web (URL)', {
selector: '#reference-ref-a-url',
})
@@ -111,7 +111,7 @@ describe('Références', () => {
})
await openReady({ text })
const user = userEvent.setup()
render(<ReferencesPanel {...props} open onClose={vi.fn()} />)
render(<ReferencesPanel {...props} onClose={vi.fn()} />)
await user.click(screen.getAllByRole('button', { name: 'Supprimer' })[0])
const refused = await screen.findByRole('dialog')
expect(within(refused).getByText(/cite cette référence/)).toBeTruthy()
@@ -127,7 +127,7 @@ describe('Références', () => {
it('read-only shows the citations as text', async () => {
await openReady({ text: insert(baseText(), reference('ref-a', 'Alpha')) })
render(<ReferencesPanel {...props} open onClose={vi.fn()} readOnly />)
render(<ReferencesPanel {...props} onClose={vi.fn()} readOnly />)
expect(screen.getByText('Alpha')).toBeTruthy()
expect(screen.queryByRole('textbox')).toBeNull()
expect(