diff --git a/plugin-designs/my-upg-100-list/upg-100-list.vue b/plugin-designs/my-upg-100-list/upg-100-list.vue index f28cbcd7e..ad25996aa 100644 --- a/plugin-designs/my-upg-100-list/upg-100-list.vue +++ b/plugin-designs/my-upg-100-list/upg-100-list.vue @@ -626,6 +626,16 @@ function ensureLayers() { // F2-D2: brighter, thicker outline gives contrast on dark without washing out light. paint: { 'line-color': matchColorExpr, 'line-width': 1.2, 'line-opacity': 0.9 }, }) + + // ★ THE REAL READINESS SIGNAL. onLegendSelect() returns early unless map.getLayer('tapestry-fill') + // exists, so a "Show on map" request that arrives before this function runs cannot hold a + // selection however correctly it was delivered. This is the third layer of the same defect -- + // apply once against unready state, then discard -- and this is the point where the state is + // finally ready. Drains any request retained by applySelectZone(). + if (_pendingZoneId) { + const id = _pendingZoneId + nextTick(() => { if (_pendingZoneId === id) applySelectZone(id) }) + } } // ── 09b shift-select tool: selection highlight layers (D-2) ────────────────── @@ -1606,14 +1616,21 @@ function applySelectZone(zoneId) { const node = findLegendNode(legendNodes.value, zoneId); if (!node) { _pendingZoneId = zoneId; _markZoneState('unresolved', zoneId); return false; } // not ready -- REMEMBER it onLegendSelect(node); - _pendingZoneId = undefined; // selectedKey (:163, "currently isolated zoneKey (or null)") is this component's own record of the // isolation, so 'applied-but-no-selection' means the path was REACHED and its EFFECT lost -- a // different bug from delivery, and the one rega's timeline points at. // ★ I first wrote selectedZoneKey here, which does not exist; the try/catch would have swallowed // the ReferenceError and reported 'applied' every time. A diagnostic that cannot report failure is // worse than none. main's check:no-free-identifiers (6b05f513) now catches this class. - _markZoneState(!selectedKey.value ? 'applied-but-no-selection' : 'applied', zoneId); + // ★ IF THE EFFECT DID NOT TAKE, THE REQUEST IS STILL OUTSTANDING. rega's re-shoot on 27eed341 + // read exactly this state twice, 13 ms apart, with the right id -- so the node WAS found and + // onLegendSelect WAS called, and the selection still did not hold. The cause is onLegendSelect's + // own first line: `if (!map || !map.getLayer('tapestry-fill')) return`. It bails silently when the + // map's tapestry layer is not up, which at t=4.9s it was not. So the readiness signal was never + // legendNodes or mapRef -- it is THE LAYER, and the old code cleared _pendingZoneId here as though + // the work were done. Keeping it means ensureLayers() can drain it the moment the layer exists. + if (!selectedKey.value) { _pendingZoneId = zoneId; _markZoneState('applied-but-no-selection', zoneId); return false; } + _markZoneState('applied', zoneId); return true; }