feat: 햅틱 적용#878
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
둘러보기RatingRangeSlider 컴포넌트에 드래그 제스처 중 햅틱 피드백을 추가했습니다. LocalView를 통해 뷰에 접근하고, 각 엄지손가락의 마지막 스냅 값을 추적한 후, 스냅 값이 변경될 때만 CLOCK_TICK 피드백을 트리거합니다. 변경 사항별점 슬라이더 햅틱 피드백
🎯 2 (Simple) | ⏱️ ~10 minutes
🚥 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 docstrings
🧪 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: 1
🧹 Nitpick comments (1)
app/src/main/java/com/into/websoso/ui/detailExplore/component/RatingRangeSlider.kt (1)
111-116: 💤 Low value중복 계산 제거를 고려하세요.
스냅된 값이 두 번 계산됩니다(햅틱 체크용,
onValueChange호출용). 변수에 저장하여 재사용하면 코드가 더 명확해집니다.♻️ 리팩토링 제안
onDrag = { change, _ -> change.consume() val newValue = valueAtX(change.position.x) if (activeThumb == 1) { val snapped = newValue.coerceAtMost(latestMax) if (snapped != lastMinSnapped) { view.performHapticFeedback(HapticFeedbackConstants.CLOCK_TICK) lastMinSnapped = snapped } - onValueChange(newValue.coerceAtMost(latestMax), latestMax) + onValueChange(snapped, latestMax) } else { val snapped = newValue.coerceAtLeast(latestMin) if (snapped != lastMaxSnapped) { view.performHapticFeedback(HapticFeedbackConstants.CLOCK_TICK) lastMaxSnapped = snapped } - onValueChange(latestMin, newValue.coerceAtLeast(latestMin)) + onValueChange(latestMin, snapped) } },Also applies to: 118-123
🤖 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 `@app/src/main/java/com/into/websoso/ui/detailExplore/component/RatingRangeSlider.kt` around lines 111 - 116, Avoid computing the snapped value twice: compute snapped = newValue.coerceAtMost(latestMax) once, reuse that variable for the haptic check (compare with lastMinSnapped and call view.performHapticFeedback) and pass the same snapped to onValueChange instead of recomputing; update lastMinSnapped when needed. Apply the same change to the analogous block that references lastMaxSnapped/onValueChange for lines 118-123.
🤖 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
`@app/src/main/java/com/into/websoso/ui/detailExplore/component/RatingRangeSlider.kt`:
- Around line 68-70: The haptic false-positive occurs because
lastMinSnapped/lastMaxSnapped retain previous values across external prop
updates; update onDragStart in RatingRangeSlider to reset lastMinSnapped = min
and lastMaxSnapped = max (use the current min/max props) so the first onDrag
compares against the current positions and only triggers haptics when a real
snap crossing occurs.
---
Nitpick comments:
In
`@app/src/main/java/com/into/websoso/ui/detailExplore/component/RatingRangeSlider.kt`:
- Around line 111-116: Avoid computing the snapped value twice: compute snapped
= newValue.coerceAtMost(latestMax) once, reuse that variable for the haptic
check (compare with lastMinSnapped and call view.performHapticFeedback) and pass
the same snapped to onValueChange instead of recomputing; update lastMinSnapped
when needed. Apply the same change to the analogous block that references
lastMaxSnapped/onValueChange for lines 118-123.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c26e2b85-42d1-45f7-999b-4be9bfdfdb5c
📒 Files selected for processing (1)
app/src/main/java/com/into/websoso/ui/detailExplore/component/RatingRangeSlider.kt
devfeijoa
left a comment
There was a problem hiding this comment.
수고하셨습니다 ! 토끼 리뷰 밑에 리뷰 달아둔것만 확인 부탁드립니다!
📌𝘐𝘴𝘴𝘶𝘦𝘴
📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯
📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵
💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴
별점 슬라이더에 햅틱 추가했습니다. 딱히 강도에 대한 이야기는 없어서 가장 대중적으로 사용되는 거 같은 햅틱으로 넣었습니다.
Summary by CodeRabbit