diff --git a/messages/de.json b/messages/de.json index 26ece40e6..656a89983 100644 --- a/messages/de.json +++ b/messages/de.json @@ -11529,6 +11529,28 @@ "nameLabel": "Name", "namePlaceholder": "z. B. Aura", "iconLabel": "Symbol", + "icons": { + "Tag": "Etikett", + "Activity": "Aktivität", + "Heart": "Herz", + "HeartPulse": "Herzschlag", + "Brain": "Gehirn", + "Zap": "Blitz", + "Flame": "Flamme", + "Snowflake": "Schneeflocke", + "Droplet": "Tropfen", + "CircleDot": "Punkt", + "BatteryLow": "Leerer Akku", + "MoonStar": "Mond und Stern", + "PersonStanding": "Person", + "Drama": "Masken", + "Frown": "Trauriges Gesicht", + "Cookie": "Keks", + "Soup": "Suppe", + "Pill": "Tablette", + "Thermometer": "Thermometer", + "Stethoscope": "Stethoskop" + }, "limitReached": "Du hast 8 Symptome. Blende eins aus, um ein neues anzulegen.", "saveError": "Das Symptom konnte nicht gespeichert werden. Bitte versuch es noch einmal.", "nameRequired": "Gib dem Symptom einen Namen.", diff --git a/messages/en.json b/messages/en.json index e94c08bce..bfef0d002 100644 --- a/messages/en.json +++ b/messages/en.json @@ -11529,6 +11529,28 @@ "nameLabel": "Name", "namePlaceholder": "e.g. Aura", "iconLabel": "Icon", + "icons": { + "Tag": "Tag", + "Activity": "Activity", + "Heart": "Heart", + "HeartPulse": "Heartbeat", + "Brain": "Brain", + "Zap": "Lightning", + "Flame": "Flame", + "Snowflake": "Snowflake", + "Droplet": "Drop", + "CircleDot": "Dot", + "BatteryLow": "Low battery", + "MoonStar": "Moon and star", + "PersonStanding": "Person", + "Drama": "Masks", + "Frown": "Frowning face", + "Cookie": "Cookie", + "Soup": "Soup", + "Pill": "Pill", + "Thermometer": "Thermometer", + "Stethoscope": "Stethoscope" + }, "limitReached": "You have 8 symptoms. Hide one to add another.", "saveError": "Couldn't save the symptom. Please try again.", "nameRequired": "Give the symptom a name.", diff --git a/messages/es.json b/messages/es.json index a2fff14e5..473e61765 100644 --- a/messages/es.json +++ b/messages/es.json @@ -11529,6 +11529,28 @@ "nameLabel": "Nombre", "namePlaceholder": "p. ej. Aura", "iconLabel": "Icono", + "icons": { + "Tag": "Etiqueta", + "Activity": "Actividad", + "Heart": "Corazón", + "HeartPulse": "Latido", + "Brain": "Cerebro", + "Zap": "Rayo", + "Flame": "Llama", + "Snowflake": "Copo de nieve", + "Droplet": "Gota", + "CircleDot": "Punto", + "BatteryLow": "Batería baja", + "MoonStar": "Luna y estrella", + "PersonStanding": "Persona", + "Drama": "Máscaras", + "Frown": "Cara triste", + "Cookie": "Galleta", + "Soup": "Sopa", + "Pill": "Pastilla", + "Thermometer": "Termómetro", + "Stethoscope": "Estetoscopio" + }, "limitReached": "Tienes 8 síntomas. Oculta uno para añadir otro.", "saveError": "No se pudo guardar el síntoma. Inténtalo de nuevo.", "nameRequired": "Ponle un nombre al síntoma.", diff --git a/messages/fr.json b/messages/fr.json index 572487db8..d19c0b067 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -11529,6 +11529,28 @@ "nameLabel": "Nom", "namePlaceholder": "p. ex. Aura", "iconLabel": "Icône", + "icons": { + "Tag": "Étiquette", + "Activity": "Activité", + "Heart": "Cœur", + "HeartPulse": "Battement de cœur", + "Brain": "Cerveau", + "Zap": "Éclair", + "Flame": "Flamme", + "Snowflake": "Flocon de neige", + "Droplet": "Goutte", + "CircleDot": "Point", + "BatteryLow": "Batterie faible", + "MoonStar": "Lune et étoile", + "PersonStanding": "Personne", + "Drama": "Masques", + "Frown": "Visage triste", + "Cookie": "Biscuit", + "Soup": "Soupe", + "Pill": "Comprimé", + "Thermometer": "Thermomètre", + "Stethoscope": "Stéthoscope" + }, "limitReached": "Tu as 8 symptômes. Masques-en un pour en ajouter un autre.", "saveError": "Impossible d'enregistrer le symptôme. Réessaie.", "nameRequired": "Donne un nom au symptôme.", diff --git a/messages/it.json b/messages/it.json index 58d510fb7..da25525b6 100644 --- a/messages/it.json +++ b/messages/it.json @@ -11529,6 +11529,28 @@ "nameLabel": "Nome", "namePlaceholder": "es. Aura", "iconLabel": "Icona", + "icons": { + "Tag": "Etichetta", + "Activity": "Attività", + "Heart": "Cuore", + "HeartPulse": "Battito", + "Brain": "Cervello", + "Zap": "Fulmine", + "Flame": "Fiamma", + "Snowflake": "Fiocco di neve", + "Droplet": "Goccia", + "CircleDot": "Punto", + "BatteryLow": "Batteria scarica", + "MoonStar": "Luna e stella", + "PersonStanding": "Persona", + "Drama": "Maschere", + "Frown": "Viso triste", + "Cookie": "Biscotto", + "Soup": "Zuppa", + "Pill": "Pillola", + "Thermometer": "Termometro", + "Stethoscope": "Stetoscopio" + }, "limitReached": "Hai 8 sintomi. Nascondine uno per aggiungerne un altro.", "saveError": "Impossibile salvare il sintomo. Riprova.", "nameRequired": "Dai un nome al sintomo.", diff --git a/messages/ko.json b/messages/ko.json index 47f95296b..fd5cc5b55 100644 --- a/messages/ko.json +++ b/messages/ko.json @@ -11529,6 +11529,28 @@ "nameLabel": "이름", "namePlaceholder": "예: 전조", "iconLabel": "아이콘", + "icons": { + "Tag": "태그", + "Activity": "활동", + "Heart": "하트", + "HeartPulse": "심장 박동", + "Brain": "뇌", + "Zap": "번개", + "Flame": "불꽃", + "Snowflake": "눈송이", + "Droplet": "물방울", + "CircleDot": "점", + "BatteryLow": "배터리 부족", + "MoonStar": "달과 별", + "PersonStanding": "사람", + "Drama": "가면", + "Frown": "찡그린 얼굴", + "Cookie": "쿠키", + "Soup": "수프", + "Pill": "알약", + "Thermometer": "체온계", + "Stethoscope": "청진기" + }, "limitReached": "증상이 8개입니다. 하나를 숨기면 새로 추가할 수 있습니다.", "saveError": "증상을 저장하지 못했습니다. 다시 시도하세요.", "nameRequired": "증상 이름을 입력하세요.", diff --git a/messages/pl.json b/messages/pl.json index 3cee9f5c9..5600fd0bc 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -11529,6 +11529,28 @@ "nameLabel": "Nazwa", "namePlaceholder": "np. Aura", "iconLabel": "Ikona", + "icons": { + "Tag": "Etykieta", + "Activity": "Aktywność", + "Heart": "Serce", + "HeartPulse": "Bicie serca", + "Brain": "Mózg", + "Zap": "Błyskawica", + "Flame": "Płomień", + "Snowflake": "Płatek śniegu", + "Droplet": "Kropla", + "CircleDot": "Kropka", + "BatteryLow": "Słaba bateria", + "MoonStar": "Księżyc i gwiazda", + "PersonStanding": "Osoba", + "Drama": "Maski", + "Frown": "Smutna twarz", + "Cookie": "Ciastko", + "Soup": "Zupa", + "Pill": "Tabletka", + "Thermometer": "Termometr", + "Stethoscope": "Stetoskop" + }, "limitReached": "Masz 8 objawów. Ukryj jeden, aby dodać kolejny.", "saveError": "Nie udało się zapisać objawu. Spróbuj ponownie.", "nameRequired": "Nadaj objawowi nazwę.", diff --git a/src/components/symptoms/__tests__/symptom-icon-picker.test.tsx b/src/components/symptoms/__tests__/symptom-icon-picker.test.tsx new file mode 100644 index 000000000..fbd578152 --- /dev/null +++ b/src/components/symptoms/__tests__/symptom-icon-picker.test.tsx @@ -0,0 +1,122 @@ +/** + * Both symptom icon pickers (the add chip's popover and the edit sheet) share + * one shape: 44 px targets on a phone, 36 px from `sm`, and a translated + * accessible name per icon rather than the raw Lucide component name. + * + * The popover and the sheet portal, and portals do not render server-side, + * so both are replaced by pass-through wrappers that render their children + * inline; what is measured is the picker inside them. + * + * Mutation checks (each run, each seen red): + * - put `size-7` back on the add chip's icon buttons → "the add chip's + * icon targets" goes red; + * - put `aria-label={name}` back on either picker → the label assertions + * go red ("HeartPulse" is a raw name, "Heartbeat" its English label). + */ +import { describe, expect, it, vi } from "vitest"; +import type { ReactNode } from "react"; +import { renderToStaticMarkup } from "react-dom/server"; + +vi.mock("@/components/ui/popover", () => ({ + Popover: ({ children }: { children: ReactNode }) => <>{children}>, + PopoverTrigger: ({ children }: { children: ReactNode }) => <>{children}>, + PopoverContent: ({ children }: { children: ReactNode }) => ( +