perf(map): stabilize real-data map rendering#10
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 44 minutes and 13 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 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough이 PR은 피드 목록을 무한스크롤로 전환하고, 맵에 튜토리얼 오버레이 및 마커 시각 모드를 추가하며, 시뮬레이션을 증분 청크 로딩 방식으로 개선합니다. API 인증 처리를 유연화하고 보호 라우트를 축소합니다. Changes피드, 맵, 시뮬레이션 통합 개선
🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
src/features/feed/ui/FeedBottomSheet.tsx (1)
91-100: 💤 Low value
pageSize가feedListParams의 메모 의존성에 포함되어 있어,initialItems.length가 변경될 때마다 쿼리 키가 변경됩니다.
initialItems가 맵 뷰포트에서 제공될 경우, 길이가 자주 변할 수 있으며 이로 인해 불필요한 쿼리 재실행이 발생할 수 있습니다.size파라미터를 고정값으로 분리하거나, 쿼리 키에서size를 제외하는 것을 고려해볼 수 있습니다.🤖 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/FeedBottomSheet.tsx` around lines 91 - 100, The memo for feedListParams includes pageSize in its dependency array which causes the query key to change when initialItems.length varies; update feedListParams (the useMemo block that defines feedListParams) to remove pageSize from the dependency array and instead supply a fixed size value (e.g., a constant or a separate constant variable) for the size property so that changes to initialItems.length don't retrigger the memo/queries — adjust only the dependencies and the size assignment in feedListParams, leaving feedType and categories dependencies intact.src/features/simulation/model/use-sim-run.ts (1)
298-352: 💤 Low valuelifecycle 이벤트 순회 시 성능 고려.
findNextActivityTick에서lifecycleByTickRef.current.keys()를 순회하면서 다음 활성 tick을 찾고 있습니다. lifecycle 이벤트가 많을 경우 매 quiet period마다 O(lifecycle_events) 비용이 발생합니다.현재 구현에서는 quiet period에만 호출되므로 실제 부하는 제한적이지만, 이벤트 수가 많아지면 정렬된 tick 배열을 캐시하고 이진 탐색을 사용하는 것이 효율적일 수 있습니다.
🤖 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/simulation/model/use-sim-run.ts` around lines 298 - 352, findNextActivityTick currently scans lifecycleByTickRef.current.keys() linearly causing O(n) work each quiet-period; fix by maintaining a cached sorted array of lifecycle ticks (e.g. lifecycleTicksCache) and use binary search to find the first tick > tFloat inside findNextActivityTick, and update/invalidate the cache whenever lifecycleByTickRef is mutated (ensure cache is refreshed where lifecycle events are added/removed). Update references in maybeSkipEmptyEventTicks to rely on the new binary-search-backed findNextActivityTick so quiet-period checks become O(log n).
🤖 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 119-123: The current setPromotedCount(safePromoted + 1) call in
MapFeedCardPager is using a stale render-time value (safePromoted) and can drop
increments under rapid interactions; change it to use a functional state update
(e.g., setPromotedCount(prev => prev + 1)) so increments are accumulated
reliably, and apply the same fix to the other occurrence around the
onTutorialCardPromote branch (the block that checks overflowItem and the similar
block at 131-134) to ensure consecutive taps/swipes are not lost.
In `@src/features/map/ui/MapTutorialOverlay.tsx`:
- Around line 89-94: The current logic around safeIndex/step assumes steps is
non-empty and will set step to undefined for an empty steps array causing
runtime errors; modify the top of the MapTutorialOverlay render (or the
component body where safeIndex/step are computed) to early-return (e.g., return
null or a no-op UI) when steps.length === 0 so you never compute safeIndex or
access step.id; keep the rest of the logic (safeIndex, isFirst, isLast,
showSelectedMarker) unchanged and only run it after confirming steps is
non-empty.
---
Nitpick comments:
In `@src/features/feed/ui/FeedBottomSheet.tsx`:
- Around line 91-100: The memo for feedListParams includes pageSize in its
dependency array which causes the query key to change when initialItems.length
varies; update feedListParams (the useMemo block that defines feedListParams) to
remove pageSize from the dependency array and instead supply a fixed size value
(e.g., a constant or a separate constant variable) for the size property so that
changes to initialItems.length don't retrigger the memo/queries — adjust only
the dependencies and the size assignment in feedListParams, leaving feedType and
categories dependencies intact.
In `@src/features/simulation/model/use-sim-run.ts`:
- Around line 298-352: findNextActivityTick currently scans
lifecycleByTickRef.current.keys() linearly causing O(n) work each quiet-period;
fix by maintaining a cached sorted array of lifecycle ticks (e.g.
lifecycleTicksCache) and use binary search to find the first tick > tFloat
inside findNextActivityTick, and update/invalidate the cache whenever
lifecycleByTickRef is mutated (ensure cache is refreshed where lifecycle events
are added/removed). Update references in maybeSkipEmptyEventTicks to rely on the
new binary-search-backed findNextActivityTick so quiet-period checks become
O(log n).
🪄 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: 46abf6a2-4814-47ab-b3fa-c92a4a179dd8
📒 Files selected for processing (25)
src/features/feed/api/feed-api.tssrc/features/feed/api/feed-server-api.tssrc/features/feed/model/map-feed-card-pager.test.tssrc/features/feed/model/map-feed-card-pager.tssrc/features/feed/model/use-feed.tssrc/features/feed/ui/FeedBottomSheet.tsxsrc/features/feed/ui/MapFeedCardPager.tsxsrc/features/feed/ui/detail/FeedParticipationActions.test.tsxsrc/features/feed/ui/detail/FeedParticipationActions.tsxsrc/features/map/client/MapClient.tsxsrc/features/map/model/marker-visual-mode.test.tssrc/features/map/model/marker-visual-mode.tssrc/features/map/ui/ClusterBlob.tsxsrc/features/map/ui/MapFooter.tsxsrc/features/map/ui/MapTutorialOverlay.tsxsrc/features/map/ui/MapV3Canvas.tsxsrc/features/pay/model/use-pay.tssrc/features/simulation/api/sim-api.tssrc/features/simulation/model/sim-clock.test.tssrc/features/simulation/model/sim-clock.tssrc/features/simulation/model/sim-domain-adapter.tssrc/features/simulation/model/use-sim-run.tssrc/lib/client-api.test.tssrc/lib/client-api.tssrc/proxy.ts
Summary
Test Plan
pnpm test -- src/features/feed/model/map-feed-card-pager.test.ts src/features/map/model/marker-visual-mode.test.ts src/features/simulation/model/sim-clock.test.tspnpm lint— passes with existing warnings onlypnpm buildNotes
Summary by CodeRabbit
릴리스 노트
새로운 기능
개선 사항