fix: lint errors in widget-renderer.tsx and layout.tsx
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
- #13 來自 @Jah-yee —— 已關閉,未合併
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 50/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 停滯
- 技術堆疊
- next.js, react, typescript
研究方向
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.
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- TypeScript
- 星號
- 3.9k
- 分支
- 414
- 平均合併
- 4 小時
- 30 天內合併 PR
- 6
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
CopilotKit/OpenIntelligentUI 的其他 Issue
-
Script dedup key truncation may cause collisions可能已有人在做 @saschabuehrle 於 215 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 72/100
CopilotKit/OpenIntelligentUI#37 ·
維護者通常 1 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 72/100
CopilotKit/OpenIntelligentUI#29 ·
維護者通常 1 天內回覆
-
Self-host with Docker Compose and optional server-held keys可能已有人在做 @kannan983 於 16 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 18/100
CopilotKit/OpenIntelligentUI#98 ·
維護者通常 1 天內回覆
-
Support OpenAI-compatible gateways (OpenRouter) via vendor/model names可能已有人在做 @kannan983 於 16 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 25/100
CopilotKit/OpenIntelligentUI#97 ·
維護者通常 1 天內回覆
-
UI未關閉
難度 5/5 一週以上 新手友好度 8/100
CopilotKit/OpenIntelligentUI#96 ·
維護者通常 1 天內回覆
查看 CopilotKit/OpenIntelligentUI 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
grafana/profiles-drilldown#1212 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
grafana/traces-drilldown#980 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
openremote/openremote#3487 · 1 則留言 ·
-
triage:needs-human
難度 2/5 1-3 小時 新手友好度 67/100
garrytan/gbrain#7635 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
coollabsio/jean#867 ·
維護者通常 1 天內回覆