답변 스크롤 여백 조정#530
Conversation
Walkthrough
Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ 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.
🧹 Nitpick comments (1)
src/app/(route)/chat/[id]/ChatPage.tsx (1)
396-409: 💤 Low value갭 높이 계산 방식 검토 권장
현재 수식
root.clientHeight - latestUserMessage.offsetHeight는 응답 콘텐츠 길이와 관계없이 동일한 갭을 생성합니다. 응답이 길어지면 실제로 필요한 것보다 더 큰 spacer가 렌더링될 수 있습니다.현재 구현도 동작하지만, 응답 스트리밍 중 갭이 점진적으로 줄어드는 것이 더 자연스러운 UX가 될 수 있습니다:
// 예: 질문 아래 모든 콘텐츠 높이를 고려 const contentBelowQuestion = root.scrollHeight - latestUserMessage.offsetTop - latestUserMessage.offsetHeight; const neededGap = Math.max(root.clientHeight - latestUserMessage.offsetHeight - contentBelowQuestion, 0);다만, 현재 접근 방식도 기능적으로 문제없으므로 선택 사항입니다.
🤖 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/app/`(route)/chat/[id]/ChatPage.tsx around lines 396 - 409, The gap height calculation in the useLayoutEffect hook does not account for content already rendered below the user message, which can result in unnecessarily large spacers during response streaming. Modify the nextGapHeight calculation to consider the actual content height between the user message and the bottom of the scroll container. Specifically, calculate the height of all content below the question using the scroll container's total height minus the question's position and height, then subtract this from the available space to get the true needed gap. This will allow the gap to progressively reduce as response content streams in, creating a more natural UX.
🤖 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.
Nitpick comments:
In `@src/app/`(route)/chat/[id]/ChatPage.tsx:
- Around line 396-409: The gap height calculation in the useLayoutEffect hook
does not account for content already rendered below the user message, which can
result in unnecessarily large spacers during response streaming. Modify the
nextGapHeight calculation to consider the actual content height between the user
message and the bottom of the scroll container. Specifically, calculate the
height of all content below the question using the scroll container's total
height minus the question's position and height, then subtract this from the
available space to get the true needed gap. This will allow the gap to
progressively reduce as response content streams in, creating a more natural UX.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: edd7ed22-6376-4f01-9e67-1648b2a4b0c9
📒 Files selected for processing (1)
src/app/(route)/chat/[id]/ChatPage.tsx
관련 이슈
PR 설명
답변을 생성하고 있어요로딩 문구가 사라지도록 개선했습니다.테스트
pnpm lintpnpm exec tsc --noEmit