From 07a042cca6da3d627f2baf49919b3c58d7c5ccb9 Mon Sep 17 00:00:00 2001 From: optrader Date: Wed, 17 Dec 2025 12:03:44 +0900 Subject: [PATCH] =?UTF-8?q?[251217]=20fix:=20PlayerPanel=20=EB=B0=B0?= =?UTF-8?q?=EB=84=88=EB=8F=99=EC=98=81=EC=83=81=20=EC=9C=84=EC=B9=98=20?= =?UTF-8?q?=EA=B2=80=EC=A6=9D=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit πŸ• 컀밋 μ‹œκ°„: 2025. 12. 17. 12:03:44 πŸ“Š λ³€κ²½ 톡계: β€’ 총 파일: 1개 β€’ μΆ”κ°€: +70쀄 πŸ“ μˆ˜μ •λœ 파일: ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx πŸ”§ μ£Όμš” λ³€κ²½ λ‚΄μš©: β€’ μ†Œκ·œλͺ¨ κΈ°λŠ₯ κ°œμ„  --- .../src/views/PlayerPanel/PlayerPanel.jsx | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx index c2ec759d..ec7e7134 100644 --- a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx +++ b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx @@ -91,6 +91,51 @@ const findSelector = (selector, maxAttempts = 5, currentAttempts = 0) => { } }; +// λ°°λ„ˆ μœ„μΉ˜ μˆ˜μ§‘ ν•¨μˆ˜ (top, left만 μ €μž₯) +const collectBannerPositions = () => { + const positions = []; + + // banner0, banner1 λ“±μ˜ λ°°λ„ˆ μœ„μΉ˜ μˆ˜μ§‘ + for (let i = 0; i < 10; i++) { + const bannerId = `banner${i}`; + const node = document.querySelector(`[data-spotlight-id="${bannerId}"]`); + + if (node) { + const { top, left } = node.getBoundingClientRect(); + positions.push({ + bannerId, + position: { top: Math.round(top), left: Math.round(left) } + }); + dlog(`[PlayerPanel] λ°°λ„ˆ μœ„μΉ˜ μˆ˜μ§‘: ${bannerId}`, { top: Math.round(top), left: Math.round(left) }); + } + } + + return positions; +}; + +// μœ„μΉ˜ 검증 ν•¨μˆ˜ (였차 λ²”μœ„: 1px) +const isPositionMatching = (bannerPositions, bannerId, currentPosition) => { + const validPosition = bannerPositions.find(p => p.bannerId === bannerId); + + if (!validPosition) { + dlog(`[PlayerPanel] λ°°λ„ˆ μœ„μΉ˜ 검증 μ‹€νŒ¨: ${bannerId} λ°°λ„ˆλ₯Ό 찾을 수 μ—†μŒ`); + return false; + } + + const tolerance = 1; // 1px 였차 λ²”μœ„ + const isMatching = + Math.abs(currentPosition.top - validPosition.position.top) <= tolerance && + Math.abs(currentPosition.left - validPosition.position.left) <= tolerance; + + dlog(`[PlayerPanel] λ°°λ„ˆ μœ„μΉ˜ 검증: ${bannerId}`, { + expected: validPosition.position, + current: currentPosition, + matching: isMatching + }); + + return isMatching; +}; + const getLogTpNo = (type, nowMenu) => { if (type === 'LIVE') { switch (nowMenu) { @@ -219,6 +264,7 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props const [tabIndexV2, setTabIndexV2] = USE_STATE('tabIndexV2', 1); // 0: ShopNow, 1: LiveChannel, 2: ShopNowButton const [tabContainerVersion, setTabContainerVersion] = USE_STATE('tabContainerVersion', 2); // 1: TabContainer (우츑), 2: TabContainerV2 (ν•˜λ‹¨) const [isModalClosed, setIsModalClosed] = USE_STATE('isModalClosed', true); // λͺ¨λ‹¬μ΄ false μƒνƒœμΈμ§€ λ‚˜νƒ€λ‚΄λŠ” ν”Œλž˜κ·Έ + const [validBannerPositions, setValidBannerPositions] = USE_STATE('validBannerPositions', []); // μœ νš¨ν•œ λ°°λ„ˆ μœ„μΉ˜ (top, left) const panels = USE_SELECTOR('panels', (state) => state.panels.panels); const chatData = USE_SELECTOR('chatData', (state) => state.play.chatData); @@ -1937,6 +1983,30 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props panelInfo: { modalStyle: modalStyle, modalScale: scale }, }) ); + + // πŸ”½ λ°°λ„ˆ μœ„μΉ˜ μˆ˜μ§‘ (초기 λ‘œλ“œ μ‹œμ—λ§Œ μ‹€ν–‰) + if (validBannerPositions.length === 0) { + const positions = collectBannerPositions(); + if (positions.length > 0) { + setValidBannerPositions(positions); + dlog('[PlayerPanel] βœ… λ°°λ„ˆ μœ„μΉ˜ 초기 μˆ˜μ§‘ μ™„λ£Œ:', positions); + } + } + + // πŸ”½ λ°°λ„ˆ μœ„μΉ˜ 검증 (μœ„μΉ˜κ°€ λ§žμ§€ μ•ŠμœΌλ©΄ λΉ„λ””μ˜€ μž¬μƒ 쀑단) + if (validBannerPositions.length > 0) { + const currentPosition = { top: Math.round(top), left: Math.round(left) }; + const isValidPosition = isPositionMatching(validBannerPositions, panelInfo.modalContainerId, currentPosition); + + if (!isValidPosition) { + dlog('[PlayerPanel] ⚠️ λ°°λ„ˆ μœ„μΉ˜ 검증 μ‹€νŒ¨ - λΉ„λ””μ˜€ μž¬μƒ 쀑단', { + bannerId: panelInfo.modalContainerId, + currentPosition, + validBannerPositions + }); + return; // λΉ„λ””μ˜€ μž¬μƒ 쀑단 + } + } } else { dlog('[PlayerPanel] Condition 1: Node not found, using saved modalStyle'); setModalStyle(panelInfo.modalStyle);