Conversation
feat: reapply and push backend updates from stash
There was a problem hiding this comment.
Pull Request Overview
This PR introduces several updates and refactorings across the server and client codebases to support enhanced question generation, improved API routes, and additional UI functionality. Key changes include:
- Adding a difficulty field and renaming keys in fallback questions.
- Renaming and adding new prompt builder functions while updating the API routes.
- Updating client components and configuration for improved routing, asset aliasing, and UI audio feedback.
Reviewed Changes
Copilot reviewed 12 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| server/src/utils/fallbackQuestions.ts | Added a "difficulty" property and renamed several fallback question keys for consistency. |
| server/src/utils/PromptBuilder.ts | Renamed prompt functions and introduced new prompt builder functions for different difficulty levels. |
| server/src/server.ts | Imported and integrated new API routes (OpenAI and GraphQL middleware) into the server setup. |
| server/src/schemas/index.ts | Updated module imports to remove file extensions. |
| server/src/routes/api/openai.ts | Modified the OpenAI question route, added a new TTS route, and updated fallback logic. |
| client/vite.config.ts | Added an alias configuration to simplify module imports. |
| client/src/components/ui/dialog.ts | Corrected the case for utility imports from "Utils" to "utils". |
| client/src/components/screens/Questions.tsx | Refactored question fetching and state handling logic for better question display. |
| client/src/components/screens/GameMap.tsx | Introduced sound preloading and updated minion rendering with duplicate prop removal. |
| client/src/components/DanismEvent.tsx | Updated to use a consolidated helper for randomized quotes and sound paths. |
| client/src/components/AnswerResultModal.tsx | Enhanced modal UI by adding audio support and improved styling. |
Files not reviewed (3)
- client/package-lock.json: Language not supported
- client/package.json: Language not supported
- server/package.json: Language not supported
|
|
||
| // Build the LLM prompt | ||
| const prompt = PromptBuilder.getPrompt(track, level); | ||
| res.json({ type: 'fallback', question: fallback }); |
There was a problem hiding this comment.
The fallback response lacks an 'answer' property, which is expected by the client code. Consider including the 'answer' field (for example, by deriving it from fallback.choices[fallback.correctIndex]) to ensure a consistent response structure.
| name={minion.name} | ||
| questionId={minion.questionId} | ||
| goToQuestion={goToQuestion} | ||
| size={3} // Add the size property with an appropriate value |
There was a problem hiding this comment.
Duplicate 'size' prop found in the Minion component. Remove or consolidate the duplicate prop to ensure the intended value is applied.
| size={3} // Add the size property with an appropriate value |
No description provided.