feat(chatbot): add AI Q&A chatbot component#27
Conversation
- Create ChatBot component with floating button, chat window, message history - Add conversation state management with React useState - Handle API requests to AWS Lambda with loading/error states - Add responsive styling with CSS Modules and dark mode support - Integrate ChatBot into Root.tsx for site-wide availability - Add CSS variables for chatbot theming - Update .gitignore to exclude TypeScript compiled output Co-authored-by: kimchanhyung98 <60088641+kimchanhyung98@users.noreply.github.com>
- Use translate() for welcome message, error message, and placeholder - Handle empty API response as error case Co-authored-by: kimchanhyung98 <60088641+kimchanhyung98@users.noreply.github.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
TODO: Lambda-side context handling for page-aware responses Co-Authored-By: Claude <noreply@anthropic.com>
…sage - Suggested question chips with category icons - Clear conversation button in header - Extract sendMessage() to eliminate fetch duplication - Add Markdown rendering TODO for Phase 2 Co-Authored-By: Claude <noreply@anthropic.com>
- ESC key closes chat window and returns focus to floating button - Focus trap keeps Tab navigation within chat window - aria-live region announces new messages to screen readers - aria-modal attribute on dialog Co-Authored-By: Claude <noreply@anthropic.com>
|
/gemini review |
🤖 Augment PR SummarySummary: This PR introduces an AI Q&A chatbot to the Docusaurus-based Laravel docs site, intended to connect the UI to an AWS Lambda-backed chatbot API. Changes:
Technical Notes: The chatbot component returns 🤖 Was this summary useful? React with 👍 or 👎 |
- Remove hardcoded fallback API URL, render nothing if env unset (critical) - Remove unsafe `as string` assertion, guard with early return (high) - Add console.error in catch block for debugging (medium) - Use unique message IDs instead of array index for React keys (medium) - Abort in-flight request on handleClear to prevent stale appends (medium) - Restore focus to floating button on close button click (low) - Replace all hard-coded English strings with translate() (low) - Fix suggestion chip hover contrast: use primary color bg (low) Co-Authored-By: Claude <noreply@anthropic.com>
Hooks must be called unconditionally before any early return. Moves the chatbotApiUrl guard after all hook declarations. Co-Authored-By: Claude <noreply@anthropic.com>
- Use <dialog> element instead of role="dialog" (S6819) - Extract nested ternary into IIFE for aria-live (S3358) - Use globalThis instead of window (S7764) - Reset dialog default padding/margin in CSS Co-Authored-By: Claude <noreply@anthropic.com>
|
/augment review |
|
/gemini review |
There was a problem hiding this comment.
Code Review
이번 PR은 잘 분리되고 기능이 풍부한 AI 챗봇 컴포넌트를 추가하는 훌륭한 작업입니다. 접근성(포커스 트래핑, ARIA 속성)과 사용자 경험(로딩 상태, 오류 처리, 요청 취소)을 세심하게 고려한 구현이 돋보입니다. React.lazy와 ErrorBoundary를 사용하여 챗봇이 메인 사이트의 성능이나 안정성에 영향을 주지 않도록 한 점도 좋습니다. 코드의 견고성과 가독성을 더욱 향상시키기 위한 몇 가지 제안 사항을 남깁니다.
- Replace module-scope `let nextMessageId` with `useRef` (gemini/high) - Use Docusaurus `useLocation` hook instead of globalThis.location (gemini/medium) - Extract IIFE to pre-computed variable for aria-live text (gemini/medium) - Guard `.finally()` and `.then()` with abort signal check to prevent race condition on rapid sends (augment/medium) Co-Authored-By: Claude <noreply@anthropic.com>
|
/augment review |
|
/gemini review |
There was a problem hiding this comment.
Code Review
이 PR은 AI 챗봇 컴포넌트를 추가하는 중요한 기능 추가입니다. 전반적으로 코드가 매우 잘 작성되었습니다. 특히 다음과 같은 점들이 인상적입니다:
React.lazy와ErrorBoundary를 사용하여 챗봇 컴포넌트를 사이트의 나머지 부분과 완전히 격리시킨 점은 매우 훌륭한 설계입니다. 이를 통해 챗봇의 오류가 전체 사이트의 안정성에 영향을 미치지 않도록 보장합니다.- 키보드 접근성(포커스 트랩, ESC로 닫기,
aria-live를 통한 스크린 리더 알림)을 세심하게 고려하여 모든 사용자가 챗봇을 원활하게 사용할 수 있도록 한 점이 좋습니다. AbortController를 사용하여 이전 API 요청을 취소하는 로직은 네트워크 효율성을 높이고 불필요한 상태 업데이트를 방지하는 좋은 구현입니다.- CSS 변수를 활용하여 다크/라이트 모드를 완벽하게 지원하고, 반응형 디자인을 통해 모바일 환경에서도 좋은 사용자 경험을 제공합니다.
코드의 안정성을 더욱 높이기 위해 한 가지 작은 제안을 리뷰 코멘트로 남겼습니다. 훌륭한 기여에 감사드립니다!
- Replace `as string | undefined` with typeof guard (gemini/medium) - Add isSendingRef to synchronously gate duplicate submissions (augment/medium) - Remove aria-modal since dialog is non-modal (augment/low) - Add unmount cleanup to abort in-flight requests (augment/low) Co-Authored-By: Claude <noreply@anthropic.com>
|
|
/augment review |
|
/gemini review |
|
추가 기능은 보류 |



Summary
AWS Lambda 기반 Laravel AI 챗봇을 문서 사이트에 연결합니다.
API Integration
Isolation Strategy
Phase 2 (향후 PR)
Test Plan
npm run build)