Scribble assignment#121
Open
mohammed412anas wants to merge 9 commits into
Open
Conversation
- 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.
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.
Summary