Skip to content

Conversation

@babblebey
Copy link
Member

@babblebey babblebey commented Apr 12, 2025

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

  • Adds a complete React implementation for the jAI Follow-up Chat widget, including authentication, streaming AI responses, default question templates, and a trigger button for user interaction.

Documentation and API Updates

  • Updates the README.md to describe the new follow-up chat feature, its conversational capabilities, and context-aware Q&A, replacing previous generic explanations.
  • Documents the new components/follow-up-chat.jsx file and its main components in the module structure section.
  • Expands documentation for prompt templates, clarifying the distinction between FOLLOW_UP_CHAT (for conversational Q&A) and SEARCH_WORD (for dictionary definitions).
  • Details the new API endpoint src/pages/api/jai/follow-up-chat.js, including semantic search, conversation history, streaming responses, and CORS support.
  • Provides a feature breakdown for the new chat widget, including UI elements, authentication, streaming, and integration points.

Related Issue

Fixes jargonsdev/roadmap#6

Screenshots/Screencasts

screen-capture.18.webm

Notes to Reviewer

  • Relies on already established apps/jai module
  • Added new node packaages
    • @ai-sdk/react
    • js-cookies

@vercel
Copy link

vercel bot commented Apr 12, 2025

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

Project Deployment Preview Comments Updated (UTC)
jargons-dev Ready Ready Preview Comment Oct 19, 2025 1:51pm

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

@babblebey babblebey changed the title feat: word follow up chat feat: word follow up chat with jAi✨ Apr 12, 2025
@babblebey babblebey changed the title feat: word follow up chat with jAi✨ feat: word follow up chat with jAI✨ Apr 12, 2025
@babblebey babblebey marked this pull request as ready for review October 19, 2025 03:20
@babblebey babblebey requested a review from Copilot October 19, 2025 03:20
Copy link
Contributor

Copilot AI left a 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.

@babblebey babblebey merged commit dd0c5fd into main Oct 19, 2025
5 checks passed
@babblebey babblebey deleted the feat/word-follow-up-chat branch October 19, 2025 15:50
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.

Word Follow-up Chat with jargons.dev AI ✨

2 participants