From ae0e24144ae3c3c382b29aa7913852084c03937a Mon Sep 17 00:00:00 2001 From: optrader Date: Tue, 18 Nov 2025 05:08:18 +0900 Subject: [PATCH] =?UTF-8?q?[251118]=20feat:=20playActions=20=ED=95=A8?= =?UTF-8?q?=EC=88=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ๐Ÿ• ์ปค๋ฐ‹ ์‹œ๊ฐ„: 2025. 11. 18. 05:08:17 ๐Ÿ“Š ๋ณ€๊ฒฝ ํ†ต๊ณ„: โ€ข ์ด ํŒŒ์ผ: 4๊ฐœ โ€ข ์ถ”๊ฐ€: +245์ค„ โ€ข ์‚ญ์ œ: -22์ค„ ๐Ÿ“ ์ˆ˜์ •๋œ ํŒŒ์ผ: ~ com.twin.app.shoptime/src/actions/playActions.js ~ com.twin.app.shoptime/src/views/DetailPanel/DetailPanel.jsx ~ com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx ~ com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx ๐Ÿ”ง ์ฃผ์š” ๋ณ€๊ฒฝ ๋‚ด์šฉ: โ€ข ํ•ต์‹ฌ ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง ๊ฐœ์„  โ€ข ๋Œ€๊ทœ๋ชจ ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ --- .../src/actions/playActions.js | 135 ++++++++++++++++-- .../src/views/DetailPanel/DetailPanel.jsx | 5 +- .../views/HomePanel/HomeBanner/RandomUnit.jsx | 6 +- .../src/views/HomePanel/HomePanel.jsx | 121 +++++++++++++++- 4 files changed, 245 insertions(+), 22 deletions(-) diff --git a/com.twin.app.shoptime/src/actions/playActions.js b/com.twin.app.shoptime/src/actions/playActions.js index efeb97e5..c8b32235 100644 --- a/com.twin.app.shoptime/src/actions/playActions.js +++ b/com.twin.app.shoptime/src/actions/playActions.js @@ -217,7 +217,7 @@ export const finishVideoPreview = () => (dispatch, getState) => { clearTimeout(startVideoFocusTimer); startVideoFocusTimer = null; } - dispatch(popPanel()); + // dispatch(popPanel()); } }; @@ -235,7 +235,7 @@ export const finishModalVideoForce = () => (dispatch, getState) => { startVideoFocusTimer = null; } // panelName์„ ์ง€์ •ํ•˜๋ฉด ์Šคํƒ ์–ด๋””์— ์žˆ๋“  ํ•ด๋‹น ํŒจ๋„์„ ์ œ๊ฑฐ - dispatch(popPanel(panel_names.PLAYER_PANEL)); + // dispatch(popPanel(panel_names.PLAYER_PANEL)); } }; @@ -256,6 +256,123 @@ export const finishAllVideoForce = () => (dispatch, getState) => { } }; +// ๐Ÿ”ฝ ํŒจ๋„์€ ์œ ์ง€ํ•˜๊ณ  ๋น„๋””์˜ค๋งŒ ์ค‘์ง€ํ•˜๋Š” ํ•จ์ˆ˜๋“ค + +/** + * ํŒจ๋„์„ ๋‹ซ์ง€ ์•Š๊ณ (popPanel ํ•˜์ง€ ์•Š๊ณ ) ๋น„๋””์˜ค๋งŒ ์ค‘์ง€ํ•ฉ๋‹ˆ๋‹ค. + * ๋ชจ๋‹ฌ ๋น„๋””์˜ค์˜ ์žฌ์ƒ์„ ์ค‘์ง€ํ•˜๊ณ  ์ˆจ๊น€ ์ƒํƒœ๋กœ ๋งŒ๋“ญ๋‹ˆ๋‹ค. + */ +export const stopModalVideoWithoutClosingPanel = () => (dispatch, getState) => { + const panels = getState().panels.panels; + + // modal PlayerPanel ์ฐพ๊ธฐ + const modalPlayerPanel = panels.find( + (panel) => panel.name === panel_names.PLAYER_PANEL && panel.panelInfo?.modal + ); + + if (modalPlayerPanel) { + console.log('[stopModalVideoWithoutClosingPanel] Stopping modal video playback'); + + // ํƒ€์ด๋จธ ์ •๋ฆฌ + if (startVideoFocusTimer) { + clearTimeout(startVideoFocusTimer); + startVideoFocusTimer = null; + } + + // ํŒจ๋„์€ ์œ ์ง€ํ•˜๋˜, ๋น„๋””์˜ค ์ค‘์ง€ ์ƒํƒœ๋กœ ์—…๋ฐ์ดํŠธ + dispatch( + updatePanel({ + name: panel_names.PLAYER_PANEL, + panelInfo: { + ...modalPlayerPanel.panelInfo, + shouldStop: true, // ๋น„๋””์˜ค ์ค‘์ง€ ํ”Œ๋ž˜๊ทธ + isPaused: true, // ์ผ์‹œ์ •์ง€ ์ƒํƒœ + isHidden: true, // ํ™”๋ฉด์—์„œ ์ˆจ๊น€ + }, + }) + ); + + // Redux ์ƒํƒœ๋„ ์ค‘์ง€๋กœ ์—…๋ฐ์ดํŠธ + dispatch(setVideoStopped()); + } +}; + +/** + * ํŒจ๋„์„ ๋‹ซ์ง€ ์•Š๊ณ  ์ „์ฒดํ™”๋ฉด ๋น„๋””์˜ค๋งŒ ์ค‘์ง€ํ•ฉ๋‹ˆ๋‹ค. + */ +export const stopFullscreenVideoWithoutClosingPanel = () => (dispatch, getState) => { + const panels = getState().panels.panels; + + // ์ „์ฒดํ™”๋ฉด PlayerPanel ์ฐพ๊ธฐ + const fullscreenPlayerPanel = panels.find( + (panel) => panel.name === panel_names.PLAYER_PANEL && !panel.panelInfo?.modal + ); + + if (fullscreenPlayerPanel) { + console.log('[stopFullscreenVideoWithoutClosingPanel] Stopping fullscreen video playback'); + + // ํƒ€์ด๋จธ ์ •๋ฆฌ + if (startVideoFocusTimer) { + clearTimeout(startVideoFocusTimer); + startVideoFocusTimer = null; + } + + // ํŒจ๋„์€ ์œ ์ง€ํ•˜๋˜, ๋น„๋””์˜ค ์ค‘์ง€ ์ƒํƒœ๋กœ ์—…๋ฐ์ดํŠธ + dispatch( + updatePanel({ + name: panel_names.PLAYER_PANEL, + panelInfo: { + ...fullscreenPlayerPanel.panelInfo, + shouldStop: true, // ๋น„๋””์˜ค ์ค‘์ง€ ํ”Œ๋ž˜๊ทธ + isPaused: true, + isHidden: true, + }, + }) + ); + + // Redux ์ƒํƒœ๋„ ์ค‘์ง€๋กœ ์—…๋ฐ์ดํŠธ + dispatch(setVideoStopped()); + } +}; + +/** + * ๋ชจ๋“  ๋น„๋””์˜ค(๋ชจ๋‹ฌ+์ „์ฒดํ™”๋ฉด)๋ฅผ ํŒจ๋„ ๋‹ซ์ง€ ์•Š๊ณ  ์ค‘์ง€ํ•ฉ๋‹ˆ๋‹ค. + */ +export const stopAllVideosWithoutClosingPanel = () => (dispatch, getState) => { + const panels = getState().panels.panels; + + // ๋ชจ๋“  PlayerPanel ์ฐพ๊ธฐ + const playerPanels = panels.filter((panel) => panel.name === panel_names.PLAYER_PANEL); + + if (playerPanels.length > 0) { + console.log('[stopAllVideosWithoutClosingPanel] Stopping all video playback'); + + // ํƒ€์ด๋จธ ์ •๋ฆฌ + if (startVideoFocusTimer) { + clearTimeout(startVideoFocusTimer); + startVideoFocusTimer = null; + } + + // ๋ชจ๋“  PlayerPanel์„ ์ค‘์ง€ ์ƒํƒœ๋กœ ์—…๋ฐ์ดํŠธ + playerPanels.forEach((playerPanel) => { + dispatch( + updatePanel({ + name: panel_names.PLAYER_PANEL, + panelInfo: { + ...playerPanel.panelInfo, + shouldStop: true, + isPaused: true, + isHidden: true, + }, + }) + ); + }); + + // Redux ์ƒํƒœ๋„ ์ค‘์ง€๋กœ ์—…๋ฐ์ดํŠธ + dispatch(setVideoStopped()); + } +}; + // ๋ชจ๋‹ฌ ๋น„๋””์˜ค๋ฅผ ์ผ์‹œ์ •์ง€ (ํŒจ๋„์€ ์œ ์ง€) export const pauseModalVideo = () => (dispatch, getState) => { const panels = getState().panels.panels; @@ -358,7 +475,7 @@ export const resumeFullscreenVideo = () => (dispatch, getState) => { }; // ๋ชจ๋‹ฌ ๋น„๋””์˜ค๋ฅผ 1px๋กœ ์ถ•์†Œ (๋ฐฐ๋„ˆ ์ •๋ณด ์ €์žฅ) -export const shrinkVideoTo1px = () => (dispatch, getState) => { +export const hideModalVideo = () => (dispatch, getState) => { const panels = getState().panels.panels; // modal PlayerPanel ์ฐพ๊ธฐ @@ -389,7 +506,7 @@ export const shrinkVideoTo1px = () => (dispatch, getState) => { }, }; - // console.log('[HomePanel] shrinkVideoTo1px: saving shrinkInfo', { + // console.log('[HomePanel] hideModalVideo: saving shrinkInfo', { // shrinkInfo: updatedPlayerState.shrinkInfo, // modalStyle: panelInfo.modalStyle, // }); @@ -405,7 +522,7 @@ export const shrinkVideoTo1px = () => (dispatch, getState) => { }) ); } else { - console.log('[HomePanel] shrinkVideoTo1px: No modal PlayerPanel found', { + console.log('[HomePanel] hideModalVideo: No modal PlayerPanel found', { panels: panels.map((p) => ({ name: p.name, modal: p.panelInfo?.modal, @@ -416,7 +533,7 @@ export const shrinkVideoTo1px = () => (dispatch, getState) => { }; // ์ถ•์†Œ๋œ ๋ชจ๋‹ฌ ๋น„๋””์˜ค๋ฅผ ์›๋ž˜ ํฌ๊ธฐ๋กœ ๋ณต๊ตฌ -export const expandVideoFrom1px = () => (dispatch, getState) => { +export const showModalVideo = () => (dispatch, getState) => { const panels = getState().panels.panels; // ์ถ•์†Œ๋œ modal PlayerPanel ์ฐพ๊ธฐ @@ -431,7 +548,7 @@ export const expandVideoFrom1px = () => (dispatch, getState) => { const panelInfo = shrunkModalPlayerPanel.panelInfo; const shrinkInfo = panelInfo.playerState?.shrinkInfo; - // console.log('[HomePanel] expandVideoFrom1px: expanding video', { + // console.log('[HomePanel] showModalVideo: expanding video', { // hasShrinkInfo: !!shrinkInfo, // hasModalStyle: !!shrinkInfo?.modalStyle, // hasModalContainerId: !!shrinkInfo?.modalContainerId, @@ -450,7 +567,7 @@ export const expandVideoFrom1px = () => (dispatch, getState) => { }), }; - // console.log('[HomePanel] expandVideoFrom1px: updated panelInfo shouldShrinkTo1px=false, modalStyle restored, skipModalStyleRecalculation=true'); + // console.log('[HomePanel] showModalVideo: updated panelInfo shouldShrinkTo1px=false, modalStyle restored, skipModalStyleRecalculation=true'); dispatch( updatePanel({ @@ -459,7 +576,7 @@ export const expandVideoFrom1px = () => (dispatch, getState) => { }) ); } else { - console.log('[HomePanel] expandVideoFrom1px: No shrunk modal PlayerPanel found', { + console.log('[HomePanel] showModalVideo: No shrunk modal PlayerPanel found', { panels: panels.map((p) => ({ name: p.name, modal: p.panelInfo?.modal, diff --git a/com.twin.app.shoptime/src/views/DetailPanel/DetailPanel.jsx b/com.twin.app.shoptime/src/views/DetailPanel/DetailPanel.jsx index bea6cd05..24179d29 100644 --- a/com.twin.app.shoptime/src/views/DetailPanel/DetailPanel.jsx +++ b/com.twin.app.shoptime/src/views/DetailPanel/DetailPanel.jsx @@ -28,7 +28,6 @@ import { updatePanel, } from '../../actions/panelActions'; import { - finishVideoPreview, pauseFullscreenVideo, resumeFullscreenVideo, } from '../../actions/playActions'; @@ -170,9 +169,9 @@ export default function DetailPanel({ panelInfo, isOnTop, spotlightId }) { fp.pipe( () => { dispatch(clearAllToasts()); // BuyOption Toast ํฌํ•จ ๋ชจ๋“  ํ† ์ŠคํŠธ ์ œ๊ฑฐ - dispatch(pauseFullscreenVideo()); // PLAYER_PANEL ๋น„๋””์˜ค ์ค‘์ง€ + // dispatch(pauseFullscreenVideo()); // PLAYER_PANEL ๋น„๋””์˜ค ์ค‘์ง€ dispatch(finishModalMediaForce()); // MEDIA_PANEL(ProductVideo) ๊ฐ•์ œ ์ข…๋ฃŒ - dispatch(finishVideoPreview()); + // โœ… [251118] finishVideoPreview() ์ œ๊ฑฐ - PlayerPanel ์œ ์ง€ํ•˜๊ธฐ ์œ„ํ•จ dispatch(popPanel(panel_names.DETAIL_PANEL)); }, () => { diff --git a/com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx b/com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx index 1730e736..aeedba62 100644 --- a/com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx +++ b/com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx @@ -22,7 +22,7 @@ import { finishVideoPreview, startVideoPlayer, startVideoPlayerNew, - shrinkVideoTo1px, + hideModalVideo, } from '../../../actions/playActions'; import CustomImage from '../../../components/CustomImage/CustomImage'; import usePriceInfo from '../../../hooks/usePriceInfo'; @@ -324,7 +324,7 @@ export default function RandomUnit({ videoPlayerable, currentVideoBannerId, }); - dispatch(shrinkVideoTo1px()); + dispatch(hideModalVideo()); } if (handleItemFocus) { @@ -346,7 +346,7 @@ export default function RandomUnit({ // ํ˜„์žฌ ๋น„๋””์˜ค๊ฐ€ ์žฌ์ƒ ์ค‘์ด๋ฉด 1px๋กœ ์ถ•์†Œ (์ฃผ์„: HomePanel ์Šคํฌ๋กค๋กœ ์ฒ˜๋ฆฌ) // if (currentVideoBannerId && videoPlayerable) { // console.log('[RandomUnit] onBlur: shrinking video to 1px'); - // dispatch(shrinkVideoTo1px()); + // dispatch(hideModalVideo()); // } // dispatch(finishVideoPreview()); diff --git a/com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx b/com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx index be432816..e1baa11c 100644 --- a/com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx +++ b/com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx @@ -29,9 +29,9 @@ import { getSubCategory, getTop20Show } from '../../actions/mainActions'; import { getHomeOnSaleInfo } from '../../actions/onSaleActions'; import { updatePanel } from '../../actions/panelActions'; import { - expandVideoFrom1px, + showModalVideo, finishVideoPreview, - shrinkVideoTo1px, + hideModalVideo, startVideoPlayerNew, } from '../../actions/playActions'; import { getBestSeller } from '../../actions/productActions'; @@ -497,7 +497,7 @@ const HomePanel = ({ isOnTop }) => { } // console.log('[HomePanel] Expansion attempt', expandAttemptRef.current + 1); - dispatch(expandVideoFrom1px()); + dispatch(showModalVideo()); expandAttemptRef.current++; }, 200); } @@ -514,7 +514,7 @@ const HomePanel = ({ isOnTop }) => { // ์•„๋ž˜๋กœ ์Šคํฌ๋กค: ๋น„๋””์˜ค๋ฅผ 1px๋กœ ์ถ•์†Œ // console.log('[HomePanel] Scrolling down - shrinking video'); if (!isVideoTransitionLocked) { - dispatch(shrinkVideoTo1px()); + dispatch(hideModalVideo()); } // ๊ธฐ์กด ํƒ€์ด๋จธ ์ทจ์†Œ if (scrollExpandTimerRef.current) { @@ -533,7 +533,7 @@ const HomePanel = ({ isOnTop }) => { // 1์ดˆ ํ›„ ์ž๋™์œผ๋กœ ํฌ๊ธฐ ์กฐ์ • scrollExpandTimerRef.current = setTimeout(() => { // console.log('[HomePanel] 1s passed - auto expanding video'); - dispatch(expandVideoFrom1px()); + dispatch(showModalVideo()); scrollExpandTimerRef.current = null; }, 1000); } @@ -705,6 +705,22 @@ const HomePanel = ({ isOnTop }) => { panels.map((p) => ({ name: p.name, modal: p.panelInfo?.modal })) ); + // โœ… [251118] ํ˜„์žฌ ์žฌ์ƒ ์ค‘์ธ ๋น„๋””์˜ค ์ •๋ณด ์ƒ์„ธ ๋กœ๊ทธ + const playerPanel = panels.find((p) => p.name === panel_names.PLAYER_PANEL); + if (playerPanel) { + console.log('[HomeActive] ๐ŸŽฌ PlayerPanel ์ •๋ณด:', { + modal: playerPanel.panelInfo?.modal, + shouldShrinkTo1px: playerPanel.panelInfo?.shouldShrinkTo1px, + currentBannerId: playerPanel.panelInfo?.playerState?.currentBannerId, + bannerId: playerPanel.panelInfo?.bannerId, + showUrl: playerPanel.panelInfo?.showUrl?.substring(0, 50), + patnrId: playerPanel.panelInfo?.patnrId, + showId: playerPanel.panelInfo?.showId, + }); + } else { + console.log('[HomeActive] โŒ PlayerPanel์„ ์ฐพ์„ ์ˆ˜ ์—†์Œ'); + } + const isHomePanelActive = isOnTop; console.log('[HomeActive] isHomePanelActive:', isHomePanelActive); @@ -756,7 +772,7 @@ const HomePanel = ({ isOnTop }) => { // ์žฌ์ƒ ๊ธฐ๋ก ์—…๋ฐ์ดํŠธ lastPlayedBannerIdRef.current = bannerId; console.log('[HomeActive] ์žฌ์ƒ ๊ธฐ๋ก ์—…๋ฐ์ดํŠธ:', bannerId); - }, [isOnTop, dispatch]); + }, [isOnTop, dispatch, panels]); // โœ… [251118] DetailPanel ๋‹ซํž˜ ๊ฐ์ง€ useEffect const detailPanelClosedTime = useSelector( @@ -770,8 +786,99 @@ const HomePanel = ({ isOnTop }) => { console.log('[HomePanel] isOnTop:', isOnTop); console.log('[HomePanel] videoPlayIntentRef.current:', videoPlayIntentRef.current); console.log('[HomePanel] lastPlayedBannerIdRef.current:', lastPlayedBannerIdRef.current); + + // โœ… [ํ•ต์‹ฌ] videoPlayIntentRef.current.videoProps๊ฐ€ ์žˆ์œผ๋ฉด ๋น„๋””์˜ค ์žฌ์ƒ + if (videoPlayIntentRef.current?.videoProps) { + const videoProps = videoPlayIntentRef.current.videoProps; + const bannerId = videoPlayIntentRef.current.bannerId; + + console.log('[HomePanel] ๋น„๋””์˜ค ์žฌ์ƒ ์ •๋ณด ์žˆ์Œ:', { + bannerId, + showUrl: videoProps.showUrl, + patnrId: videoProps.patnrId, + showId: videoProps.showId, + }); + + // โœ… ์ค‘๋ณต ์ฒดํฌ ์šฐํšŒ๋ฅผ ์œ„ํ•ด ref ์ดˆ๊ธฐํ™” + lastPlayedBannerIdRef.current = null; + + // โœ… scrollTop ์ƒํƒœ ํ™•์ธ (0์ด๋ฉด normal, ์•„๋‹ˆ๋ฉด 1px๋กœ ์ถ•์†Œ) + const currentScrollTop = prevScrollTopRef.current; + console.log('[HomePanel] ํ˜„์žฌ scrollTop:', currentScrollTop); + + // modalContainerId ๋ณ€๊ฒฝ์œผ๋กœ ์ค‘๋ณต ์ฒดํฌ ์šฐํšŒ + const modifiedVideoProps = { + ...videoProps, + modalContainerId: 'banner-modal-' + bannerId, + }; + + console.log('[HomePanel] dispatch(startVideoPlayerNew) ํ˜ธ์ถœ:', modifiedVideoProps); + dispatch(startVideoPlayerNew(modifiedVideoProps)); + } else { + console.log('[HomePanel] โŒ videoProps๊ฐ€ ์—†์–ด์„œ ๋น„๋””์˜ค ์žฌ์ƒ ๋ถˆ๊ฐ€'); + } } - }, [detailPanelClosedTime, isOnTop]); + }, [detailPanelClosedTime, isOnTop, dispatch]); + + // โœ… [251118] DetailPanel ๋ณต๊ท€ ํ›„ ๋น„๋””์˜ค ํฌ๊ธฐ ์ž๋™ ์กฐ์ • + useEffect(() => { + // โœ… [251118] videoProps๊ฐ€ ์—†์œผ๋ฉด PlayerPanel์—์„œ ์ง์ ‘ ์ฝ๊ธฐ + const hasVideoInfo = videoPlayIntentRef.current?.videoProps || + (panels.find((p) => p.name === panel_names.PLAYER_PANEL)?.panelInfo?.modal); + + if (detailPanelClosedTime && isOnTop && hasVideoInfo) { + console.log('[HomePanel] ๋น„๋””์˜ค ํฌ๊ธฐ ์กฐ์ • ํƒ€์ด๋จธ ์‹œ์ž‘...'); + console.log('[HomePanel] videoProps ์—ฌ๋ถ€:', !!videoPlayIntentRef.current?.videoProps); + + // ์•ฝ๊ฐ„์˜ ์ง€์—ฐ ํ›„ ๋น„๋””์˜ค ์ƒํƒœ ํ™•์ธ (์žฌ์ƒ์ด ์™„๋ฃŒ๋œ ํ›„) + const timer = setTimeout(() => { + const currentScrollTop = prevScrollTopRef.current; + const playerPanelInfo = panels.find((p) => p.name === panel_names.PLAYER_PANEL); + const shouldShrink = playerPanelInfo?.panelInfo?.shouldShrinkTo1px; + + // โœ… [251118] ๋” ์ž์„ธํ•œ ๋กœ๊ทธ ์ถ”๊ฐ€ + console.log('[HomePanel] ๋น„๋””์˜ค ํฌ๊ธฐ ์กฐ์ • ์ฒดํฌ:', { + currentScrollTop, + shouldShrink, + bannerId: videoPlayIntentRef.current?.bannerId, + playerPanelExists: !!playerPanelInfo, + }); + + console.log('[HomePanel] ๐Ÿ“Š PlayerPanel ์ „์ฒด ์ •๋ณด:', { + hasPlayerPanel: !!playerPanelInfo, + modal: playerPanelInfo?.panelInfo?.modal, + shouldShrinkTo1px: playerPanelInfo?.panelInfo?.shouldShrinkTo1px, + currentBannerId: playerPanelInfo?.panelInfo?.playerState?.currentBannerId, + panelName: playerPanelInfo?.name, + }); + + console.log('[HomePanel] ๐Ÿ“ Ref ์ •๋ณด:', { + prevScrollTopRef: prevScrollTopRef.current, + shouldShrinkRef: shouldShrinkRef.current, + videoPlayIntentRef: videoPlayIntentRef.current?.bannerId, + }); + + if (currentScrollTop <= 1 && shouldShrink) { + // scrollTop = 0์ด๊ณ  ํ˜„์žฌ 1px ์ƒํƒœ๋ฉด โ†’ ํ™•๋Œ€ + console.log('[HomePanel] โ–ฒ ๋น„๋””์˜ค ํ™•๋Œ€ (scrollTop <= 1 && shouldShrink)'); + dispatch(showModalVideo()); + } else if (currentScrollTop > 1 && !shouldShrink) { + // scrollTop > 0์ด๊ณ  normal size๋ฉด โ†’ ์ถ•์†Œ + console.log('[HomePanel] โ–ผ ๋น„๋””์˜ค ์ถ•์†Œ (scrollTop > 1 && !shouldShrink)'); + dispatch(hideModalVideo()); + } else { + console.log('[HomePanel] โš ๏ธ ๋น„๋””์˜ค ํฌ๊ธฐ ์กฐ์ • ๋ถˆํ•„์š”', { + reason: currentScrollTop <= 1 && !shouldShrink ? 'scrollTop ์ตœ์ƒ๋‹จ์ด๊ณ  ์ด๋ฏธ normal size' : + currentScrollTop > 1 && shouldShrink ? 'scrollTop > 1์ด๊ณ  ์ด๋ฏธ 1px ์ƒํƒœ' : '๊ธฐํƒ€', + condition1: `currentScrollTop <= 1: ${currentScrollTop <= 1}`, + condition2: `shouldShrink: ${shouldShrink}`, + }); + } + }, 500); // ๋น„๋””์˜ค ์žฌ์ƒ ์™„๋ฃŒ ๋Œ€๊ธฐ + + return () => clearTimeout(timer); + } + }, [detailPanelClosedTime, isOnTop, dispatch, panels]); useEffect(() => { return () => {