fix(editor): one history entry per reference edit, focus kept

Final review fixes. « Terminer » and every panel close re-committed the
edited field against a stale value, adding a second identical history
entry so the first « Défaire » seemed to do nothing: the tile now reads
the latest applied value (tests assert the undo-length delta). A tile
leaving the search on « Terminer » stays pinned until the next view
change and keeps focus; « Ajouter la référence » resets search and sort
and focuses the new tile. Also: refused draft dropped on a read-only
flip is announced; arrow keys respect a refused tab switch; pinned
index kept across read-only; the panel announces « Références citées »;
search text inserted literally; « Aller à » names its citer; the edit
header's name starts with « Terminer. »; undo removing the focused panel
tile moves focus per P20; no-result announced once; docs corrected.

Gates: typecheck, lint, test:run (app 1510), build, e2e:ui 251;
e2e:shell 16 specs (admin and editor-equine excluded): 117 passed / 108
skipped / 1 failed (crossing:211 stuck on the MFA step-up screen before
the editor), rerun alone 11 passed; full-row guard: no pre-existing row
changed in any table.
This commit is contained in:
bchanot committed 2026-11-13 01:08:00 +01:00
1 parent 2182307c62
commit 1bf27014b3
21 files changed
+677 -136

No files matched your search

+14 -6
View File
@@ -168,15 +168,24 @@ test.describe('reference tiles, edit mode', () => {
const url = tile.getByLabel(dict['editor.reference.url'])
await url.fill('exemple.org')
await tile
.getByRole('button', { name: dict['editor.references.done'] })
.getByRole('button', {
name: dict['editor.references.done'],
exact: true,
})
.click()
await expect(url).toBeFocused()
await expect(
tile.getByRole('button', { name: dict['editor.references.done'] }),
tile.getByRole('button', {
name: dict['editor.references.done'],
exact: true,
}),
).toBeVisible()
await url.fill('https://exemple.org/page')
await tile
.getByRole('button', { name: dict['editor.references.done'] })
.getByRole('button', {
name: dict['editor.references.done'],
exact: true,
})
.click()
await expect(tile.getByLabel(dict['editor.reference.url'])).toHaveCount(0)
await expect(
@@ -338,9 +347,8 @@ test.describe('reference tiles, search, sort and add', () => {
// No result, then the notice's own clear button.
await bar.search.fill('radiographie')
const notice = libraryRoot(page).getByRole('status').filter({
hasText: 'radiographie',
})
const notice = libraryRoot(page).getByTestId('editor-references-no-result')
await expect(notice).toContainText('radiographie')
await expect(notice).toContainText('Aucune référence ne contient')
await expectAccessible(page, 'the no result notice')
await notice