Skip to content

Scribble assignment#121

Open
mohammed412anas wants to merge 9 commits into
everest-engineering:mainfrom
mohammed412anas:scribble-assignment
Open

Scribble assignment#121
mohammed412anas wants to merge 9 commits into
everest-engineering:mainfrom
mohammed412anas:scribble-assignment

Conversation

@mohammed412anas

@mohammed412anas mohammed412anas commented Jun 10, 2026

Copy link
Copy Markdown

Summary

- Host tracking: creator becomes host on room creation, host identity
  preserved across page refresh via localStorage participant token
- Join validation: reject empty/malformed/unknown codes with spec-defined
  error payloads; client-side name trimming and format validation
- Room isolation: Map-based in-memory storage, code-keyed lookup
- Lobby polling: auto-refresh every 2s while mounted, no flicker
- Host-only start: button disabled for non-hosts and when < 2 players;
  viewerIsHost computed server-side with client fallback
- Host promotion: earliest-joined participant promoted if host leaves
- Bug fix: race condition on host reload no longer disables start button
  (fetchRoom no longer calls restoreRoomSession; poll effect waits for
  restore to complete)
- Spec kit artifacts: spec.md, plan.md, tasks.md, checklists, AGENTS.md
- 002-game-start-drawer: POST /rooms/:code/start, host-as-drawer,
  deterministic word selection, drawer-only word visibility
- 003-gameplay-interaction: interactive canvas with stroke sync via
  polling, guess submission with case-insensitive comparison,
  scoring (+100 correct), round end on all guessers correct
- 004-result-restart: result view with revealed word/scores/history,
  POST /rooms/:code/restart, host-only restart with state reset,
  participant preservation across restarts
- Checklists for all three specs
…ay, result & restart)

- Mark all tasks in 001-room-setup-lobby/tasks.md as completed
…tart

- Extend Room/Round/Guess/Stroke/Point types in game.ts
- Add startRoom, updateCanvas, submitGuess, restartRoom to roomStore.ts
- Add Zod schemas for new endpoints in schemas.ts
- Add POST /:code/start, /canvas, /guess, /restart routes in rooms.ts
- Add 29 new tests covering all game lifecycle operations
- Hide secretWord from non-drawers in toRoomSnapshot during playing
- Add RoomStatus, Round, Guess, Stroke, Point types to api.ts
- Add startGame, updateCanvas, submitGuess, restartGame methods
- Add hostFlagKey localStorage persistence for host identity
- Implement Canvas component with pointer coordinate scaling fix
- Implement GuessForm with submission state, validation, and error display
- Implement Scoreboard with drawer badge and scores display
- Implement ResultPanel with guess history and word reveal
- Add 21 component tests across all new components
- Add setupTests.ts and vitest config for jsdom test environment
- GamePage: role-aware rendering (drawer/guesser/result), canvas sync with 500ms debounce, guess submission, restart flow
- LobbyPage: start game with API call + error handling, redirect to game/playing/result
- LobbyPage: three-level fallback for host identity (stateViewerIsHost || room.viewerIsHost || hostParticipantId match)
- CreateRoomPage/JoinRoomPage: add aria-live regions and aria-invalid for accessibility
- LobbyPage test: refactor with makeMockRoom helper, fix globalThis.fetch mock
- Add GamePage test: 9 tests covering playing and result states
- Create specs/discovery.md with 4 gaps, 3 assumptions, 13 relevant files
- Create specs/reflection.md covering decisions, AI usage, tradeoffs
- Update .specify/feature.json to point to latest completed spec
- Mark T219 as done (frontend component tests were implemented)
All checklist items verified against spec documents - every completeness,
clarity, consistency, measurability, coverage, edge case, and assumption
criterion is satisfied.
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.

1 participant