Skip to content

fix: AI 독서 감상문 생성 기능 준비중 안내 토스트 추가#309

Merged
ho0010 merged 1 commit into
refactorfrom
fix/ai-function-block
Feb 24, 2026
Merged

fix: AI 독서 감상문 생성 기능 준비중 안내 토스트 추가#309
ho0010 merged 1 commit into
refactorfrom
fix/ai-function-block

Conversation

@ho0010

@ho0010 ho0010 commented Feb 24, 2026

Copy link
Copy Markdown
Collaborator

📝작업 내용

이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능)

  • 토큰 문제로 AI 독서 감상문 생성 기능이 정상 작동할 수 없기에 준비중 안내 토스트를 추가했습니다.

스크린샷 (선택)

image image

Summary by CodeRabbit

릴리스 노트

  • 버그 수정
    • 메모리 추가 기능에서 AI 쓰기 경로의 동작이 수정되었습니다. 이제 정보 알림이 표시되고 후속 처리가 중단됩니다.

- MemoryAddButton의 handleAIWrite 클릭 시 API 호출 대신
  "해당 기능은 준비중입니다." 스낵바 노출
- 기존 AI 로직은 코드 삭제 없이 그대로 보존
@ho0010 ho0010 self-assigned this Feb 24, 2026
@vercel

vercel Bot commented Feb 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
thip Ready Ready Preview, Comment Feb 24, 2026 2:07am

@coderabbitai

coderabbitai Bot commented Feb 24, 2026

Copy link
Copy Markdown

Walkthrough

MemoryAddButton.tsxhandleAIWrite 함수가 수정되어, 액션 시작 후 정보성 스낵바를 표시하고 조기 반환하는 코드가 추가되었습니다. 이는 이후의 AI 사용 체크 및 네비게이션 로직이 실행되지 않도록 방지합니다.

Changes

코호트 / 파일 요약
MemoryAddButton AI Write 핸들러
src/components/memory/MemoryAddButton/MemoryAddButton.tsx
handleAIWrite 함수에서 조기 반환(early return) 로직 추가: 액션 시작 후 정보성 스낵바를 표시하고 함수를 반환하여 AI write 경로를 비활성화.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8분

Possibly related PRs

  • [FEAT] AI 독후감 구현 #286: 이전 PR이 MemoryAddButton.tsx의 AI write 흐름을 추가했으며, 현재 PR에서는 handleAIWrite 함수를 스낵바 표시 후 조기 반환으로 단락시키므로 직접적으로 연관됨.

Suggested labels

🐞 BugFix

Suggested reviewers

  • heeeeyong

Poem

🐰✨ AI의 길을 멈춘 버튼이여,
스낵바 메시지와 함께 돌아서니,
버그를 잡은 작은 수정의 마법,
코드의 흐름을 올바르게 인도하네! 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 변경사항의 주요 내용을 명확하게 설명합니다. 토큰 문제로 인해 AI 기능을 임시 비활성화하고 준비중 토스트를 추가하는 변경사항을 정확히 반영하고 있습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/ai-function-block

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ho0010 ho0010 requested a review from ljh130334 February 24, 2026 02:07

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 2bf7630 and 9b56f77.

📒 Files selected for processing (1)
  • src/components/memory/MemoryAddButton/MemoryAddButton.tsx

@ljh130334 ljh130334 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굿굿 너무 좋습니다! 감사합니다~!! 💯 💯

@ho0010 ho0010 merged commit da96cc4 into refactor Feb 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants