feat(editor): header history, save line and Abandonner les modifications

Header Annuler/Retablir on every tab (aria-disabled, commit on pointerdown,
refused blur commit skips the undo). Save line: unsaved count selector
(savedDistance), saveLineState forms, server save time via readSaveTime
(lastSave in the store, never the browser clock). Discard relabelled and
names the stored copy. Tool column pair removed, glyphs in EditorGlyph.

Rewritten or removed assertions (R-24):
- editor-route.test: Revision 3 / unsaved text / Annuler les modifications
  -> save-line testid, Abandonner label, copy sentence in the dialog
- editor-route-conflict, editor-route-recovery: Revision n and copy_cap/
  copy_quota text queries -> save-line testid
- editor-no-loss: discard button label
- editor-annotations-tab: tool column undo/redo test -> no pair left
  (behaviour moved to editor-history-buttons.test)
- e2e journey/annotations/recovery/structures/support saveDraft/lan:
  undo/redo and revision/unsaved text -> historyButton, saveLine helpers;
  structures toHaveCount(0) on old text -> exact Revision n line
- editor-shell clickability: header Annuler/Retablir added
This commit is contained in:
bchanot committed 2026-11-08 17:55:49 +01:00
1 parent ab51ea764d
commit 99b669bf8f
29 files changed
+1397 -248

No files matched your search

@@ -0,0 +1,71 @@
import { useEffect, useState } from 'react'
import Button from '@/components/ui/Button'
import { useEditorReadOnly } from '@/editor/editingContext'
import { loadFailureMessage } from '@/editor/messages'
import { copyExists } from '@/editor/state/recovery'
import { useEditorStore } from '@/editor/state/editorStore'
import { useT } from '@/i18n/useT'
import ConfirmDialog from './ConfirmDialog'
/**
* « Abandonner les modifications »: asks first, then the store reloads the server draft.
* The confirmation names the temporary local copy when one is stored at the moment it
* opens (a copy left by an earlier write counts, not only the last write's).
*/
export default function DiscardButton({
onFailure,
}: {
/** A failed reload after a discard, worded for the notice under the header. */
onFailure: (message: string | null) => void
}) {
const t = useT()
const unsaved = useEditorStore((s) => s.unsaved)
const saving = useEditorStore((s) => s.saving)
const readOnly = useEditorReadOnly()
const [asking, setAsking] = useState(false)
const [copyNamed, setCopyNamed] = useState(false)
// The editor turned read-only while asking: the confirmation closes without effect.
useEffect(() => {
if (readOnly) setAsking(false)
}, [readOnly])
const ask = () => {
const { userId, versionId } = useEditorStore.getState()
setCopyNamed(copyExists(userId ?? '', versionId ?? ''))
setAsking(true)
}
const discard = async () => {
setAsking(false)
const result = await useEditorStore
.getState()
.discardChanges({ confirmed: true })
onFailure(
!result.ok && result.reason === 'load'
? loadFailureMessage(t, result.failure)
: null,
)
}
const body = copyNamed
? `${t('editor.draft.discard_ask')} ${t('editor.draft.discard_copy')}`
: t('editor.draft.discard_ask')
return (
<>
<Button
type="button"
variant="secondary"
disabled={!unsaved || saving || readOnly}
onClick={ask}
>
{t('editor.draft.discard')}
</Button>
<ConfirmDialog
open={asking}
title={t('editor.draft.discard')}
body={body}
confirmLabel={t('editor.draft.discard_confirm')}
cancelLabel={t('common.cancel')}
onConfirm={() => void discard()}
onCancel={() => setAsking(false)}
/>
</>
)
}
@@ -0,0 +1,50 @@
export type GlyphName =
| 'select'
| 'point'
| 'zone'
| 'link'
| 'in'
| 'out'
| 'fit'
| 'undo'
| 'redo'
| 'search'
/** The editor's one glyph table (24-unit grid strokes); `book` and `close` are in `Icon`. */
const GLYPHS: Record<GlyphName, string> = {
select: 'M5 3l12 7-5 1-3 5z',
point: 'M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM12 3v3M12 18v3M3 12h3M18 12h3',
zone: 'M12 3l8 6-3 10H7L4 9z',
link: 'M4 4h8v8H4zM12 12h8v8h-8z',
in: 'M11 5v12M5 11h12M20 20l-4-4',
out: 'M5 11h12M20 20l-4-4',
fit: 'M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5',
undo: 'M9 7L4 12l5 5M4 12h11a5 5 0 0 1 0 10',
redo: 'M15 7l5 5-5 5M20 12H9a5 5 0 0 0 0 10',
search: 'M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14zM20 20l-4-4',
}
/** A decorative glyph of the editor, drawn in the current text colour. */
export default function EditorGlyph({
name,
size = 20,
}: {
name: GlyphName
size?: number
}) {
return (
<svg
viewBox="0 0 24 24"
width={size}
height={size}
fill="none"
stroke="currentColor"
strokeWidth="1.8"
strokeLinecap="round"
strokeLinejoin="round"
aria-hidden="true"
>
<path d={GLYPHS[name]} />
</svg>
)
}
@@ -10,6 +10,7 @@ import {
} from '@/editor/tabs'
import type { TabTier } from '@/editor/useViewport'
import { useT } from '@/i18n/useT'
import HistoryButtons from './HistoryButtons'
const BASE =
'min-h-11 whitespace-nowrap border-b-2 px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)]'
@@ -143,6 +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.
*/
export default function EditorTabs({
active,
@@ -156,6 +158,7 @@ export default function EditorTabs({
{more.length > 0 && (
<MoreTabs more={more} active={active} onSelect={onSelect} />
)}
<HistoryButtons />
</div>
)
}
@@ -1,12 +1,9 @@
import { useEffect, useState } from 'react'
import Button from '@/components/ui/Button'
import Icon from '@/components/ui/Icon'
import { useEditorReadOnly } from '@/editor/editingContext'
import { loadFailureMessage } from '@/editor/messages'
import { useEditorStore } from '@/editor/state/editorStore'
import { REFERENCES_BUTTON_ID } from '@/editor/tabs'
import { useT } from '@/i18n/useT'
import ConfirmDialog from './ConfirmDialog'
import DiscardButton from './DiscardButton'
import SaveLine from './SaveLine'
interface Props {
@@ -18,50 +15,6 @@ interface Props {
onFailure: (message: string | null) => void
}
/** « Abandonner les modifications »: asks first, then the store reloads the server draft. */
function DiscardButton({ onFailure }: Pick<Props, 'onFailure'>) {
const t = useT()
const unsaved = useEditorStore((s) => s.unsaved)
const saving = useEditorStore((s) => s.saving)
const readOnly = useEditorReadOnly()
const [asking, setAsking] = useState(false)
useEffect(() => {
if (readOnly) setAsking(false)
}, [readOnly])
const discard = async () => {
setAsking(false)
const result = await useEditorStore
.getState()
.discardChanges({ confirmed: true })
onFailure(
!result.ok && result.reason === 'load'
? loadFailureMessage(t, result.failure)
: null,
)
}
return (
<>
<Button
type="button"
variant="secondary"
disabled={!unsaved || saving || readOnly}
onClick={() => setAsking(true)}
>
{t('editor.draft.discard')}
</Button>
<ConfirmDialog
open={asking}
title={t('editor.draft.discard')}
body={t('editor.draft.discard_ask')}
confirmLabel={t('editor.draft.discard_confirm')}
cancelLabel={t('common.cancel')}
onConfirm={() => void discard()}
onCancel={() => setAsking(false)}
/>
</>
)
}
function SaveButton() {
const t = useT()
const unsaved = useEditorStore((s) => s.unsaved)
@@ -0,0 +1,93 @@
import { useRef } from 'react'
import { useEditorReadOnly } from '@/editor/editingContext'
import { commitFocusedField } from '@/editor/focusRequest'
import { canRedo, canUndo, useEditorStore } from '@/editor/state/editorStore'
import { useT } from '@/i18n/useT'
import EditorGlyph from './EditorGlyph'
type Direction = 'undo' | 'redo'
const SHORTCUT: Record<Direction, string> = {
undo: 'Control+Z',
redo: 'Control+Shift+Z',
}
const BUTTON =
'inline-flex min-h-11 min-w-11 items-center justify-center gap-1.5 rounded-md ' +
'px-2 text-sm text-[var(--color-ink)] hover:bg-[var(--color-surface-strong)] ' +
'aria-disabled:cursor-not-allowed aria-disabled:opacity-40 aria-disabled:hover:bg-transparent ' +
'xl:min-h-9 xl:min-w-0 focus-visible:outline-none focus-visible:ring-2 ' +
'focus-visible:ring-[var(--color-accent)]'
/** The text field the press left, kept to learn whether its commit was refused. */
function leavingField(): HTMLElement | null {
const active = document.activeElement
const isField =
active instanceof HTMLInputElement ||
active instanceof HTMLTextAreaElement ||
active instanceof HTMLSelectElement
return isField ? active : null
}
/**
* The press, in two steps: the pointer-down commits the typed text (the field's blur), the
* click 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, focus goes back.
*/
function usePress(direction: Direction, readOnly: boolean) {
const left = useRef<HTMLElement | null>(null)
const onPointerDown = () => {
left.current = leavingField()
commitFocusedField()
}
const onClick = () => {
const field = left.current
left.current = null
if (field?.getAttribute('aria-invalid') === 'true') {
field.focus()
return
}
const store = useEditorStore.getState()
const can = direction === 'undo' ? canUndo(store) : canRedo(store)
if (readOnly || !can) return
if (direction === 'undo') store.undoStep()
else store.redoStep()
}
return { onPointerDown, onClick, onPointerLeave: () => (left.current = null) }
}
function HistoryButton({ direction }: { direction: Direction }) {
const t = useT()
const readOnly = useEditorReadOnly()
const steppable = useEditorStore(direction === 'undo' ? canUndo : canRedo)
const name = t(`editor.history.${direction}_title`)
return (
<button
type="button"
aria-label={name}
title={name}
aria-disabled={readOnly || !steppable}
aria-keyshortcuts={SHORTCUT[direction]}
{...usePress(direction, readOnly)}
className={BUTTON}
>
<EditorGlyph name={direction} />
<span aria-hidden="true" className="hidden sm:inline">
{t(`editor.history.${direction}`)}
</span>
</button>
)
}
/** « Annuler » and « Rétablir », at the right of the tab row on every tab. */
export default function HistoryButtons() {
return (
<div
className="ml-auto flex items-center gap-1"
data-testid="history-buttons"
>
<HistoryButton direction="undo" />
<HistoryButton direction="redo" />
</div>
)
}
+108 -25
View File
@@ -1,39 +1,122 @@
import { usePlural } from '@/editor/plural'
import { formatParisTime } from '@/editor/format'
import {
saveLineState,
useSavedDistance,
type SaveLineState,
} from '@/editor/saveLine'
import { useEditorStore } from '@/editor/state/editorStore'
import { useT } from '@/i18n/useT'
import { useLocaleStore } from '@/state/localeStore'
type Translate = ReturnType<typeof useT>
interface Status {
copyIssue: 'cap' | 'quota' | null
saving: boolean
unsaved: boolean
revision: number
/** Widest figures the line can show: a three-digit revision, 00:00, 999 changes. */
const WIDEST_REVISION = 999
const WIDEST_TIME = '00:00'
function revisionText(t: Translate, key: string, revision: number): string {
return t(key).replace('{revision}', String(revision))
}
/** Board 04's line; only the copy failures replace it (the copy is temporary, this tab's). */
function statusText(t: Translate, status: Status): string {
if (status.copyIssue !== null)
return t(`editor.draft.status.copy_${status.copyIssue}`)
if (status.saving) return t('editor.draft.status.saving')
const revision = t('editor.draft.status.revision').replace(
'{revision}',
String(status.revision),
)
return status.unsaved
? `${revision} · ${t('editor.draft.status.unsaved')}`
: revision
/** The line for a state; `withTime` false gives the form the status region announces. */
function lineText(
t: Translate,
plural: ReturnType<typeof usePlural>,
state: SaveLineState,
time: string | null,
): string {
switch (state.kind) {
case 'copy_issue':
return t(`editor.draft.status.copy_${state.issue}`)
case 'saving':
return t('editor.draft.status.saving')
case 'unsaved':
return state.count === null
? t('editor.draft.status.unsaved')
: plural('editor.draft.status.unsaved_count', state.count)
case 'saved':
return time === null
? revisionText(t, 'editor.draft.status.saved', state.revision)
: revisionText(
t,
'editor.draft.status.saved_at',
state.revision,
).replace('{time}', time)
case 'revision':
return revisionText(t, 'editor.draft.status.revision', state.revision)
}
}
/** The revision line with its unsaved state, announced politely when it changes. */
/** What the status region announces: the state, never each change of the count. */
function announcement(t: Translate, state: SaveLineState): string {
switch (state.kind) {
case 'unsaved':
return t('editor.draft.status.unsaved')
case 'revision':
return ''
case 'saved':
return revisionText(t, 'editor.draft.status.saved', state.revision)
default:
return lineText(t, () => '', state, null)
}
}
function useSaveLineState(): SaveLineState {
const distance = useSavedDistance()
const copyIssue = useEditorStore((s) => s.copyIssue)
const saving = useEditorStore((s) => s.saving)
const unsaved = useEditorStore((s) => s.unsaved)
const lastSave = useEditorStore((s) => s.lastSave)
const savedRevision = useEditorStore((s) => s.savedRevision)
return saveLineState({
copyIssue,
saving,
unsaved,
distance,
lastSave,
savedRevision,
})
}
/**
* The save line (board 04). The visible line is a plain paragraph; a hidden status region
* announces the state changes. The longest forms are laid out invisibly in the same cell,
* so the line keeps its width when the text changes (tabular figures).
*/
export default function SaveLine() {
const t = useT()
const unsaved = useEditorStore((s) => s.unsaved)
const saving = useEditorStore((s) => s.saving)
const revision = useEditorStore((s) => s.savedRevision)
const copyIssue = useEditorStore((s) => s.copyIssue)
const plural = usePlural()
const locale = useLocaleStore((s) => s.locale)
const state = useSaveLineState()
const savedAt = state.kind === 'saved' ? state.savedAt : null
const time = savedAt === null ? null : formatParisTime(savedAt, locale)
const widest = [
revisionText(t, 'editor.draft.status.saved_at', WIDEST_REVISION).replace(
'{time}',
WIDEST_TIME,
),
plural('editor.draft.status.unsaved_count', 999),
]
return (
<p role="status" className="text-sm text-[var(--color-ink-muted)]">
{statusText(t, { copyIssue, saving, unsaved, revision })}
</p>
<>
<p className="grid text-sm tabular-nums text-[var(--color-ink-muted)]">
<span data-testid="save-line" className="col-start-1 row-start-1">
{lineText(t, plural, state, time)}
</span>
{widest.map((text) => (
<span
key={text}
aria-hidden="true"
className="invisible col-start-1 row-start-1 h-0 overflow-hidden whitespace-nowrap"
>
{text}
</span>
))}
</p>
<p role="status" data-testid="save-status" className="sr-only">
{announcement(t, state)}
</p>
</>
)
}
@@ -1,7 +1,7 @@
import type { ReactNode } from 'react'
import { canRedo, canUndo, useEditorStore } from '@/editor/state/editorStore'
import type { ToolId } from '@/editor/annotations/uiState'
import { useT } from '@/i18n/useT'
import EditorGlyph, { type GlyphName } from '../EditorGlyph'
export interface ToolColumnProps {
tool: ToolId
@@ -21,18 +21,6 @@ const BUTTON =
'focus-visible:outline-none focus-visible:ring-2 ' +
'focus-visible:ring-[var(--color-accent)]'
const GLYPHS: Record<string, string> = {
select: 'M5 3l12 7-5 1-3 5z',
point: 'M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM12 3v3M12 18v3M3 12h3M18 12h3',
zone: 'M12 3l8 6-3 10H7L4 9z',
link: 'M4 4h8v8H4zM12 12h8v8h-8z',
in: 'M11 5v12M5 11h12M20 20l-4-4',
out: 'M5 11h12M20 20l-4-4',
fit: 'M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5',
undo: 'M9 7L4 12l5 5M4 12h11a5 5 0 0 1 0 10',
redo: 'M15 7l5 5-5 5M20 12H9a5 5 0 0 0 0 10',
}
function ToolButton({
glyph,
label,
@@ -40,7 +28,7 @@ function ToolButton({
disabled,
onClick,
}: {
glyph: string
glyph: GlyphName
label: string
pressed?: boolean
disabled?: boolean
@@ -60,28 +48,14 @@ function ToolButton({
: 'bg-[var(--color-surface)] text-[var(--color-ink)]'
}`}
>
<svg
viewBox="0 0 24 24"
width="20"
height="20"
fill="none"
stroke="currentColor"
strokeWidth="1.8"
strokeLinecap="round"
strokeLinejoin="round"
aria-hidden="true"
>
<path d={GLYPHS[glyph]} />
</svg>
<EditorGlyph name={glyph} />
</button>
)
}
/** Board 04's tool column: tools, zoom, then undo and redo (icon buttons). */
/** Board 04's tool column: tools and zoom (the history sits in the header). */
export default function ToolColumn(props: ToolColumnProps) {
const t = useT()
const undoable = useEditorStore(canUndo)
const redoable = useEditorStore(canRedo)
const tool = (id: ToolId, disabled: boolean) => (
<ToolButton
glyph={id}
@@ -118,19 +92,6 @@ export default function ToolColumn(props: ToolColumnProps) {
label={t('catalogue.zoom.fit')}
onClick={props.onFit}
/>
<hr className="hidden border-[var(--color-border)] lg:block" />
<ToolButton
glyph="undo"
label={t('editor.annotations.undo')}
disabled={!undoable}
onClick={() => useEditorStore.getState().undoStep()}
/>
<ToolButton
glyph="redo"
label={t('editor.annotations.redo')}
disabled={!redoable}
onClick={() => useEditorStore.getState().redoStep()}
/>
</div>
)
}
+75
View File
@@ -0,0 +1,75 @@
import { useMemo } from 'react'
import { useEditorStore } from './state/editorStore'
import type { CopyIssue, EditorData, LastSave } from './state/editorTypes'
import type { HistoryEntry } from './state/undo'
type DistanceInput = Pick<
EditorData,
'staleBase' | 'documentText' | 'savedText' | 'undo' | 'redo'
>
/** The 1-based depth, from the stack's top, of the nearest entry holding `text`. */
function depthIn(stack: readonly HistoryEntry[], text: string): number | null {
for (let at = stack.length - 1; at >= 0; at -= 1) {
if (stack[at].text === text) return stack.length - at
}
return null
}
/**
* How many history steps separate the document from the saved text: 0 when they are the
* same text, the depth of the nearest undo entry (else redo entry) holding the saved text,
* null when it is out of reach (older base, trimmed, or replaced by a later change).
*/
export function savedDistance(state: DistanceInput): number | null {
if (state.staleBase) return null
if (state.documentText === state.savedText) return 0
return (
depthIn(state.undo, state.savedText) ?? depthIn(state.redo, state.savedText)
)
}
/** `savedDistance`, recomputed only when one of its four inputs changes identity. */
export function useSavedDistance(): number | null {
const staleBase = useEditorStore((s) => s.staleBase)
const documentText = useEditorStore((s) => s.documentText)
const savedText = useEditorStore((s) => s.savedText)
const undo = useEditorStore((s) => s.undo)
const redo = useEditorStore((s) => s.redo)
return useMemo(
() => savedDistance({ staleBase, documentText, savedText, undo, redo }),
[staleBase, documentText, savedText, undo, redo],
)
}
export interface SaveLineInput {
copyIssue: CopyIssue | null
saving: boolean
unsaved: boolean
distance: number | null
lastSave: LastSave | null
savedRevision: number
}
export type SaveLineState =
| { kind: 'copy_issue'; issue: CopyIssue }
| { kind: 'saving' }
| { kind: 'unsaved'; count: number | null }
| { kind: 'saved'; revision: number; savedAt: string | null }
| { kind: 'revision'; revision: number }
/** What the save line says, the first matching form wins. */
export function saveLineState(input: SaveLineInput): SaveLineState {
if (input.copyIssue !== null)
return { kind: 'copy_issue', issue: input.copyIssue }
if (input.saving) return { kind: 'saving' }
if (input.unsaved) {
const known = input.distance !== null && input.distance > 0
return { kind: 'unsaved', count: known ? input.distance : null }
}
const { lastSave, savedRevision } = input
if (lastSave && lastSave.revision === savedRevision) {
return { kind: 'saved', revision: savedRevision, savedAt: lastSave.savedAt }
}
return { kind: 'revision', revision: savedRevision }
}
+1
View File
@@ -26,6 +26,7 @@ export function initialData(): EditorData {
submitting: false,
reloading: false,
saveFailure: null,
lastSave: null,
conflict: null,
recovery: 'none',
offer: null,
+1
View File
@@ -144,6 +144,7 @@ function reloadPatch(state: EditorState, text: string, next: PreviewState, revis
handleVersion: state.handleVersion + 1,
...emptyHistory(),
saveFailure: null,
lastSave: null,
conflict: null,
copyWritten: false,
copyIssue: null,
+35 -1
View File
@@ -70,6 +70,37 @@ export async function readConflict(api: StoreApi, session: number): Promise<void
}
}
/** The server's time of save `revision` of this version in `admin`, else null. */
function savedTimeOf(admin: OfficialSheetAdmin, state: EditorState, revision: number) {
const last = admin.draft_last_save
if (admin.draft_version?.version_id !== state.versionId) return null
if (last?.revision !== revision || state.lastSave?.revision !== revision) return null
return Number.isNaN(Date.parse(last.saved_at)) ? null : last.saved_at
}
/**
* Reads the server's time of save `revision` (`draft_last_save.saved_at`), never awaited by
* the save. Called straight on the accessor with the store's client, as `readConflict` is,
* so a refusal, a failure or an unreadable answer only leaves the time unknown. A late
* answer is dropped unless the session and the `lastSave` it was asked for are unchanged.
*/
export async function readSaveTime(
api: StoreApi,
session: number,
revision: number,
): Promise<void> {
const asked = api.get().lastSave
try {
const admin = await getOfficialSheetAdmin(requireClient(), api.get().sheetId ?? '')
const state = api.get()
if (state.session !== session || state.lastSave !== asked) return
const savedAt = savedTimeOf(admin, state, revision)
if (savedAt !== null) api.set({ lastSave: { revision, savedAt } })
} catch {
// Unreadable: the line stays « Enregistré · révision n ».
}
}
interface Attempt {
session: number
sentText: string
@@ -89,6 +120,7 @@ function applySaved(api: StoreApi, attempt: Attempt, revision: number): SaveOutc
unsaved,
conflict: null,
saveFailure: null,
lastSave: { revision, savedAt: null },
...(unsaved ? {} : { copyWritten: false, copyIssue: null }),
})
return { ok: true, revision }
@@ -127,7 +159,9 @@ async function saveWith(api: StoreApi, expected: number): Promise<SaveOutcome> {
document: JSON.parse(attempt.sentText),
}
const answer = parseSaveAnswer(await saveSheetDraft(requireClient(), args))
return applySaved(api, attempt, answer.revision)
const outcome = applySaved(api, attempt, answer.revision)
if (outcome.ok) void readSaveTime(api, attempt.session, outcome.revision)
return outcome
} catch (error) {
return failedSave(api, attempt, error)
}
+10
View File
@@ -87,6 +87,15 @@ export type ConflictState =
export type CopyIssue = 'cap' | 'quota'
/**
* The last save the server confirmed: its revision, and the server's time of that save once
* read (null when unreadable, never the browser's clock).
*/
export interface LastSave {
revision: number
savedAt: string | null
}
export interface EditorData {
/** Session token: bumped by `open` and `close`; every async continuation checks it. */
session: number
@@ -115,6 +124,7 @@ export interface EditorData {
submitting: boolean
reloading: boolean
saveFailure: SheetFailureKind | null
lastSave: LastSave | null
conflict: ConflictState | null
recovery: RecoveryMode
offer: RecoveryOffer | null
+10 -3
View File
@@ -1241,10 +1241,19 @@ export const en: Dict = {
'editor.draft.title': 'Draft, version {number}',
'editor.draft.read_only': 'Read-only',
'editor.draft.discard': 'Discard changes',
'editor.draft.discard_copy': 'The temporary local copy of these changes will be deleted too.',
'editor.draft.discard_ask': 'Discard the unsaved changes? The draft will return to the last revision saved on the server.',
'editor.draft.discard_confirm': 'Discard changes',
'editor.draft.status.revision': 'Revision {revision}',
'editor.draft.status.unsaved': 'unsaved changes',
'editor.draft.status.unsaved': 'Unsaved changes',
'editor.draft.status.unsaved_count_one': '{count} unsaved change',
'editor.draft.status.unsaved_count_other': '{count} unsaved changes',
'editor.draft.status.saved': 'Saved · revision {revision}',
'editor.draft.status.saved_at': 'Saved at {time} · revision {revision}',
'editor.history.undo': 'Undo',
'editor.history.undo_title': 'Undo the last change',
'editor.history.redo': 'Redo',
'editor.history.redo_title': 'Redo the last undone change',
'editor.draft.status.saving': 'Saving…',
'editor.draft.status.copy_quota': "Temporary local copy impossible (tab full): not saved on the server",
'editor.draft.status.copy_cap': "Temporary local copy impossible (two other copies in this tab): not saved on the server",
@@ -1509,8 +1518,6 @@ export const en: Dict = {
'editor.annotations.tool.point': 'Point',
'editor.annotations.tool.zone': 'Zone',
'editor.annotations.tool.link': 'Link to a detail view',
'editor.annotations.undo': 'Undo',
'editor.annotations.redo': 'Redo',
'editor.annotations.tool_hint.select': 'Tool: select and move · Esc cancels a tracing',
'editor.annotations.tool_hint.point': 'Tool: point · click in the drawing to place a point.',
'editor.annotations.tool_hint.zone': 'Tool: zone · click to place the vertices; Enter or « Close the tracing » finishes, Esc cancels.',
+11 -4
View File
@@ -1271,11 +1271,20 @@ export const fr: Dict = {
'editor.draft.overview_link': 'Voir la fiche',
'editor.draft.title': 'Brouillon, version {number}',
'editor.draft.read_only': 'Lecture seule',
'editor.draft.discard': 'Annuler les modifications',
'editor.draft.discard': 'Abandonner les modifications',
'editor.draft.discard_copy': 'La copie locale temporaire de ces modifications sera aussi supprimée.',
'editor.draft.discard_ask': 'Abandonner les modifications non enregistrées ? Le brouillon reprendra la dernière révision enregistrée sur le serveur.',
'editor.draft.discard_confirm': 'Abandonner les modifications',
'editor.draft.status.revision': 'Révision {revision}',
'editor.draft.status.unsaved': 'modifications non enregistrées',
'editor.draft.status.unsaved': 'Modifications non enregistrées',
'editor.draft.status.unsaved_count_one': '{count} modification non enregistrée',
'editor.draft.status.unsaved_count_other': '{count} modifications non enregistrées',
'editor.draft.status.saved': 'Enregistré · révision {revision}',
'editor.draft.status.saved_at': 'Enregistré à {time} · révision {revision}',
'editor.history.undo': 'Annuler',
'editor.history.undo_title': 'Annuler la dernière modification',
'editor.history.redo': 'Rétablir',
'editor.history.redo_title': 'Rétablir la dernière modification annulée',
'editor.draft.status.saving': 'Enregistrement…',
'editor.draft.status.copy_quota': "Copie locale temporaire impossible (onglet plein) : non enregistré sur le serveur",
'editor.draft.status.copy_cap': "Copie locale temporaire impossible (deux autres copies dans cet onglet) : non enregistré sur le serveur",
@@ -1540,8 +1549,6 @@ export const fr: Dict = {
'editor.annotations.tool.point': 'Point',
'editor.annotations.tool.zone': 'Zone',
'editor.annotations.tool.link': 'Accès à une vue détaillée',
'editor.annotations.undo': 'Annuler',
'editor.annotations.redo': 'Rétablir',
'editor.annotations.tool_hint.select': 'Outil : sélectionner et déplacer · Échap annule un tracé',
'editor.annotations.tool_hint.point': 'Outil : point · cliquez dans le dessin pour placer un point.',
'editor.annotations.tool_hint.zone': 'Outil : zone · cliquez pour poser les sommets ; Entrée ou « Fermer le tracé » termine, Échap annule.',