Skip to content

Conversation

@comst19
Copy link
Collaborator

@comst19 comst19 commented Jan 7, 2026

1. ⭐️ 변경된 내용

  • 각 항목 입력 시 키패드에 안 가리도록 수정

2. 🖼️ 스크린샷(선택)

3. 💡 알게된 부분

4. 📌 이 부분은 꼭 봐주세요!

Summary by CodeRabbit

Release Notes

Improvements

  • Enhanced automatic scrolling to keep text input fields visible when the on-screen keyboard appears
  • Improved focus handling for form fields in scrollable containers, ensuring better accessibility during text entry
  • Optimized keyboard interaction to reduce manual scrolling when entering text in forms

✏️ Tip: You can customize this high-level summary in your review settings.

@comst19 comst19 requested review from kkh725 and tgyuuAn January 7, 2026 13:37
@comst19 comst19 self-assigned this Jan 7, 2026
@comst19 comst19 added 리뷰 원해요🔥 피어의 리뷰를 기다리는 ing.. 🔥 ㅁㅅ민수 labels Jan 7, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 7, 2026

📝 Walkthrough

Walkthrough

A new Modifier extension animateScrollToItemOnFocus() is introduced to handle focus-driven scroll animation with IME visibility detection. The feature is integrated into ValueTalkPage, which now propagates item indices and adjusts padding for improved keyboard handling.

Changes

Cohort / File(s) Summary
Core Modifier Extension
core/common-ui/src/main/java/com/puzzle/common/ui/Modifier.kt
Adds public animateScrollToItemOnFocus() extension function that detects focus changes and IME visibility via WindowInsets.ime, then performs delayed scroll animation to a specified list index with configurable offset. Uses LaunchedEffect, LocalDensity, and onFocusChanged for state management.
Feature Implementation
feature/profile/src/main/java/com/puzzle/profile/graph/register/page/ValueTalkPage.kt
Replaces deprecated scroll-on-focus API with new animateScrollToItemOnFocus() call; adds item index propagation to ValueTalkCard (idx + 1); increases LazyColumn bottom padding by 40.dp (imeBottom + 40.dp) for IME accommodation.

Sequence Diagram

sequenceDiagram
    actor User
    participant Focus as Focus System
    participant Modifier as animateScrollToItemOnFocus
    participant IME as IME Detector
    participant List as LazyListState
    
    User->>Focus: Focus item
    Focus->>Modifier: onFocusChanged (isFocused=true)
    Modifier->>IME: Check WindowInsets.ime
    
    alt IME Visible
        IME-->>Modifier: imeVisible = true
        Modifier->>Modifier: Delay (~100ms)
        Modifier->>List: scrollToItem(index, offset)
        List-->>User: Scroll animation
    else IME Hidden
        IME-->>Modifier: imeVisible = false
        Modifier-->>User: No scroll action
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested labels

픽스 👨‍🔧, ㅌㄱ태규 ☀️, ㄱㅎ근형 🌙

Suggested reviewers

  • tgyuuAn

Poem

🐰 A scroll that dances with the focus
When fingers find their place,
The IME whispers, and the list obeys—
Each item glides into grace 🎯

🚥 Pre-merge checks | ✅ 2 | ❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: improving scroll functionality when entering values in the ValueTalk feature to prevent keyboard overlap.
Description check ✅ Passed The description follows the required template structure with all four sections present, though sections 2, 3, and 4 lack detailed content beyond headers.

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

✨ Finishing touches
  • 📝 Generate docstrings

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

@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: 0

🧹 Nitpick comments (2)
core/common-ui/src/main/java/com/puzzle/common/ui/Modifier.kt (1)

210-232: Consider adding index to LaunchedEffect keys.

The index parameter is not included in the LaunchedEffect keys. If the index changes while the item is focused (e.g., due to list reordering), the scroll will target the stale index captured at effect launch time.

Additionally, consider extracting the 200 delay as a named constant for clarity.

♻️ Suggested improvement
+private const val IME_ANIMATION_DELAY_MS = 200L
+
 @OptIn(ExperimentalLayoutApi::class)
 fun Modifier.animateScrollToItemOnFocus(
     listState: LazyListState,
     index: Int,
     scrollOffsetDp: Dp = 20.dp
 ): Modifier = composed {
     val density = LocalDensity.current
     val imeBottom = WindowInsets.ime.asPaddingValues().calculateBottomPadding()
     var isFocused by remember { mutableStateOf(false) }

-    LaunchedEffect(imeBottom, isFocused) {
+    LaunchedEffect(imeBottom, isFocused, index) {
         if (isFocused && imeBottom > 0.dp) {
-            delay(200)
+            delay(IME_ANIMATION_DELAY_MS)
             listState.animateScrollToItem(
                 index = index,
                 scrollOffset = with(density) { -scrollOffsetDp.roundToPx() }
             )
         }
     }

     this.onFocusChanged { isFocused = it.isFocused }
 }
feature/profile/src/main/java/com/puzzle/profile/graph/register/page/ValueTalkPage.kt (1)

158-158: Remove unused variable.

The density variable is no longer used after replacing animateScrollWhenFocus with animateScrollToItemOnFocus. This is dead code that can be removed.

🧹 Suggested cleanup
-    val density = LocalDensity.current
-
     Column(modifier = modifier) {
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bf43d6e and bd64948.

📒 Files selected for processing (2)
  • core/common-ui/src/main/java/com/puzzle/common/ui/Modifier.kt
  • feature/profile/src/main/java/com/puzzle/profile/graph/register/page/ValueTalkPage.kt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (1)
feature/profile/src/main/java/com/puzzle/profile/graph/register/page/ValueTalkPage.kt (1)

125-135: LGTM! Integration looks correct.

The idx + 1 calculation correctly accounts for the header item at LazyList index 0, ensuring the scroll targets the correct ValueTalkCard. The modifier usage and parameter passing are properly wired.

Also applies to: 183-189

Copy link
Collaborator

@kkh725 kkh725 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다

Copy link
Member

@tgyuuAn tgyuuAn left a comment

Choose a reason for hiding this comment

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

해당 Modifier가 다른 디바이스에서도 온전히 동작하나요?
체크가 필요할 것 같아요.
추가적으로 해당 Modifier가 생겨나면 기존 Modifier는 제거해도 될까요 ?

state = listState,
modifier = modifier,
contentPadding = PaddingValues(bottom = imeBottom)
contentPadding = PaddingValues(bottom = imeBottom + 40.dp)
Copy link
Member

Choose a reason for hiding this comment

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

질문 : 이거 40.dp는 뭐에요 ?!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

키패드가 올라왔을 때, 마지막 입력 칸이 키보드에 너무 붙는 현상이 있어 적당하게 추가 했습니다.

Comment on lines +211 to +232
@OptIn(ExperimentalLayoutApi::class)
fun Modifier.animateScrollToItemOnFocus(
listState: LazyListState,
index: Int,
scrollOffsetDp: Dp = 20.dp
): Modifier = composed {
val density = LocalDensity.current
val imeBottom = WindowInsets.ime.asPaddingValues().calculateBottomPadding()
var isFocused by remember { mutableStateOf(false) }

LaunchedEffect(imeBottom, isFocused) {
if (isFocused && imeBottom > 0.dp) {
delay(200)
listState.animateScrollToItem(
index = index,
scrollOffset = with(density) { -scrollOffsetDp.roundToPx() }
)
}
}

this.onFocusChanged { isFocused = it.isFocused }
}
Copy link
Member

Choose a reason for hiding this comment

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

이거 Composed 말고 Modfiier.Node()로 변경해주시는 게 좋을 것 같아요.
composed로 작성되면 상위 Composable에서 리컴포지션 일어나면 항상 Modifier가 재트리거 되거든요.
참고 : https://developer.android.com/develop/ui/compose/custom-modifiers?hl=ko

@comst19 comst19 marked this pull request as draft January 8, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ㅁㅅ민수 리뷰 원해요🔥 피어의 리뷰를 기다리는 ing.. 🔥

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants