fix: lint errors in widget-renderer.tsx and layout.tsx
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 50/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- À l'abandon
- Stack technique
- next.js, react, typescript
Piste de recherche
Start by running pnpm lint and inspect apps/app/src/components/generative-ui/widget-renderer.tsx at the two reported effects and the unused description prop, then review layout.tsx at the Google Fonts link. Done means the Plus Jakarta Sans load uses next/font, the effect lint errors and unused prop warning are resolved, and pnpm lint passes without errors or warnings.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Description
The pnpm lint CI check is failing with 2 errors and 2 warnings.
Errors
1. react-hooks/set-state-in-effect in widget-renderer.tsx:414
// apps/app/src/components/generative-ui/widget-renderer.tsx
useEffect(() => {
if (!active) return;
setIndex(0); // ← setState called synchronously in effect
const interval = setInterval(() => {
setIndex((i) => (i + 1) % LOADING_PHRASES.length);
}, 1800);
return () => clearInterval(interval);
}, [active]);
Fix: Reset the index outside the effect (e.g. derive from active changing, or use a ref).
2. react-hooks/set-state-in-effect in widget-renderer.tsx:457
useEffect(() => {
if (!html || !iframeRef.current) return;
if (html === committedHtmlRef.current) return;
committedHtmlRef.current = html;
iframeRef.current.srcdoc = assembleDocument(html);
setLoaded(false); // ← setState called synchronously in effect
setHeight(0);
}, [html]);
Fix: Restructure so loaded/height are derived from html changes without synchronous setState in the effect body.
Warnings
3. Unused description prop — widget-renderer.tsx:424
export function WidgetRenderer({ title, description, html }: WidgetRendererProps) {
// ^^^^^^^^^^^ defined but never used
Fix: Either use the prop or prefix with underscore (_description).
4. Custom font loaded in layout.tsx instead of next/font — layout.tsx:15
<link
href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap"
rel="stylesheet"
/>
Fix: Use next/font/google to load Plus Jakarta Sans for automatic optimization and self-hosting.
- Langage dominant
- TypeScript
- Étoiles
- 1.6k
- Forks
- 202
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de CopilotKit/OpenGenerativeUI
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
CopilotKit/OpenGenerativeUI#87 · 2 commentaires ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
Toutes les issues de CopilotKit/OpenGenerativeUI
Issues similaires
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
-
Crush Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
ElementsProject/cln-application#167 · 1 commentaire · 1 réaction ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Quantco/pnpm-licenses#17 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100