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

@@ -112,6 +112,19 @@ var SeaDeal = (function () {
_showStage(isLevity);
}
// Like `openStage` but DOESN'T show the stage modal — used by AUTO
// DRAW (my_sea.html) to place cards quietly while keeping them
// clickable later. The overlay click handler reads `_seaHand[pos]`;
// without an entry here, click silently no-ops (the user-reported
// bug fixed 2026-05-21). Routing slot fill thru SeaDeal's internal
// `_fillSlot` (instead of the inline shim) also ensures
// `dataset.posKey` stays consistent w. the manual-FLIP path
// (selector form like ".sea-pos-cover", not raw "cover").
function register(card, posSelector, isLevity) {
_seaHand[posSelector] = { card: card, isLevity: isLevity };
_fillSlot(posSelector, card, isLevity);
}
// ── Init ──────────────────────────────────────────────────────────────────
function init() {
@@ -239,6 +252,7 @@ var SeaDeal = (function () {
return {
openStage: openStage,
register: register,
resetHand: resetHand,
reinit: init, // call after overlay is injected into the DOM
_testInit: function () {