feat(keyboard): add VirtualKeyboard with visual state indicators - #1310
Merged
kike-alt merged 1 commit intoAug 26, 2026
Merged
Conversation
- Create VirtualKeyboard component with per-key status colors: green for correct, yellow for present, dark gray for absent - Wrap KeyButton in React.memo for performance - Support ENTER, BACKSPACE, and letter key actions - Add comprehensive unit tests verifying class assignments and handlers - Include disabled state and aria-labels for accessibility Closes kike-alt#1234
|
@nanaf6203-bit Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Closes #1234
Closes #1233
Closes #1235
Closes #1236
Creates the
VirtualKeyboardcomponent with distinct visual states for correct (green), misplaced (yellow), and absent (dark gray) letter keys. EachKeyButtonis wrapped inReact.memowith a custom comparison to prevent unnecessary re-renders when other keys change state.Why
The virtual keyboard is the primary input mechanism for Wordle gameplay. Without visual state indicators, players cannot track which letters have been guessed and their correctness. The component uses a
keyStatusesprop (Record<string, KeyStatus>) that the parent game component can derive from guess evaluation results.What was built
frontend/src/components/VirtualKeyboard.tsx:KeyStatustypeVirtualKeyboardPropsonKeyPress,onEnter,onBackspace,keyStatuses,disabledKeyButton(internal)React.memo-wrapped key with status-dependent Tailwind classesVirtualKeyboardfrontend/src/components/VirtualKeyboard.spec.tsx:bg-green-600class appliedbg-yellow-500class appliedbg-gray-600class appliedNo existing files modified — only additions, so regression risk is low.
Acceptance criteria coverage
VirtualKeyboard.spec.tsx— correct status suite)VirtualKeyboard.spec.tsx— present status suite)VirtualKeyboard.spec.tsx— absent status suite)VirtualKeyboard.spec.tsx— 10 tests total)Test plan
npm test— not run per instructionnpm run build— not run per instructionEnv vars / Notes
No new environment variables. The component is a pure presentational component that accepts callbacks and a status map — it has no side effects or API dependencies.