828c2a03c18c74d191d7181cfa70c824c2beca67
Summary
▎
▎ - Opening a finished game caused an infinite spinner because the NDJSON stream never delivers events for finished games — it just hangs waiting for events that will never come
▎ - Fix: fetch the full game state via REST on load (GET .../game/{gameId}), apply it to the board immediately, and only open the stream subscription if the game is still ongoing or pending
▎
▎ Changes
▎
▎ - tournament-watch.component.ts — REST fetch now drives the initial state; stream is only started conditionally; extracted applySnapshot(), isFinished(), subscribeToStream()
▎
▎ Test plan
▎
▎ - [ ] Finished game: board shows final position, correct status label, no spinner
▎ - [ ] Live game: board shows current position, stream updates continue to work
▎ - [ ] Pending game: stream starts and updates once the game begins
---------
Co-authored-by: LQ63 <lkhermann@web.de>
Reviewed-on: #16
NowChess Frontend
Angular 20 frontend for the NowChess board UI.
Tech stack
- Angular standalone components and route-based pages
- HTTP and streaming integration for live game updates
- Asset sprites loaded from
arabian-chess/
Project structure
src/app/pagespage-level containers (welcome,game)src/app/componentsreusable UI pieces (chess-board,chess-piece)src/app/servicesAPI and stream integration (GameApiService)src/app/modelsshared API/domain typessrc/app/core/chesschess domain utilities (FEN parsing and square lookup)src/environmentsenvironment-specific API base URLs
Run locally
npm install
npm start
Open http://localhost:4200.
Development environment defaults to:
- API:
http://localhost:8080 - WebSocket:
ws://localhost:8080
src/environments/environment.ts is production-oriented (production: true) and src/environments/environment.development.ts is development-oriented (production: false).
Build and test
npm run build
npm test
Description
Languages
TypeScript
39.8%
CSS
35.5%
HTML
24.5%
Dockerfile
0.1%
Shell
0.1%