Feature/game update#14
Merged
Merged
Conversation
Co-authored-by: Copilot <copilot@github.com>
…iry reveal, and Playwright E2E tests (#13) * Initial plan * Implement Translation Quiz mode, winning streak, high score, and timer expiry fix Agent-Logs-Url: https://github.com/HannoZ/Lexicala.NET/sessions/007c00e6-8b9e-41b7-94e2-049f7fd65e11 Co-authored-by: HannoZ <29945379+HannoZ@users.noreply.github.com> * Address review feedback: add ExpireRoundAsync endpoint, extract BuildRateLimit helper, fix point/points text Agent-Logs-Url: https://github.com/HannoZ/Lexicala.NET/sessions/007c00e6-8b9e-41b7-94e2-049f7fd65e11 Co-authored-by: HannoZ <29945379+HannoZ@users.noreply.github.com> * Merge feature/game-update and rebased Translation Quiz onto it Agent-Logs-Url: https://github.com/HannoZ/Lexicala.NET/sessions/d177bf24-f555-4100-b189-80f9fba242cd Co-authored-by: HannoZ <29945379+HannoZ@users.noreply.github.com> * Use all available languages from API instead of hardcoded list in TranslationQuiz Agent-Logs-Url: https://github.com/HannoZ/Lexicala.NET/sessions/d8c58822-39c0-4958-a685-6a3921c1ea7e Co-authored-by: HannoZ <29945379+HannoZ@users.noreply.github.com> * Fix all pending review comments and add 13 Playwright E2E tests for Translation Quiz Agent-Logs-Url: https://github.com/HannoZ/Lexicala.NET/sessions/ef800131-a254-42c1-8608-2f3e9a0643d7 Co-authored-by: HannoZ <29945379+HannoZ@users.noreply.github.com> * Increase web server timeout to 120 seconds in Playwright configuration --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: HannoZ <29945379+HannoZ@users.noreply.github.com> Co-authored-by: Hanno Zwikstra <hanno@hannozwikstra.nl>
…tests for wrong guesses tracking Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the Lexicala.NET demo experience by enhancing the existing Sense Sprint backend/frontend flow (language selection, better round lifecycle UX) and introducing a new Translation Quiz game mode end-to-end (API + frontend + tests), alongside updated documentation for running the demos.
Changes:
- Added Translation Quiz game mode: new backend service + minimal-API endpoints + Playwright E2E tests and UI.
- Enhanced Sense Sprint to support per-round language selection and improved client-side session/stats handling.
- Improved developer docs and added Playwright tooling/config for the web demo.
Reviewed changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| source/Lexicala.NET.Tests/TranslationQuizGameServiceTests.cs | New unit tests for Translation Quiz service behavior and caching. |
| source/Lexicala.NET.Tests/SenseSprintGameServiceTests.cs | New unit tests for Sense Sprint service argument/round behaviors. |
| source/Lexicala.NET.Tests/Lexicala.NET.Tests.csproj | Adds Demo API project reference so game services can be tested. |
| source/Demo/sense-sprint-web/vite.config.ts | Proxies /languages to the backend during local dev. |
| source/Demo/sense-sprint-web/tests/e2e/translation-quiz.spec.ts | New Playwright E2E coverage for Translation Quiz UI flows. |
| source/Demo/sense-sprint-web/tests/e2e/sense-sprint.spec.ts | New Playwright E2E coverage for Sense Sprint language/lifecycle edge cases. |
| source/Demo/sense-sprint-web/tests/e2e/mocks.ts | Shared Playwright mock payloads for /languages and game endpoints. |
| source/Demo/sense-sprint-web/src/App.tsx | Major UI refactor: tabs for modes, languages caching, stats/session persistence, Translation Quiz UI + API calls. |
| source/Demo/sense-sprint-web/src/App.css | Styling for tabs, quiz UI, and expanded stats/celebration UI. |
| source/Demo/sense-sprint-web/README.md | Updated web demo documentation (setup, features, gameplay). |
| source/Demo/sense-sprint-web/playwright.config.ts | Adds Playwright test runner configuration for the web demo. |
| source/Demo/sense-sprint-web/package.json | Adds test:e2e script and Playwright dependency. |
| source/Demo/sense-sprint-web/package-lock.json | Locks Playwright + dependencies. |
| source/Demo/sense-sprint-web/.gitignore | Ignores Playwright artifacts (playwright-report, test-results). |
| source/Demo/Lexicala.NET.Demo.Api/Program.cs | Registers TranslationQuiz service; adds endpoints; Sense Sprint create-round now accepts language in body. |
| source/Demo/Lexicala.NET.Demo.Api/Game/TranslationQuizGameService.cs | New backend game service implementing Translation Quiz round generation/answer/expire logic with caching. |
| source/Demo/Lexicala.NET.Demo.Api/Game/TranslationQuizContracts.cs | DTO contracts for Translation Quiz endpoints. |
| source/Demo/Lexicala.NET.Demo.Api/Game/SenseSprintGameService.cs | Adds language support for round creation; refactors rate limit handling; improves give-up status messaging. |
| source/Demo/Lexicala.NET.Demo.Api/Game/SenseSprintContracts.cs | Adds language to Sense Sprint create-round response and request body DTO. |
| source/Demo/Lexicala.NET.Demo.Api/Game/ITranslationQuizGameService.cs | New interface for Translation Quiz service. |
| source/Demo/Lexicala.NET.Demo.Api/Game/ISenseSprintGameService.cs | Updates Sense Sprint interface to accept optional language. |
| source/Demo/Lexicala.NET.Demo.Api/Game/GameServiceHelpers.cs | Extracted helper for building rate-limit debug info. |
| README.md | Updates repo-level demo instructions and points to the web demo docs. |
| .github/instructions/repository-information.instructions.md | Documents the new web demo location under source/Demo/. |
Files not reviewed (1)
- source/Demo/sense-sprint-web/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
source/Demo/Lexicala.NET.Demo.Api/Program.cs:120
- The create-round endpoint only catches
InvalidOperationException. If the client supplies an invalidLanguage(e.g., not a 2-letter code),ILexicalaClient.FlukySearchAsynccan throwArgumentException, which will currently bubble up as a 500. Consider catchingArgumentExceptionhere and returning a 400 (ProblemDetails) for invalid input.
catch (InvalidOperationException ex)
{
return Results.Problem(ex.Message, statusCode: StatusCodes.Status503ServiceUnavailable);
}
…int descriptions Co-authored-by: Copilot <copilot@github.com>
…sCache once per path Agent-Logs-Url: https://github.com/HannoZ/Lexicala.NET/sessions/07eeeb2c-863f-4cfe-acf2-ff02d30145af Co-authored-by: HannoZ <29945379+HannoZ@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ry check Agent-Logs-Url: https://github.com/HannoZ/Lexicala.NET/sessions/9ff422d1-645e-4487-aa53-262ac59191da Co-authored-by: HannoZ <29945379+HannoZ@users.noreply.github.com>
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.
This pull request introduces several improvements and new features to the Lexicala.NET demo projects, with a focus on expanding and documenting the Sense Sprint demo game and adding support for a new Translation Quiz game mode. The changes include enhancements to API contracts, service interfaces, and documentation to support language selection, improved round management, and clearer development instructions.
Key changes:
Demo Game Enhancements
sense-sprint-web) undersource/Demo/, with updated documentation and clearer instructions for setup and usage in both the.github/instructions/repository-information.instructions.mdandREADME.mdfiles. [1] [2]Sense Sprint Game Service Improvements
ISenseSprintGameServiceandSenseSprintGameServiceto support creating rounds in a user-selected language (defaulting to English if none is provided), and updated the round creation flow to include the language in the response. [1] [2] [3] [4] [5] [6]GiveUpAsyncmethod to distinguish between expired and lost rounds, providing more accurate feedback to the user.GameServiceHelpers). [1] [2]Translation Quiz Game Mode
ITranslationQuizGameServiceinterface and related API contracts (TranslationQuizContracts.cs) to support a translation quiz game mode, including round creation, answer submission, and round expiration. [1] [2]Documentation and Developer Experience
.github/instructions/repository-information.instructions.md.These changes collectively improve the flexibility, usability, and documentation of the demo projects, making it easier for developers to run, extend, and understand the Sense Sprint and Translation Quiz games.