Conversation
Walkthrough모바일 키워드 댓글 바텀시트의 기준 높이를 80vh에서 70vh로 줄이고, 드래그 훅에 sheetHeight 인자를 추가해 닫기 임계값을 계산하도록 변경했으며, 터치 드래그 중 기본 스크롤을 막는 로직과 푸터 이메일 주소를 수정했습니다. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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.
🧹 Nitpick comments (1)
src/app/(main)/teampsylog/_components/BottomComment.tsx (1)
41-42: 시트 높이 변경에 맞춰 드래그 임계값도 비율 기반으로 맞추는 것을 권장합니다.Line 41-42를
70vh로 낮춘 상태에서, 닫힘 임계값은src/app/(main)/teampsylog/_components/useBottomSheetDrag.ts의 Line 49/75에서 여전히 고정150px입니다. 기기 높이에 따라 닫힘 감도가 달라질 수 있어sheetHeight * ratio형태로 연동하면 UX가 더 안정적입니다.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/app/`(main)/teampsylog/_components/BottomComment.tsx around lines 41 - 42, The sheet close threshold is still a fixed 150px in useBottomSheetDrag (refer to the drag handling logic / threshold calculations) so when BottomComment's height was reduced to '70vh' the sensitivity breaks; change the hardcoded 150px to a computed value based on the current sheetHeight (e.g., const closeThreshold = sheetHeight * CLOSE_RATIO) and use that computed closeThreshold wherever the code currently compares against 150 (look for functions/variables like useBottomSheetDrag, onDragEnd/onDragRelease, or closeThreshold) so the drag-to-close sensitivity scales with the sheet's vh height.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/app/`(main)/teampsylog/_components/BottomComment.tsx:
- Around line 41-42: The sheet close threshold is still a fixed 150px in
useBottomSheetDrag (refer to the drag handling logic / threshold calculations)
so when BottomComment's height was reduced to '70vh' the sensitivity breaks;
change the hardcoded 150px to a computed value based on the current sheetHeight
(e.g., const closeThreshold = sheetHeight * CLOSE_RATIO) and use that computed
closeThreshold wherever the code currently compares against 150 (look for
functions/variables like useBottomSheetDrag, onDragEnd/onDragRelease, or
closeThreshold) so the drag-to-close sensitivity scales with the sheet's vh
height.
ℹ️ Review info
Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3ebbec55-e70b-41d5-82f0-6c5099ecc2ee
📒 Files selected for processing (3)
src/app/(main)/teampsylog/_components/BottomComment.tsxsrc/app/(main)/teampsylog/_components/useBottomSheetDrag.tssrc/components/common/Footer.tsx
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/app/(main)/teampsylog/_components/useBottomSheetDrag.ts (1)
11-11: 닫힘 임계 비율(0.24)은 이름 있는 상수로 분리하면 더 읽기 쉽습니다.Line 11의 매직넘버는 조정 시 의도 파악이 어렵습니다.
제안 diff
- const closeThreshold = sheetHeight * 0.24; + const CLOSE_THRESHOLD_RATIO = 0.24; + const closeThreshold = sheetHeight * CLOSE_THRESHOLD_RATIO;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/app/`(main)/teampsylog/_components/useBottomSheetDrag.ts at line 11, Extract the magic number 0.24 into a named constant (e.g., CLOSE_THRESHOLD_RATIO) near the top of useBottomSheetDrag or the surrounding module and replace the inline literal in the computation of closeThreshold (const closeThreshold = sheetHeight * 0.24) with sheetHeight * CLOSE_THRESHOLD_RATIO; update any related comments or tests to reference the new constant so the intention is clear and easy to adjust.src/app/(main)/teampsylog/_components/BottomComment.tsx (1)
13-14: 높이 비율 상수를 한 곳에서 관리해 주세요.Line 13의
0.7과 Line 43-44의'70vh'가 분리되어 있어, 다음 조정 때 시트 높이와 닫힘 임계값이 어긋날 수 있습니다.제안 diff
const BottomComment = ({ isOpen, onClose, children }: BottomSheetProps) => { - const sheetHeight = Math.round(typeof window !== 'undefined' ? window.innerHeight * 0.7 : 500); + const SHEET_HEIGHT_VH = 70; + const sheetHeight = Math.round( + typeof window !== 'undefined' ? window.innerHeight * (SHEET_HEIGHT_VH / 100) : 500, + ); const { @@ <div className="desktop:hidden fixed inset-x-0 bottom-0 z-50 rounded-t-2xl bg-gray-200" style={{ - height: '70vh', - maxHeight: '70vh', + height: `${SHEET_HEIGHT_VH}vh`, + maxHeight: `${SHEET_HEIGHT_VH}vh`,Also applies to: 43-44
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/app/`(main)/teampsylog/_components/BottomComment.tsx around lines 13 - 14, Define a single height ratio constant (e.g., SHEET_HEIGHT_RATIO = 0.7) at the top of the BottomComment component and replace the hardcoded 0.7 used in sheetHeight and the '70vh' literal used for the close threshold with references to that constant (use arithmetic or string interpolation like `${SHEET_HEIGHT_RATIO * 100}vh` or compute pixel values from window.innerHeight) so both sheetHeight and the close threshold stay in sync; update usages in BottomComment (sheetHeight and the close-threshold/height string) accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/app/`(main)/teampsylog/_components/BottomComment.tsx:
- Around line 13-14: Define a single height ratio constant (e.g.,
SHEET_HEIGHT_RATIO = 0.7) at the top of the BottomComment component and replace
the hardcoded 0.7 used in sheetHeight and the '70vh' literal used for the close
threshold with references to that constant (use arithmetic or string
interpolation like `${SHEET_HEIGHT_RATIO * 100}vh` or compute pixel values from
window.innerHeight) so both sheetHeight and the close threshold stay in sync;
update usages in BottomComment (sheetHeight and the close-threshold/height
string) accordingly.
In `@src/app/`(main)/teampsylog/_components/useBottomSheetDrag.ts:
- Line 11: Extract the magic number 0.24 into a named constant (e.g.,
CLOSE_THRESHOLD_RATIO) near the top of useBottomSheetDrag or the surrounding
module and replace the inline literal in the computation of closeThreshold
(const closeThreshold = sheetHeight * 0.24) with sheetHeight *
CLOSE_THRESHOLD_RATIO; update any related comments or tests to reference the new
constant so the intention is clear and easy to adjust.
ℹ️ Review info
Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 46d5af4e-9fdf-49c7-89eb-38f4626cab39
📒 Files selected for processing (2)
src/app/(main)/teampsylog/_components/BottomComment.tsxsrc/app/(main)/teampsylog/_components/useBottomSheetDrag.ts
✅ PR 유형
어떤 변경 사항이 있었나요?
📌 관련 이슈번호
✅ Key Changes
📸 스크린샷 or 실행영상
🎸 기타 사항 or 추가 코멘트
Summary by CodeRabbit
릴리스 노트
버그 수정
기타