refactor(editor): rename the reference panel's place to citations
Frees the name « references » for the fifth tab (R2.1). The panel's
data-place, PlaceName and ids become citations; no visible change.
EditorTarget, move kind, i18n keys and domain fields keep their names
(removed in R2.1).
R-24 (no assertion removed or weakened): unit editor-route, no-loss,
references-panel, route-recovery ids editor-references-* -> editor-citations-*;
keep-alive inPlace/place('references') -> 'citations'; focus-request
ownedBy 'references' -> 'citations'. e2e support openReferences /
closeReferences, crossing 204/271, journeys 247, layout 234/305,
deselect 229, shell 135 -> place 'citations'; crossing 205 searchbox and
structures 95 « citée 0 fois » -> libraryRoot(page) (new helper).
Gates: typecheck, lint, test:run (app 1382), build, e2e:ui 251 passed,
e2e:shell 7 specs 63 passed / 63 skipped on db:sandbox (editor-equine
not listed); full-row guard: no pre-existing row changed in any table.
This commit is contained in:
1 parent
65a8fd37b8
commit
fc3fec7654
18 files changed
+46
-40
No files matched your search
@@ -226,7 +226,7 @@ test.describe('deselect and D6b (editor, mouse and keyboard)', () => {
|
||||
// The references panel: it closes, the selection stays, a second Escape deselects.
|
||||
await openReferences(page, dict)
|
||||
await page.keyboard.press('Escape')
|
||||
await expect(place(page, 'references')).toHaveCount(0)
|
||||
await expect(place(page, 'citations')).toHaveCount(0)
|
||||
await expectKept(page, POINT)
|
||||
await box(page).focus()
|
||||
await page.keyboard.press('Escape')
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
editorActor,
|
||||
geometryField,
|
||||
historyButton,
|
||||
libraryRoot,
|
||||
openEditor,
|
||||
openReferences,
|
||||
openSection,
|
||||
@@ -201,8 +202,8 @@ test.describe('editor shell, width crossing (H)', () => {
|
||||
dict['editor.reference.add'],
|
||||
'annotations',
|
||||
)
|
||||
await expect(place(page, 'references')).toBeVisible()
|
||||
await expect(place(page, 'references').getByRole('searchbox')).toBeVisible()
|
||||
await expect(place(page, 'citations')).toBeVisible()
|
||||
await expect(libraryRoot(page).getByRole('searchbox')).toBeVisible()
|
||||
})
|
||||
|
||||
test('the annotation edit body keeps its tool and its pending creation', async ({
|
||||
@@ -268,7 +269,7 @@ test.describe('editor shell, width crossing (H)', () => {
|
||||
await page.locator('#reference-new-citation').fill('Smith 1999')
|
||||
await cross(page, NARROW)
|
||||
await expectReadOnly(page)
|
||||
await expect(place(page, 'references')).toBeVisible()
|
||||
await expect(place(page, 'citations')).toBeVisible()
|
||||
await expect(saveLine(page)).toHaveText(UNSAVED_LINE)
|
||||
await cross(page, WIDE)
|
||||
await expect(page.locator('#reference-new-citation')).toHaveValue(
|
||||
|
||||
@@ -244,7 +244,7 @@ test.describe('editor shell journeys (H)', () => {
|
||||
|
||||
await selectTab(page, dict, 'verification')
|
||||
await goTo('Barone, Ostéologie')
|
||||
await expect(place(page, 'references')).toBeVisible()
|
||||
await expect(place(page, 'citations')).toBeVisible()
|
||||
await focusKey('ref-a')
|
||||
await closeReferences(page, dict)
|
||||
})
|
||||
|
||||
@@ -231,7 +231,7 @@ function focusKind(page: Page): Promise<Kind> {
|
||||
return page.evaluate((undoName) => {
|
||||
const el = document.activeElement
|
||||
if (!el) return 'other'
|
||||
if (el.closest('[data-place="references"]')) return 'panel'
|
||||
if (el.closest('[data-place="citations"]')) return 'panel'
|
||||
if (el.getAttribute('role') === 'tab') return 'tab'
|
||||
if (el.closest('[data-testid="history-buttons"]')) {
|
||||
return el.getAttribute('aria-label') === undoName ? 'undo' : 'redo'
|
||||
@@ -302,7 +302,7 @@ test.describe('editor shell keyboard order (H)', () => {
|
||||
})
|
||||
expect(order).toEqual(['header', 'tab', 'undo', 'redo', 'panel'])
|
||||
await page.keyboard.press('Escape')
|
||||
await expect(page.locator('[data-place="references"]:visible')).toHaveCount(
|
||||
await expect(page.locator('[data-place="citations"]:visible')).toHaveCount(
|
||||
0,
|
||||
)
|
||||
const after = await walk(page, 'side')
|
||||
|
||||
@@ -132,7 +132,7 @@ test.describe('editor shell, kept places (B2a)', () => {
|
||||
.click()
|
||||
const header = page.locator('main header').first()
|
||||
const tabs = page.getByRole('tablist')
|
||||
const panel = place(page, 'references')
|
||||
const panel = place(page, 'citations')
|
||||
const targets = [
|
||||
page.getByRole('button', { name: dict['common.save'], exact: true }),
|
||||
page.getByRole('button', {
|
||||
|
||||
@@ -6,11 +6,11 @@ import {
|
||||
bareShape,
|
||||
closeReferences,
|
||||
editorActor,
|
||||
libraryRoot,
|
||||
openEditor,
|
||||
openReferences,
|
||||
openSection,
|
||||
pickAnnotation,
|
||||
place,
|
||||
pointOf,
|
||||
revisionText,
|
||||
saveDraft,
|
||||
@@ -92,7 +92,7 @@ test.describe('editor structures (A4)', () => {
|
||||
)
|
||||
await expect(citations).toHaveCount(2)
|
||||
await expect(
|
||||
place(page, 'references').getByText('citée 0 fois'),
|
||||
libraryRoot(page).getByText('citée 0 fois'),
|
||||
).toHaveCount(2)
|
||||
await page
|
||||
.getByRole('searchbox', { name: dict['editor.references.search'] })
|
||||
|
||||
@@ -373,6 +373,11 @@ export async function openSection(
|
||||
await expect(place(page, `annotations.${section}`)).toBeVisible()
|
||||
}
|
||||
|
||||
/** Where the references library shows: today the citations panel (R2.1 moves it to its tab). */
|
||||
export function libraryRoot(page: Page): Locator {
|
||||
return place(page, 'citations')
|
||||
}
|
||||
|
||||
/** Opens the references panel from the header button. */
|
||||
export async function openReferences(page: Page, dict: Dict) {
|
||||
const toggle = page.getByRole('button', {
|
||||
@@ -381,14 +386,14 @@ export async function openReferences(page: Page, dict: Dict) {
|
||||
})
|
||||
if ((await toggle.getAttribute('aria-expanded')) !== 'true')
|
||||
await toggle.click()
|
||||
await expect(place(page, 'references')).toBeVisible()
|
||||
await expect(place(page, 'citations')).toBeVisible()
|
||||
}
|
||||
|
||||
export async function closeReferences(page: Page, dict: Dict) {
|
||||
await page
|
||||
.getByRole('button', { name: dict['editor.references.close'] })
|
||||
.click()
|
||||
await expect(place(page, 'references')).toHaveCount(0)
|
||||
await expect(place(page, 'citations')).toHaveCount(0)
|
||||
}
|
||||
|
||||
/** The revision the server holds for the draft. */
|
||||
|
||||
Reference in new issue
Block a user