From a4739df53814cf21bf5d546e4c55ee3d4a9f7132 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Sat, 23 May 2026 22:21:26 +0200 Subject: [PATCH] feat(editor): add laterality dropdown to SVG editor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a Latéralité/Laterality select (unpaired / bilateral) to the SVG editor edit panel. Value is persisted as data-anno-lateral on all sibling elements via applyEdit and restored on selection via showEditPanel. i18n keys added to both fr/en dicts. Co-Authored-By: Claude --- src/app/routes/SvgEditorRoute.tsx | 15 ++++++++++++++- src/i18n/en.ts | 3 +++ src/i18n/fr.ts | 3 +++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/app/routes/SvgEditorRoute.tsx b/src/app/routes/SvgEditorRoute.tsx index ebeafcbb..05af10e8 100644 --- a/src/app/routes/SvgEditorRoute.tsx +++ b/src/app/routes/SvgEditorRoute.tsx @@ -153,6 +153,11 @@ export default function SvgEditorRoute() { + + +
@@ -715,7 +720,7 @@ function initSvgEditor( getEl('svg-editor-filter-input').addEventListener('input', refreshElementList, sig) - ;['svg-editor-edit-fr', 'svg-editor-edit-en', 'svg-editor-edit-category'].forEach( + ;['svg-editor-edit-fr', 'svg-editor-edit-en', 'svg-editor-edit-category', 'svg-editor-edit-lateral'].forEach( (id) => { getEl(id).addEventListener('change', applyEdit, sig) }, @@ -889,6 +894,8 @@ function initSvgEditor( svgEl.getAttribute('data-anno-name-en') || '' ;(getEl('svg-editor-edit-category') as HTMLSelectElement).value = svgEl.getAttribute('data-anno-category') || 'custom' + ;(getEl('svg-editor-edit-lateral') as HTMLSelectElement).value = + svgEl.getAttribute('data-anno-lateral') || '' const id = svgEl.getAttribute('data-anno-id')! const cat = svgEl.getAttribute('data-anno-category') @@ -976,6 +983,7 @@ function initSvgEditor( const fr = (getEl('svg-editor-edit-fr') as HTMLInputElement).value.trim() const en = (getEl('svg-editor-edit-en') as HTMLInputElement).value.trim() const cat = (getEl('svg-editor-edit-category') as HTMLSelectElement).value + const lateral = (getEl('svg-editor-edit-lateral') as HTMLSelectElement).value const opacityPct = (getEl('svg-editor-edit-opacity') as HTMLInputElement).value const opacity = (parseFloat(opacityPct) / 100).toString() const radius = (getEl('svg-editor-edit-radius') as HTMLInputElement).value @@ -1017,6 +1025,11 @@ function initSvgEditor( s.removeAttribute('data-anno-special') } } + if (lateral) { + s.setAttribute('data-anno-lateral', lateral) + } else { + s.removeAttribute('data-anno-lateral') + } } if (opensDetailEnabled && detailTarget) { diff --git a/src/i18n/en.ts b/src/i18n/en.ts index d296e7af..e7c82710 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -227,4 +227,7 @@ export const en: Dict = { 'svg_editor.handle_insert': 'Click to insert a vertex here', 'svg_editor.polygon_vertices': 'polygon ({count} vertices)', 'svg_editor.drop_svg_here': 'Drop SVG here', + 'svg_editor.lateral': 'Laterality', + 'svg_editor.lateral_unpaired': 'Unpaired (no side)', + 'svg_editor.lateral_bilateral': 'Bilateral (left / right)', } diff --git a/src/i18n/fr.ts b/src/i18n/fr.ts index 974e2ab8..65ae1b7f 100644 --- a/src/i18n/fr.ts +++ b/src/i18n/fr.ts @@ -244,4 +244,7 @@ export const fr: Dict = { 'svg_editor.handle_insert': 'Cliquez pour insérer un sommet ici', 'svg_editor.polygon_vertices': 'polygone ({count} sommets)', 'svg_editor.drop_svg_here': 'Déposez le SVG ici', + 'svg_editor.lateral': 'Latéralité', + 'svg_editor.lateral_unpaired': 'Impair (pas de côté)', + 'svg_editor.lateral_bilateral': 'Bilatéral (gauche / droite)', }