Skip to content

Develop#54

Merged
Jacquilyn-F merged 2 commits intomainfrom
develop
Apr 30, 2025
Merged

Develop#54
Jacquilyn-F merged 2 commits intomainfrom
develop

Conversation

@OutsideofemiT
Copy link
Collaborator

No description provided.

Copy link

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 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 });
Copy link

Copilot AI Apr 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
name={minion.name}
questionId={minion.questionId}
goToQuestion={goToQuestion}
size={3} // Add the size property with an appropriate value
Copy link

Copilot AI Apr 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate 'size' prop found in the Minion component. Remove or consolidate the duplicate prop to ensure the intended value is applied.

Suggested change
size={3} // Add the size property with an appropriate value

Copilot uses AI. Check for mistakes.
@Jacquilyn-F Jacquilyn-F merged commit 1df4e7e into main Apr 30, 2025
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.

3 participants