feat(app): history reads Défaire / Refaire (R1, D5)

FR names Défaire / Refaire; title = name + shortcut (Ctrl+Z ou ⌘Z /
Ctrl+Maj+Z ou ⇧⌘Z), aria-label = name, aria-keyshortcuts adds Meta forms.
New keys editor.history.{undo,redo}_shortcut (fr, en). FR prose use_parent_body
and repair.body_one/_other say Défaire. Dialog Annuler unchanged.

Assertion map (R-24):
- editor-history-buttons.test.tsx UNDO/REDO constants 'Annuler la dernière
  modification' / 'Rétablir la dernière modification annulée' → 'Défaire la
  dernière modification' / 'Refaire la dernière modification défaite'
- :80-81 title === UNDO/REDO → title `${UNDO} (Ctrl+Z ou ⌘Z)` / `${REDO}
  (Ctrl+Maj+Z ou ⇧⌘Z)`
- :82-83 aria-keyshortcuts 'Control+Z' / 'Control+Shift+Z' → 'Control+Z
  Meta+Z' / 'Control+Shift+Z Meta+Shift+Z'
- visible labels ['Annuler','Rétablir'] → ['Défaire','Refaire']
- tool column absence /Annuler|Rétablir/ → /Défaire|Refaire/ (also
  editor-annotations-tab.test.tsx:514)
- Rétablir button lookup by literal name → REDO constant
- added: EN names unchanged with title '(Ctrl+Z or ⌘Z)'; FR prose contains
  Défaire while use_parent_cancel stays 'Annuler'
- e2e titles/comments only: Annuler/Rétablir → Défaire/Refaire
This commit is contained in:
bchanot committed 2026-11-12 12:39:01 +01:00
1 parent 5803854860
commit 7dda61d2ae
10 files changed
+70 -34

No files matched your search

@@ -144,7 +144,7 @@ interface EditorTabsProps {
/**
* The draft's tab row (boards 04 and 05): the four tabs from 640 px, Annotations and
* Vérification below it with « Plus » opening a disclosure of the others (no measurement).
* « Annuler » and « Rétablir » sit at the right end of the row on every tab.
* « Défaire » and « Refaire » sit at the right end of the row on every tab.
*/
export default function EditorTabs({
active,
@@ -13,8 +13,8 @@ import EditorGlyph from './EditorGlyph'
type Direction = 'undo' | 'redo'
const SHORTCUT: Record<Direction, string> = {
undo: 'Control+Z',
redo: 'Control+Shift+Z',
undo: 'Control+Z Meta+Z',
redo: 'Control+Shift+Z Meta+Shift+Z',
}
const BUTTON =
@@ -38,7 +38,7 @@ function asField(element: Element | EventTarget | null): HTMLElement | null {
* pointer-down, natural when Tab reaches the button), the click or key then reads the
* store, so the typed text is the last change the undo reverts. A field whose commit was
* refused keeps its error: the step is skipped and focus goes back to it. The field is
* remembered across the pair: from a field, « Annuler » is two Shift+Tab away. A touch
* remembered across the pair: from a field, « Défaire » is two Shift+Tab away. A touch
* press fires pointer leave between its up and its click, so only a mouse leaving the
* button forgets the field (a hovering pointer that left meant no press), or a cancel.
*/
@@ -50,7 +50,7 @@ function usePress(
const forget = () => {
left.current = null
}
// Tab from « Rétablir » to « Annuler » (or back) is still the same press of the pair.
// Tab from « Refaire » to « Défaire » (or back) is still the same press of the pair.
const onBlur = (event: FocusEvent<HTMLElement>) => {
const pair = event.currentTarget.parentElement
if (!pair?.contains(event.relatedTarget as Node | null)) forget()
@@ -104,7 +104,7 @@ function HistoryButton({
<button
type="button"
aria-label={name}
title={name}
title={`${name} (${t(`editor.history.${direction}_shortcut`)})`}
aria-disabled={readOnly || !steppable}
aria-keyshortcuts={SHORTCUT[direction]}
{...press}
@@ -118,7 +118,7 @@ function HistoryButton({
)
}
/** « Annuler » and « Rétablir », at the right of the tab row on every tab. */
/** « Défaire » and « Refaire », at the right of the tab row on every tab. */
export default function HistoryButtons() {
const left = useRef<HTMLElement | null>(null)
return (