Added a button to fill the fourth hand when three hands have 13 cards each#235
Open
tameware wants to merge 5 commits into
Open
Added a button to fill the fourth hand when three hands have 13 cards each#235tameware wants to merge 5 commits into
tameware wants to merge 5 commits into
Conversation
When three hands each hold 13 distinct cards and the fourth hand is empty, enable a Fill fourth hand button and automatically complete the deal with the remaining 13 cards. Includes JS unit tests for the new logic. Co-authored-by: Adam Wildavsky <adam@tameware.com>
Use Enter for filling an eligible fourth hand or running double-dummy on a complete deal, while styling unavailable actions clearly. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the DDS MVP web UI so that when three hands are complete (39 cards total), users can automatically fill the missing fourth hand, and it refines “Enter” key behavior to trigger the appropriate default action (fill vs. double-dummy).
Changes:
- Added a “Fill fourth hand” button and supporting logic to compute and populate the missing hand from the remaining 13 cards.
- Updated action availability/keyboard handling so Enter triggers fill when eligible, otherwise runs double-dummy only when all hands are complete.
- Expanded coverage with new/updated E2E, JS unit, and CSS contract tests, and added CSS styling for enabled/disabled action buttons.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| web/tests/test_mvp_e2e.py | Adds E2E coverage for Enter key behavior and the new Fill fourth hand flow; adjusts incomplete-deal validation test expectations. |
| web/tests/test_dds_mvp_css.py | New CSS contract tests asserting enabled/disabled styling for the primary action buttons. |
| web/tests/dds_mvp_test.mjs | Extends unit tests and mocks to cover fourth-hand fill state, action-button enablement, and Enter key routing. |
| web/dds_mvp.js | Implements fourth-hand fill computation, action-button state updates, and global keydown handling. |
| web/dds_mvp.html | Adds the Fill fourth hand button and IDs; makes buttons type="button"; defaults action buttons to disabled. |
| web/dds_mvp.css | Styles enabled/disabled states for the primary action buttons. |
| web/BUILD.bazel | Registers the new CSS py_test and includes it in the web test suite. |
The double-dummy action is disabled until all hands are complete, so its incomplete-hand error path and tests cannot execute through the UI. Co-authored-by: Cursor <cursoragent@cursor.com>
Show all 52 cards by suit and gray cards as they are entered so users can see which cards remain available. Co-authored-by: Cursor <cursoragent@cursor.com>
Display a live card count only when a hand exceeds 13 cards so overfilled hands are immediately identifiable. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Deployed at https://tameware.com/adam/bridge/dds/dds_mvp.html