Skip to content

fix: prevent map card deck close jitter#13

Merged
seoJing merged 2 commits into
mainfrom
fix/map-card-deck-jitter
May 31, 2026
Merged

fix: prevent map card deck close jitter#13
seoJing merged 2 commits into
mainfrom
fix/map-card-deck-jitter

Conversation

@seoJing
Copy link
Copy Markdown
Member

@seoJing seoJing commented May 31, 2026

Summary

  • keep the bottom map feed pager mounted and hide it while marker card decks are open
  • immediately hide/reset the pager when marker or cluster selection begins instead of waiting for URL state
  • prevent marker card deck close from briefly re-showing visible cards before the parent unmounts
  • lock bottom deck interactions until reset exit animation completes

Test Plan

  • pnpm lint
  • pnpm build
  • browser: /map marker card open -> close; URL returns to /map, marker card closes, bottom pager remains available, no console errors
  • notjing final gate: pass

Notes

  • Temporary deck debug logging was removed before commit.

Summary by CodeRabbit

릴리스 노트

  • 개선사항
    • 지도의 마커 덱이 열렸을 때 카드 페이저가 자동으로 숨겨지도록 개선되었습니다.
    • 카드 스택 상호작용의 안정성이 개선되었으며, 애니메이션 타이밍에 맞춰 사용자 입력이 보다 정확하게 처리됩니다.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontend Ready Ready Preview, Comment May 31, 2026 12:14pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 31, 2026

Review Change Stack

Warning

Review limit reached

@seoJing, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 50 minutes and 3 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f7c72765-929e-4778-9055-2cc079313a56

📥 Commits

Reviewing files that changed from the base of the PR and between ee40a14 and a380c2e.

📒 Files selected for processing (1)
  • src/features/feed/ui/MapFeedCardPager.tsx
📝 Walkthrough

Walkthrough

MapFeedCardPager에 hidden 속성을 추가하여 리셋 타이밍 동안 상호작용을 잠금으로써 애니메이션 이슈를 해결했으며, MapClient에서 마커 덱 열림 상태를 반영한 통합 숨김 조건으로 페이저 렌더링을 변경하고 마커 선택 시 페이저 상태를 초기화합니다.

Changes

카드 페이저 숨김 제어 및 리셋 타이밍 개선

Layer / File(s) Summary
MapFeedCardPager 숨김 속성 정의
src/features/feed/ui/MapFeedCardPager.tsx
hidden?: boolean prop을 추가하고 기본값 false를 설정하며, useCallback과 useEffect import를 포함합니다.
리셋 중 상호작용 잠금 상태 및 로직
src/features/feed/ui/MapFeedCardPager.tsx
previousSafePromoted, resetToPeekTimerRef, isResettingToPeek 상태를 도입하고, clearResetToPeekTimer, finishResetToPeek, holdStackUntilResetExitCompletes 콜백과 safePromoted 변화를 감시하는 useEffect를 구현합니다.
리셋 동작 및 상호작용 핸들러 수정
src/features/feed/ui/MapFeedCardPager.tsx
resetToPeek에서 holdStackUntilResetExitCompletes를 호출하도록 변경하고, handleStackClick에서 isStackInteractionLocked 체크를 추가합니다.
카드 덱 시각 제어 및 애니메이션 동기화
src/features/feed/ui/MapFeedCardPager.tsx
hidden 및 isStackInteractionLocked 상태에 따라 카드 덱에 opacity-0과 pointer-events-none을 적용하고, AnimatePresence의 onExitComplete에서 finishResetToPeek()를 호출해 리셋 완료를 동기화합니다.
MapClient 페이저 숨김 조건 통합 및 렌더링 변경
src/features/map/client/MapClient.tsx
isFeedPagerHidden 파생값으로 마커 덱 열림 상태와 기존 숨김 상태를 통합하고, MapFeedCardPager를 항상 렌더링하되 hidden prop으로 숨김을 제어합니다.
마커 선택 시 페이저 상태 초기화
src/features/map/client/MapClient.tsx
클러스터 및 피드 마커 선택 핸들러에서 페이저 숨김, 스냅 리셋, promoted 카운트 초기화를 추가합니다.
useEffect cleanup 정정 및 MapCardDeckOverlay 조정
src/features/map/client/MapClient.tsx, src/features/map/ui/MapCardDeckOverlay.tsx
revealTimer clearTimeout을 cleanup 함수로 래핑하고, MapCardDeckOverlay의 onExitComplete에서 isClosingDeck 상태 갱신을 제거합니다.

Sequence Diagram

sequenceDiagram
  participant User
  participant MapClient
  participant MapFeedCardPager
  participant AnimatePresence

  User->>MapClient: 마커 선택
  MapClient->>MapClient: isFeedPagerHidden = true
  MapClient->>MapClient: setIsPagerHiddenByMarkerDeck(true)
  MapClient->>MapClient: setPagerSnap('peek')
  MapClient->>MapClient: setPagerPromotedCount(0)
  MapClient->>MapFeedCardPager: hidden={true}

  MapFeedCardPager->>MapFeedCardPager: 상태 변화 감지 (safePromoted=0)
  MapFeedCardPager->>MapFeedCardPager: holdStackUntilResetExitCompletes() 호출
  MapFeedCardPager->>MapFeedCardPager: isStackInteractionLocked=true
  MapFeedCardPager->>MapFeedCardPager: opacity-0 적용

  MapFeedCardPager->>AnimatePresence: 애니메이션 시작
  AnimatePresence->>AnimatePresence: 애니메이션 재생
  AnimatePresence->>MapFeedCardPager: onExitComplete 콜백
  MapFeedCardPager->>MapFeedCardPager: finishResetToPeek() 호출
  MapFeedCardPager->>MapFeedCardPager: isStackInteractionLocked=false
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • spot-platform/frontend#2: MapFeedCardPager의 peek/exit 타이밍 및 resetToPeek 관련 애니메이션 로직 전환이 직접 맞닿아 있습니다.
  • spot-platform/frontend#12: MapClient에서 isPagerHiddenByMarkerDeck 기반 페이저 숨김 조건이 동일하게 재구성되어 있습니다.
  • spot-platform/frontend#11: MapClient의 마커 덱 숨김 제어 로직이 MapFeedCardPager 및 덱 오버레이 동작과 직접 연결됩니다.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 변경의 주요 목적을 명확하게 요약하고 있으며, 실제 변경 내용과 일치합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/map-card-deck-jitter

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/features/feed/ui/MapFeedCardPager.tsx (1)

167-172: 💤 Low value

의존성 배열에 불필요한 promotedCount 포함

safePromotedpromotedCount로부터 파생된 값이므로, 이 effect의 의존성 배열에 promotedCount를 별도로 추가할 필요가 없습니다. 제거하면 의도가 더 명확해지고, 불필요한 effect 재실행을 피할 수 있습니다.

♻️ 제안된 수정
 }, [
     safePromoted,
     clearResetToPeekTimer,
     holdStackUntilResetExitCompletes,
-    promotedCount,
 ]);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/features/feed/ui/MapFeedCardPager.tsx` around lines 167 - 172, The
effect's dependency array includes promotedCount redundantly because
safePromoted is already derived from promotedCount; remove promotedCount from
the dependencies so the useEffect depending on safePromoted,
clearResetToPeekTimer, and holdStackUntilResetExitCompletes does not re-run
unnecessarily. Update the dependency array in the useEffect that currently lists
safePromoted, clearResetToPeekTimer, holdStackUntilResetExitCompletes,
promotedCount to omit promotedCount and keep the other three symbols only.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/features/feed/ui/MapFeedCardPager.tsx`:
- Around line 310-313: The top deck wrapper in MapFeedCardPager.tsx uses only
opacity-0 when hidden, so descendant cards with pointer-events-auto (e.g., cards
rendered with isTop) can still receive events; update the wrapper div (the class
that uses the hidden variable) to also include pointer-events-none when hidden,
or alternatively make the per-card class conditional so pointer-events-auto is
only applied when isTop AND the parent is not hidden—refer to the hidden
variable, the wrapper div class, and the isTop/card rendering that adds
pointer-events-auto to locate and fix the code.

---

Nitpick comments:
In `@src/features/feed/ui/MapFeedCardPager.tsx`:
- Around line 167-172: The effect's dependency array includes promotedCount
redundantly because safePromoted is already derived from promotedCount; remove
promotedCount from the dependencies so the useEffect depending on safePromoted,
clearResetToPeekTimer, and holdStackUntilResetExitCompletes does not re-run
unnecessarily. Update the dependency array in the useEffect that currently lists
safePromoted, clearResetToPeekTimer, holdStackUntilResetExitCompletes,
promotedCount to omit promotedCount and keep the other three symbols only.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d16ff0a2-31ac-45f3-b8f1-e262c1084032

📥 Commits

Reviewing files that changed from the base of the PR and between a8b7e97 and ee40a14.

📒 Files selected for processing (3)
  • src/features/feed/ui/MapFeedCardPager.tsx
  • src/features/map/client/MapClient.tsx
  • src/features/map/ui/MapCardDeckOverlay.tsx

Comment thread src/features/feed/ui/MapFeedCardPager.tsx
@seoJing seoJing merged commit 368ff5e into main May 31, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant