Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request introduces a comprehensive frontend redesign with a "Red Tetris" theme, adds game history persistence with database-backed statistics, and improves LAN connectivity support. The changes span both client and server codebases with significant visual improvements and new API endpoints.
Changes:
- Frontend redesign: 3D beveled Tetris pieces with gradients, new welcome page with player stats and game history, redesigned authentication forms, and a reusable LoadingOverlay component
- Game history feature: Database tables for persisting finished games and player records, new
/api/gamesendpoint with pagination, client service for fetching and computing statistics - Network improvements: Automatic LAN IP detection for CORS whitelist, Vite auto-configuration for network access, server binding to 0.0.0.0
Reviewed changes
Copilot reviewed 33 out of 34 changed files in this pull request and generated 20 comments.
Show a summary per file
| File | Description |
|---|---|
| server/migrations/002_create_games_and_records.sql | Adds games and game_records tables for persisting game history |
| server/core/GameService.ts | Implements game persistence logic with placement ranking |
| server/controllers/gamesController.ts | API controller for fetching user's game history with pagination |
| server/routes/games.ts | Route definition with Swagger documentation for games API |
| server/routes/pagination.ts | Generic pagination utility function |
| server/types/pagination.ts | TypeScript interface for paginated results |
| server/game/types.ts | Adds diedAt field to PlayerState for tracking death time |
| server/game/GameEngine.ts | Updates to set diedAt timestamp when players die |
| server/core/Player.ts | Adds diedAt field to Player class |
| server/net/socketHandlers.ts | Emits diedAt in state and calls GameService to persist finished games |
| server/db.ts | Adds test environment support and removes error re-throwing in migrations |
| server/app.ts | Implements dynamic CORS origins based on network IPs |
| server/tests/setup.test.ts | Test setup file with database cleanup hooks |
| server/tests/db.test.ts | Tests for database migration logic |
| server/package.json | Adds proxyquire dev dependency and updates test command |
| client/app/services/games.ts | Service for fetching game history and computing stats |
| client/app/services/auth.ts | Updates API_URL configuration |
| client/app/welcome/welcome.tsx | Complete redesign with stats dashboard and recent games list |
| client/app/routes/game.tsx | 3D piece styling, larger cells, improved layout, back button |
| client/app/routes/home.tsx | Updates page metadata |
| client/app/components/LoadingOverlay.tsx | Reusable loading overlay with Tetris-themed animation |
| client/app/components/auth/LoginForm.tsx | Redesigned login form with gradient styling |
| client/app/components/auth/RegisterForm.tsx | Redesigned registration form with gradient styling |
| client/app/components/auth/ProtectedRoute.tsx | Uses LoadingOverlay instead of inline loading UI |
| client/app/components/auth/PublicOnlyRoute.tsx | Uses LoadingOverlay instead of inline loading UI |
| client/app/root.tsx | Adds global LoadingOverlay for navigation states |
| client/app/app.css | Updates background gradient |
| client/vite.config.ts | Implements auto-detection of network IP for VITE_SERVER_URL |
| client/package.json | Changes package type to 'module' and updates dev script for 0.0.0.0 binding |
| client/.gitignore | Adds +types/ to ignore auto-generated React Router types |
| .env.example | Updates with test database config and new port defaults |
| .devcontainer/start-dev.sh | Creates test database during setup |
| pnpm-lock.yaml | Adds proxyquire and related dependencies |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Owner
|
Well, the interface works, but it looks way too "vibecoded", and a few tiny things:
|
…n ProtectedRoute and PublicOnlyRoute
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.
🎨 Frontend — New Design
LoadingOverlaycomponent with a Tetris-themed animation; used for navigation and socket operations (create / join / start / restart)🌐 Network
VITE_SERVER_URL=auto), dev server binds to0.0.0.0CLIENT_URLenv variable📊 Game History (merged from
game-history)gamesandgame_recordstables with foreign keys and indexesGET /api/gameswith pagination and Swagger documentationgamesServicefetches history and computes stats (wins, high score, average score, best place)🧹 Cleanup
+types/to.gitignore(auto-generated React Router types)