fix: AUTO-DRAWn my-sea cards are now clickable to re-open the stage modal — SeaDeal.register(card, posSelector, isLevity) public method populates _seaHand + delegates to SeaDeal's internal _fillSlot so the overlay click handler can resolve _seaHand[pos] for auto-drawn slots (previously short-circuited → silent no-op). AUTO DRAW in my_sea.html now calls register instead of the inline _fillSlot shim — also fixes a dataset.posKey inconsistency (inline stored raw "cover", SeaDeal stores ".sea-pos-cover"; click handler reads SeaDeal's form). User-reported 2026-05-21. TDD — new FT test_auto_drawn_slots_can_reopen_stage_modal_on_click pins the contract

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-05-20 14:53:05 -04:00
parent 31cb8dfc1d
commit bb44aa326a
3 changed files with 90 additions and 1 deletions

View File

@@ -591,7 +591,20 @@
);
if (stack) _showOk(stack);
setTimeout(function () {
_fillSlot(e.posName, e.card, e.isLevity);
// Route thru SeaDeal.register (not the inline
// `_fillSlot`) so SeaDeal's `_seaHand` dict
// gets the entry — the overlay click handler
// reads from there, so without registration
// the auto-drawn slots are silently un-
// clickable (user-reported bug, 2026-05-21).
// Fallback to the inline shim only if sea.js
// hasn't loaded yet (defensive — script load
// order makes this unlikely).
if (window.SeaDeal && window.SeaDeal.register) {
SeaDeal.register(e.card, '.sea-pos-' + e.posName, e.isLevity);
} else {
_fillSlot(e.posName, e.card, e.isLevity);
}
cross.querySelector('.sea-pos-' + e.posName + ' .sea-card-slot')
.classList.add('sea-card-slot--visible');
_filled++;