Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces AI-powered retrospective template generation using OpenAI via the langchain library. Users with AI enabled can generate creative, theme-based retro column structures by entering a simple prompt (e.g., "star wars"). The feature is conditionally displayed based on the ai_enabled flag returned from the backend, which checks if an OpenAI API key is configured.
Key Changes:
- Added OpenAI integration through langchain with a custom prompt for generating themed retro columns
- Created new UI components (
Spinner,InputGroup) and an AI template popover interface - Extended user authentication to track and sync AI availability status via localStorage and API
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
go.mod / go.sum |
Added langchain dependency for AI model integration; updated Go version references |
cmd/thoughts/config.go |
Added OpenAIAPIKey configuration field |
cmd/thoughts/main.go |
Integrated AI model resolution into application initialization |
cmd/thoughts/routes.go |
Added /api/ai/retro-template endpoint for AI template generation |
cmd/thoughts/resources/user.go |
Extended User resource to include ai_enabled field based on AI availability |
cmd/thoughts/controllers/ai.go |
New controller handling AI retro template requests with validation |
cmd/thoughts/ai/provider.go |
AI model provider resolution with fallback when no API key configured |
cmd/thoughts/ai/models.go |
OpenAI model initialization using gpt-4o-mini |
cmd/thoughts/ai/prompts/retro_template.go |
Comprehensive system prompt for generating themed retro templates |
cmd/thoughts/ai/prompts/json.go |
JSON parsing utility for AI responses |
ui/src/types.ts |
Added ai_enabled to User interface and AIRetroTemplateResponse interface |
ui/src/hooks/use-auth.ts |
Extended localStorage handling for AI enablement flag |
ui/src/components/auth.tsx |
Added API call to sync user data including AI availability on mount |
ui/src/components/retro/creator.tsx |
Integrated AI template button conditionally based on user's AI enablement |
ui/src/components/retro/ai-retro-template.tsx |
New component providing AI template generation popover with form validation |
ui/src/components/ui/spinner.tsx |
New reusable loading spinner component |
ui/src/components/ui/input-group.tsx |
New compound input component supporting addons and buttons |
ui/src/components/ui/input.tsx |
Removed flex class for better compatibility with input groups |
ui/src/components/ui/button.tsx |
Added icon-sm and icon-lg size variants; removed shadow-xs from default/secondary variants |
ui/src/components/retro/note-dialog.tsx |
Added autoComplete="off" to input field |
ui/src/components/error.tsx |
Added min-w-md class to error cards |
README.md |
Added documentation for AI feature configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the ability to generate retro columns using AI. Currently supporting OpenAI but should be easy to add further models using langchain.