-
Notifications
You must be signed in to change notification settings - Fork 3
[REFACTOR] QA 2번째 반영 #110
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
[REFACTOR] QA 2번째 반영 #110
Changes from all commits
27e7366
6c618a8
4dbe7f1
ae277b5
9c97018
66e3a39
3438fc5
a5e4453
38bf5fd
e61a43b
97f650a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,15 +9,18 @@ import androidx.compose.foundation.layout.Column | |
| import androidx.compose.foundation.layout.PaddingValues | ||
| import androidx.compose.foundation.layout.Row | ||
| import androidx.compose.foundation.layout.Spacer | ||
| import androidx.compose.foundation.layout.WindowInsets | ||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.layout.ime | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.layout.size | ||
| import androidx.compose.foundation.lazy.LazyColumn | ||
| import androidx.compose.foundation.lazy.LazyRow | ||
| import androidx.compose.foundation.lazy.items | ||
| import androidx.compose.foundation.lazy.itemsIndexed | ||
| import androidx.compose.foundation.lazy.rememberLazyListState | ||
| import androidx.compose.material3.CircularProgressIndicator | ||
| import androidx.compose.material3.HorizontalDivider | ||
| import androidx.compose.material3.Text | ||
|
|
@@ -31,8 +34,11 @@ import androidx.compose.runtime.setValue | |
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.draw.blur | ||
| import androidx.compose.ui.focus.FocusRequester | ||
| import androidx.compose.ui.focus.focusRequester | ||
| import androidx.compose.ui.input.pointer.pointerInput | ||
| import androidx.compose.ui.layout.ContentScale | ||
| import androidx.compose.ui.platform.LocalDensity | ||
| import androidx.compose.ui.platform.LocalFocusManager | ||
| import androidx.compose.ui.res.stringResource | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
|
|
@@ -147,6 +153,18 @@ fun FeedCommentScreen( | |
| var selectedCommentId by remember { mutableStateOf<Int?>(null) } | ||
|
|
||
| val focusManager = LocalFocusManager.current | ||
| val focusRequester = remember { FocusRequester() } | ||
| val listState = rememberLazyListState() | ||
|
|
||
| val isKeyboardVisible = WindowInsets.ime.getBottom(LocalDensity.current) > 0 | ||
|
|
||
| LaunchedEffect(isKeyboardVisible) { | ||
| if (!isKeyboardVisible) { | ||
| replyingToCommentId = null | ||
| replyingToNickname = null | ||
| focusManager.clearFocus() | ||
| } | ||
| } | ||
|
|
||
|
Comment on lines
+157
to
168
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion VM SideEffect(ScrollToItem) 수신 누락: 답글 작성 후 해당 부모 위치로 스크롤 연동 필요 CommentsViewModel이 다음 코드를 LaunchedEffect(commentsViewModel.sideEffect, commentsUiState.comments) {
commentsViewModel.sideEffect.collect { effect ->
when (effect) {
is CommentSideEffect.ScrollToItem -> {
val targetIndex = effect.parentCommentId?.let { id ->
commentsUiState.comments.indexOfFirst { it.commentId == id }
} ?: 0
if (targetIndex >= 0) {
listState.animateScrollToItem(targetIndex)
}
}
}
}
}또는, 답글 시작(onReplyClick) 시에도 입력창 포커스와 함께 해당 항목까지 스크롤하도록 보강할 수 있습니다. 🤖 Prompt for AI Agents |
||
| Box( | ||
| modifier = Modifier | ||
|
|
@@ -179,6 +197,7 @@ fun FeedCommentScreen( | |
| ) | ||
|
|
||
| LazyColumn( | ||
| state = listState, | ||
| modifier = modifier | ||
| .fillMaxWidth() | ||
| .weight(1f), | ||
|
|
@@ -334,6 +353,7 @@ fun FeedCommentScreen( | |
| replyingToCommentId = commentId | ||
| replyingToNickname = nickname | ||
| selectedCommentId = null | ||
| focusRequester.requestFocus() | ||
| }, | ||
| onCommentLongPress = { comment -> | ||
| selectedCommentId = comment.commentId | ||
|
|
@@ -353,7 +373,7 @@ fun FeedCommentScreen( | |
|
|
||
| // 댓글 입력창 | ||
| CommentTextField( | ||
| // modifier = Modifier.align(Alignment.BottomCenter), | ||
| modifier = Modifier.focusRequester(focusRequester), | ||
| input = commentInput, | ||
| hint = stringResource(R.string.reply_to), | ||
| onInputChange = { commentInput = it }, | ||
|
|
||
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.
💡 Verification agent
🧩 Analysis chain
Int 가정 잔존 여부 점검 필요 (NavType/Bundle/매퍼/DB).
모델은 Long으로 바뀌었지만, 다음 지점에서 Int 전제가 남아 있으면 런타임/네비게이션 버그가 납니다:
아래 스크립트로 잔존 사용을 한 번에 확인해 주세요.
🏁 Script executed:
Length of output: 715
NavType/Bundle Int용 검사를 위해
.kt파일만 지정하여 다시 검색해 보겠습니다.🏁 Script executed:
Length of output: 2136
creatorId 타입 일관성 유지 필요
모델에서 Long으로 변경된
creatorId가 여전히Int로 선언된 곳이 발견되었습니다. 런타임/네비게이션 버그를 방지하려면 아래 파일들을 모두Long으로 변경하고, 매퍼·NavType·Bundle·DB 시그니처도 함께 검토해 주세요.• app/src/main/java/com/texthip/thip/data/model/rooms/response/RoomsDailyGreetingResponse.kt (15줄)
• app/src/main/java/com/texthip/thip/data/model/feed/response/RelatedBooksResponse.kt (16줄)
예시 변경:
🤖 Prompt for AI Agents