-
-
Notifications
You must be signed in to change notification settings - Fork 43
feat: word follow up chat with jAI✨ #142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… update useEffect dependency
|
The latest updates on your projects. Learn more about Vercel for GitHub.
💡 Enable Vercel Agent with $100 free credit for automated AI reviews |
…ages in GitHub OAuth callback
…ing in `JAIChatWidget`
…r clarity and engagement
… descriptions and usage examples
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces an interactive jAI Follow-up Chat feature that enables users to ask context-aware questions about dictionary terms through an AI-powered chat interface. Users can engage in real-time conversations with jAI, receiving intelligent explanations grounded in the dictionary content.
Key Changes:
- Adds a new React-based chat widget component with authentication, streaming AI responses, and default question templates
- Implements a new API endpoint (
/api/jai/follow-up-chat) for handling conversational AI requests with semantic search and streaming support - Updates authentication flow to support statically-rendered pages and handle OAuth redirects for the chat feature
- Refines jAI prompt templates to distinguish between conversational Q&A (
FOLLOW_UP_CHAT) and dictionary definitions (SEARCH_WORD)
Reviewed Changes
Copilot reviewed 15 out of 18 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/pages/login.astro |
Adds loading state UI and handling for OAuth authentication flow |
src/pages/api/jai/follow-up-chat.js |
New API endpoint for streaming conversational AI responses with CORS support |
src/pages/api/github/oauth/callback.js |
Updates OAuth callback to handle chat widget redirects with jai=1 parameter |
src/pages/api/github/oauth/authenticate.js |
New endpoint for validating GitHub OAuth tokens |
src/lib/stores/jai.js |
New store for managing jAI chat widget open/closed state |
src/lib/stores/auth.js |
New store for managing authentication loading state |
src/layouts/word.astro |
Integrates chat widget trigger and manages widget visibility with URL parameter handling |
src/components/navbar.astro |
Makes navbar sticky to improve UX when chat is open |
src/components/islands/search.jsx |
Updates responsive breakpoints and z-index for proper layering |
src/components/islands/profile.jsx |
Adds loading spinner to GitHub authentication button |
src/base.css |
Adds styles for chat widget animations and layout |
package.json |
Adds dependencies for AI SDK React and cookie management |
apps/jai/lib/jai-prompts.js |
Refactors prompts to distinguish chat vs. definition generation |
apps/jai/components/follow-up-chat.jsx |
New chat widget component with authentication, streaming, and templated questions |
apps/jai/README.md |
Updates documentation for the new follow-up chat feature |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Description
This pull request introduces the new jAI Follow-up Chat feature to the jargons.dev ecosystem, enabling users to ask context-aware questions about dictionary terms and receive intelligent, conversational AI responses. The changes span documentation updates, codebase structure, and a major new React component implementing the chat widget.
Feature Addition: Interactive Follow-up Chat
Documentation and API Updates
README.mdto describe the new follow-up chat feature, its conversational capabilities, and context-aware Q&A, replacing previous generic explanations.components/follow-up-chat.jsxfile and its main components in the module structure section.FOLLOW_UP_CHAT(for conversational Q&A) andSEARCH_WORD(for dictionary definitions).src/pages/api/jai/follow-up-chat.js, including semantic search, conversation history, streaming responses, and CORS support.Related Issue
Fixes jargonsdev/roadmap#6
Screenshots/Screencasts
screen-capture.18.webm
Notes to Reviewer
apps/jaimodule