perf(invoice-generator): fix high Cumulative Layout Shift (CLS) on desktop and mobile
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 66/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- nextjs, react, typescript
- Área
- frontend, performance
Línea de trabajo
Start in app/(tools)/invoice-generator/InvoiceGeneratorClient.tsx, where the current state begins as null and the Loading… placeholder section renders until the useEffect reads localStorage. Reproduce the shift with a Lighthouse run on the production URL to confirm the FAQ and CTA sections move. Done when the median CLS is at or below 0.1 on both desktop and mobile, with the skeleton matching the toolbar, editor and preview dimensions.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
During the baseline performance audit (#28), the Invoice Generator page was found to have severe Cumulative Layout Shift (CLS), failing the Core Web Vitals threshold of CLS ≤ 0.1 on both desktop and mobile.
Affected Production URL
https://tools.codercops.com/invoice-generator
Device
Desktop and Mobile
Measured Evidence
Lighthouse performance audit results (median of 3 runs on 2026-10-14, failing threshold is CLS > 0.1):
- Desktop Median CLS: 0.554 (individual runs: 0.555, 0.554, 0.554) — FAIL
- Mobile Median CLS: 0.465 (individual runs: 0.465, 0.465, 0.465) — FAIL
Root Cause / Culprit
Lighthouse identifies body.antialiased > main#main-content > section.mx-auto (the FAQ and CTA sections) as shifting by over 1,000px.
In app/(tools)/invoice-generator/InvoiceGeneratorClient.tsx:
- The client component initializes
const [current, setCurrent] = useState<Invoice | null>(null);. - During SSR and initial client render when
current === null, it renders a small placeholder card:<section className="mx-auto max-w-7xl w-full px-4 sm:px-6 pb-8"> <div className="card p-10 text-center text-[var(--fg-muted)] text-[13px]">Loading…</div> </section> - In
useEffect, it reads localStorage and callssetCurrent(...). - Once
currentis populated, the full toolbar, two-column editor form, and live preview are inserted into the DOM, pushing the FAQ and CTA sections down and triggering a large layout shift score (0.554 desktop, 0.465 mobile).
Concrete Next Step
- Refactor
InvoiceGeneratorClient.tsxso that initial render does not collapse into a small placeholder card. - Initialize default invoice state or render a layout-preserving skeleton that matches the dimensions of the toolbar, editor, and preview grids during SSR and before hydration.
- Re-run Lighthouse mobile and desktop audits to verify median CLS is ≤ 0.1.
- Lenguaje dominante
- TypeScript
- Estrellas
- 1
- Forks
- 9
- Merge medio
- 10 h 41 min
- PR fusionados (30 d)
- 85
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de codercops/toolbelt
-
JSON to XML: one root element for top-level arrays, and keep empty and nested arraysPosiblemente ocupada @anurag2787 la tomó hace 1 día. Abiertobug good first issue hacktoberfest
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
codercops/toolbelt#204 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Stop the JSON formatter's Find bar from typing into the JSONPosiblemente ocupada @kudala-bharani la tomó hace 1 día. Abiertobug hacktoberfest help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
codercops/toolbelt#121 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Set up component tests with happy-dom and Testing LibraryPosiblemente ocupada @Bl1ckxy la tomó hace 1 día. Abiertoenhancement hacktoberfest help wanted testing
Dificultad 3/5 1-2 días Aptitud para principiantes 67/100
codercops/toolbelt#206 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug good first issue hacktoberfest
Dificultad 3/5 1-2 días Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Light theme pages throw a hydration error from the theme togglePosiblemente ocupada @anurag2787 la tomó hace 1 día. Abiertobug good first issue hacktoberfest
Dificultad 3/5 1-2 días Aptitud para principiantes 82/100
codercops/toolbelt#193 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de codercops/toolbelt
Issues similares
-
fix(cursor): align Grok 4.7 context window to 256k/500k and drop unsupported max effort tierAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
diegosouzapw/OmniRoute#17386 ·
Los mantenedores suelen responder en 1 día
-
ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
area/dashboard kind/bug kind/bug-qa QA/dev-automation
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
vybestack/llxprt-code#3917 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
api-parity
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
IBM/carbon-components-ember#1157 ·
Los mantenedores suelen responder en 1 día