-
Notifications
You must be signed in to change notification settings - Fork 4
[refactor]: 키보드 내려가게 수정 #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Walkthrough두 화면의 6자리 코드 입력 처리에 마지막 입력칸(인덱스 5)에서 숫자 입력 시 키보드를 숨기는 분기가 추가되었습니다. 인덱스 0–4에서는 기존대로 다음 칸으로 포커스를 이동하고 키보드를 표시합니다. 백스페이스 및 포커스 이동 로직은 기존과 동일합니다. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User as 사용자
participant UI as Code Input UI
participant Focus as FocusManager
participant KB as KeyboardController
User->>UI: 숫자 입력
alt 인덱스 0–4
UI->>Focus: 다음 칸으로 이동
UI->>KB: show()
Note right of UI: 기존 흐름 유지
else 인덱스 5 (마지막 칸)
UI->>KB: hide()
Note right of UI: 새 분기: 마지막 입력 후 키보드 숨김
end
User->>UI: 백스페이스/빈 입력
UI->>Focus: 이전 칸으로 이동
Note right of UI: 기존 삭제/포커스 이동 로직 유지
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
composeApp/src/commonMain/kotlin/org/whosin/client/presentation/auth/clubcode/ClubCodeInputScreen.kt(1 hunks)composeApp/src/commonMain/kotlin/org/whosin/client/presentation/auth/login/EmailVerificationScreen.kt(1 hunks)
⏰ 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). (2)
- GitHub Check: ios-build
- GitHub Check: android-build
🔇 Additional comments (1)
composeApp/src/commonMain/kotlin/org/whosin/client/presentation/auth/login/EmailVerificationScreen.kt (1)
137-139: 키보드 표시 동작 일관성 확인 필요
ClubCodeInputScreen.kt에서는 포커스 이동 시(다음/이전입력칸)마다keyboardController?.show()를 여러 곳에서 호출하는 반면,EmailVerificationScreen.kt에서는 초기 포커스 후 한 번만 호출되고 이후 입력칸 간 이동 시 호출되지 않습니다. 의도된 UX 차이인지 확인하고, 동일한 동작을 원한다면 포커스 이동 시에도keyboardController?.show()를 추가하세요.
| else if (input.isNotEmpty() && index == 5) { | ||
| keyboardController?.hide() | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
마지막 자리 입력 시 키보드 자동 숨김 로직이 잘 구현되었습니다.
6번째 칸(index 5)에 숫자가 입력되면 키보드를 자동으로 내리는 로직이 정확합니다. 사용자가 모든 코드를 입력했을 때 키보드가 자동으로 사라지므로 UX가 개선됩니다.
코드 중복 제거를 고려해주세요.
이 로직이 EmailVerificationScreen.kt(lines 137-139)에도 동일하게 구현되어 있습니다. 두 화면의 6자리 코드 입력 처리 로직을 공통 컴포저블 또는 유틸리티 함수로 추출하면 유지보수가 더 쉬워집니다.
다음과 같이 공통 로직을 추출할 수 있습니다:
// 공통 파일에 추가
fun handleCodeInput(
input: String,
index: Int,
code: Array<String>,
focusRequesters: List<FocusRequester>,
keyboardController: SoftwareKeyboardController?,
onCodeUpdate: (Array<String>) -> Unit,
onFocusIndexUpdate: (Int) -> Unit,
onErrorClear: (() -> Unit)? = null
) {
if (input.length <= 1 && input.all { it.isDigit() }) {
val newCode = code.copyOf()
newCode[index] = input
onCodeUpdate(newCode)
onErrorClear?.invoke()
when {
input.isNotEmpty() && index < 5 -> {
onFocusIndexUpdate(index + 1)
focusRequesters[index + 1].requestFocus()
keyboardController?.show()
}
input.isNotEmpty() && index == 5 -> {
keyboardController?.hide()
}
input.isEmpty() && index > 0 -> {
onFocusIndexUpdate(index - 1)
focusRequesters[index - 1].requestFocus()
keyboardController?.show()
}
}
}
}그런 다음 두 화면에서 이 함수를 재사용할 수 있습니다.
🤖 Prompt for AI Agents
In
composeApp/src/commonMain/kotlin/org/whosin/client/presentation/auth/clubcode/ClubCodeInputScreen.kt
around lines 164-166 (and similarly in EmailVerificationScreen.kt lines
137-139), the keyboard-hide/focus-change logic is duplicated; extract this
shared behavior into a single utility/composable (e.g., handleCodeInput) placed
in a common package (shared UI utils) that accepts input, index, code array,
focusRequesters, keyboardController, onCodeUpdate, onFocusIndexUpdate, and
optional onErrorClear, implement the same branching (advance focus and show
keyboard, hide keyboard on last digit, move back on delete), then replace the
duplicated blocks in both screens with a call to that new function and update
imports and parameter wiring accordingly.
🚀 이슈번호
✏️ 변경사항
📷 스크린샷
✍️ 사용법
🎸 기타
Summary by CodeRabbit