✨ AI Assistant#230
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request integrates a new AI Assistant Panel into the WPGraphQL IDE that offers interactive query assistance using Google's Gemini API. Key changes include:
- Addition of new PHP and JavaScript/React files to register and render the AI Assistant Panel.
- Implementation of API calls to the Gemini service for chat interactions.
- Updates to project configuration and build files to include the new panel.
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| wpgraphql-ide.php | Registers the new AI Assistant Panel plugin. |
| src/components/App.jsx | Adds event listeners to insert code from the AI assistant and contains a duplicate React import. |
| plugins/ai-assistant-panel/src/components/AIAssistantPanelSimple.jsx | Introduces a simple version of the AI Assistant Panel UI. |
| plugins/ai-assistant-panel/src/components/AIAssistantPanel.jsx | Provides the primary chat interface for the AI Assistant with API integration. |
| plugins/ai-assistant-panel/src/components/AIAssistantIcon.jsx | Adds a new icon component for the AI Assistant. |
| plugins/ai-assistant-panel/src/ai-assistant-panel.js | Registers the panel with the activity bar including component imports. |
| plugins/ai-assistant-panel/ai-assistant-panel.php | Implements assets loading and REST API routes for the AI Assistant. |
| plugins/ai-assistant-panel/package.json, .npmrc and README.md | Set up build scripts, dependency configurations, and documentation for the new panel. |
| package.json | Updates dependency references to include the AI Assistant Panel. |
Comments suppressed due to low confidence (1)
plugins/ai-assistant-panel/src/ai-assistant-panel.js:2
- The imported component name 'AIAssistantPanelChat' does not match any file; consider updating the import to match the actual filename (e.g., 'AIAssistantPanel.jsx') or renaming the file for consistency.
import AIAssistantPanel from './components/AIAssistantPanelChat';
| import { useDispatch, useSelect, dispatch } from '@wordpress/data'; | ||
| import { parse, visit } from 'graphql'; | ||
| import 'graphiql/graphiql.min.css'; | ||
| import React, { useEffect, useCallback } from 'react'; |
There was a problem hiding this comment.
Duplicate import of React detected; please remove the redundant import to avoid potential conflicts.
| import React, { useEffect, useCallback } from 'react'; | |
| import { useEffect, useCallback, createRef } from 'react'; |
jasonbahl
left a comment
There was a problem hiding this comment.
Is this possible to be built as a standalone WordPress plugin or are we still missing internal APIs for the IDE to accomplish that? Would love to see something like this as a demonstration for how the IDE can be extended by third party WordPress plugins.
| /** | ||
| * Register REST API routes for the AI Assistant | ||
| */ | ||
| function register_rest_routes(): void { |
There was a problem hiding this comment.
Maybe dogfood WPGraphQL here instead of using REST?
2025-06-16.09.08.38.mp4