fix: AI 독서 감상문 생성 기능 준비중 안내 토스트 추가#309
Conversation
- MemoryAddButton의 handleAIWrite 클릭 시 API 호출 대신 "해당 기능은 준비중입니다." 스낵바 노출 - 기존 AI 로직은 코드 삭제 없이 그대로 보존
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Walkthrough
Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8분 Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/components/memory/MemoryAddButton/MemoryAddButton.tsx (1)
61-117:⚠️ Potential issue | 🟡 Minor행 61의
return이후 AI 로직(63~117행)은 도달 불가능한 코드가 됩니다.프로젝트의 ESLint 설정에서
no-unreachable규칙이error로 설정되어 있으므로,npm run lint실행 시 이 부분에서 린트 오류가 발생합니다. 기존 AI 로직을 보존하려는 의도라면 코드를 주석으로 감싸는 것을 권장합니다.♻️ 권장 리팩터: 기존 AI 로직을 주석 처리
const handleAIWrite = async () => { setIsOpen(false); openSnackbar({ message: '해당 기능은 준비중입니다.', variant: 'top', onClose: () => {}, }); return; - const currentRoomId = roomId || '1'; - - try { - const result = await getAiUsage(Number(currentRoomId)); - // ... (이하 생략) - } catch (error) { - // ... - } + // TODO: 토큰 문제 해결 후 아래 AI 로직 재활성화 + // const currentRoomId = roomId || '1'; + // + // try { + // const result = await getAiUsage(Number(currentRoomId)); + // ... + // } catch (error) { + // ... + // } };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/memory/MemoryAddButton/MemoryAddButton.tsx` around lines 61 - 117, There is an unconditional bare return; that makes the subsequent AI logic (the getAiUsage call and its handlers using openSnackbar, openConfirm, closePopup, navigate) unreachable; either remove that stray `return;` so the AI flow in MemoryAddButton executes, or if you intend to keep the AI code for later, wrap the entire block from the `const currentRoomId = roomId || '1';` through the catch in comments (or add a clear TODO wrapper) to satisfy no-unreachable linting and preserve the code.
🧹 Nitpick comments (1)
src/components/memory/MemoryAddButton/MemoryAddButton.tsx (1)
54-54:async키워드가 불필요합니다.조기 반환으로 인해
await에 도달하지 않으므로async선언이 현재는 무의미합니다.@typescript-eslint/require-await룰이 활성화된 경우 린트 오류가 발생할 수 있습니다. 단, 기능 재활성화 시async를 다시 추가해야 합니다.♻️ 제안: async 제거
- const handleAIWrite = async () => { + const handleAIWrite = () => {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/memory/MemoryAddButton/MemoryAddButton.tsx` at line 54, The function declaration for handleAIWrite currently has an unnecessary async modifier; remove the async keyword from the handleAIWrite declaration so it is a plain synchronous function (or alternatively add an awaited async operation inside if you intend to keep async in future), ensuring you update any references to handleAIWrite accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/components/memory/MemoryAddButton/MemoryAddButton.tsx`:
- Around line 61-117: There is an unconditional bare return; that makes the
subsequent AI logic (the getAiUsage call and its handlers using openSnackbar,
openConfirm, closePopup, navigate) unreachable; either remove that stray
`return;` so the AI flow in MemoryAddButton executes, or if you intend to keep
the AI code for later, wrap the entire block from the `const currentRoomId =
roomId || '1';` through the catch in comments (or add a clear TODO wrapper) to
satisfy no-unreachable linting and preserve the code.
---
Nitpick comments:
In `@src/components/memory/MemoryAddButton/MemoryAddButton.tsx`:
- Line 54: The function declaration for handleAIWrite currently has an
unnecessary async modifier; remove the async keyword from the handleAIWrite
declaration so it is a plain synchronous function (or alternatively add an
awaited async operation inside if you intend to keep async in future), ensuring
you update any references to handleAIWrite accordingly.
ℹ️ Review info
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
src/components/memory/MemoryAddButton/MemoryAddButton.tsx
📝작업 내용
스크린샷 (선택)
Summary by CodeRabbit
릴리스 노트