From 29837022ce895504e7299064ba6e068f774b2d41 Mon Sep 17 00:00:00 2001 From: erikgh Date: Fri, 31 Jul 2026 15:32:10 -0600 Subject: [PATCH] refactor(ilustraciones): grosores unificados a la escala 1.5/2/3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit El nudo, la bifurcación y la convergencia usaban 2.5 y 3.5 sueltos, así que las tres se veían de pesos distintos puestas una al lado de otra. Un test de contrato por ilustración exige ahora que todo trazo pertenezca a {1.5, 2, 3}, de modo que la escala no se pueda romper en silencio más adelante. SecuenciaClaridad queda fuera a propósito: resuelve en las barras reales del ≡ y su grosor lo manda LINEAS_SIMBOLO. Co-Authored-By: Claude Opus 5 --- components/primitives/IlustracionBifurcacion.tsx | 4 ++-- components/primitives/IlustracionConvergencia.tsx | 4 ++-- components/primitives/IlustracionNudo.tsx | 2 +- .../primitives/__tests__/IlustracionBifurcacion.test.tsx | 7 +++++++ .../primitives/__tests__/IlustracionConvergencia.test.tsx | 7 +++++++ components/primitives/__tests__/IlustracionNudo.test.tsx | 7 +++++++ 6 files changed, 26 insertions(+), 5 deletions(-) diff --git a/components/primitives/IlustracionBifurcacion.tsx b/components/primitives/IlustracionBifurcacion.tsx index 5b4757d..c78e211 100644 --- a/components/primitives/IlustracionBifurcacion.tsx +++ b/components/primitives/IlustracionBifurcacion.tsx @@ -25,7 +25,7 @@ export function IlustracionBifurcacion({ className = '' }: { className?: string if (reduced) { return ( ); } diff --git a/components/primitives/IlustracionNudo.tsx b/components/primitives/IlustracionNudo.tsx index a3ba20b..799f57e 100644 --- a/components/primitives/IlustracionNudo.tsx +++ b/components/primitives/IlustracionNudo.tsx @@ -8,7 +8,7 @@ import { useEnVista } from '@/lib/motion'; // going anywhere. The strands draw themselves in sequence, which reads as the // knot tightening rather than as decoration appearing. const HEBRAS = [ - { d: 'M30 90 C 60 20, 130 20, 140 70 C 148 112, 78 118, 70 78 C 63 44, 120 38, 150 66', ancho: 2.5 }, + { d: 'M30 90 C 60 20, 130 20, 140 70 C 148 112, 78 118, 70 78 C 63 44, 120 38, 150 66', ancho: 3 }, { d: 'M20 60 C 70 110, 120 110, 160 60', ancho: 2 }, { d: 'M40 110 C 80 40, 110 130, 155 95', ancho: 2 }, { d: 'M25 40 C 90 70, 100 100, 165 40', ancho: 1.5 }, diff --git a/components/primitives/__tests__/IlustracionBifurcacion.test.tsx b/components/primitives/__tests__/IlustracionBifurcacion.test.tsx index adf6d06..3d6600f 100644 --- a/components/primitives/__tests__/IlustracionBifurcacion.test.tsx +++ b/components/primitives/__tests__/IlustracionBifurcacion.test.tsx @@ -31,4 +31,11 @@ describe('', () => { const { container } = render(); expect(container.querySelectorAll('circle').length).toBeGreaterThanOrEqual(1); }); + + it('keeps every stroke within the shared line-art scale', () => { + const { container } = render(); + const anchos = Array.from(container.querySelectorAll('path')).map((p) => p.getAttribute('stroke-width')); + expect(anchos.length).toBeGreaterThan(0); + anchos.forEach((a) => expect(['1.5', '2', '3']).toContain(a)); + }); }); diff --git a/components/primitives/__tests__/IlustracionConvergencia.test.tsx b/components/primitives/__tests__/IlustracionConvergencia.test.tsx index e203c2c..700ff46 100644 --- a/components/primitives/__tests__/IlustracionConvergencia.test.tsx +++ b/components/primitives/__tests__/IlustracionConvergencia.test.tsx @@ -14,4 +14,11 @@ describe('', () => { const { container } = render(); expect(container.querySelectorAll('path')).toHaveLength(4); }); + + it('keeps every stroke within the shared line-art scale', () => { + const { container } = render(); + const anchos = Array.from(container.querySelectorAll('path')).map((p) => p.getAttribute('stroke-width')); + expect(anchos.length).toBeGreaterThan(0); + anchos.forEach((a) => expect(['1.5', '2', '3']).toContain(a)); + }); }); diff --git a/components/primitives/__tests__/IlustracionNudo.test.tsx b/components/primitives/__tests__/IlustracionNudo.test.tsx index 4bb4842..a449304 100644 --- a/components/primitives/__tests__/IlustracionNudo.test.tsx +++ b/components/primitives/__tests__/IlustracionNudo.test.tsx @@ -20,6 +20,13 @@ describe('', () => { expect(container.querySelectorAll('path').length).toBeGreaterThanOrEqual(3); }); + it('keeps every stroke within the shared line-art scale', () => { + const { container } = render(); + const anchos = Array.from(container.querySelectorAll('path')).map((p) => p.getAttribute('stroke-width')); + expect(anchos.length).toBeGreaterThan(0); + anchos.forEach((a) => expect(['1.5', '2', '3']).toContain(a)); + }); + it('renders plain, fully-visible strands under reduced motion instead of motion.path\'s dash scaffolding', () => { // Force the reduced-motion branch. motion.path applies stroke-dasharray/ // stroke-dashoffset even with no explicit initial/animate resolution,