-
Notifications
You must be signed in to change notification settings - Fork 3
[API] 오늘의 한마디 삭제, 방 나가기 api 연동 #130
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
Merged
Nico1eKim
merged 10 commits into
THIP-TextHip:develop
from
Nico1eKim:api/#125-rooms_delete
Sep 5, 2025
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
708fa3f
[chore]: 필요 없는 더미 파일 삭제 (#125)
Nico1eKim e91b175
[feat]: 오늘의 한마디 삭제 data layer 생성 (#125)
Nico1eKim 9802257
[feat]: 오늘의 한마디 삭제 api 연결 로직 작성 (#125)
Nico1eKim 65b7e58
[chore]: string 중복 수정 (#125)
Nico1eKim 4affaf8
[feat]: 방 나가기 data layer 생성 (#125)
Nico1eKim 6654dbd
[feat]: 방 나가기 api 연결 로직 작성 (#125)
Nico1eKim 081b865
[refactor]: 오늘의 한마디 삭제 시 토스트 메시지 뜨도록 수정 (#125)
Nico1eKim 655c85c
Merge branch 'develop' of https://github.com/THIP-TextHip/THIP-Androi…
Nico1eKim 4c94e99
[refactor]: 방 나갔을 때 내 모임방 리스트 다시 fetch하게 수정 (#125)
Nico1eKim 140f7fb
[refactor]: 오늘의 한마디 toast 사라질때 애니메이션 안되는 문제 해결 (#125)
Nico1eKim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
.../main/java/com/texthip/thip/data/model/rooms/response/RoomsDeleteDailyGreetingResponse.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package com.texthip.thip.data.model.rooms.response | ||
|
|
||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class RoomsDeleteDailyGreetingResponse ( | ||
| val roomId: Int, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 0 additions & 57 deletions
57
app/src/main/java/com/texthip/thip/ui/group/room/mock/GroupRoomChatData.kt
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| package com.texthip.thip.ui.group.room.screen | ||
|
|
||
| import android.widget.Toast | ||
| import androidx.compose.animation.AnimatedVisibility | ||
| import androidx.compose.animation.core.tween | ||
| import androidx.compose.animation.slideInVertically | ||
|
|
@@ -28,6 +29,8 @@ 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.graphics.Color | ||
| import androidx.compose.ui.platform.LocalContext | ||
| import androidx.compose.ui.res.stringResource | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
|
|
@@ -60,21 +63,52 @@ fun GroupRoomChatScreen( | |
| ) { | ||
| var inputText by remember { mutableStateOf("") } | ||
| val uiState by viewModel.uiState.collectAsState() | ||
| val context = LocalContext.current | ||
|
|
||
| var activeToast by remember { mutableStateOf<ToastType?>(null) } | ||
| var showToast by remember { mutableStateOf(false) } | ||
| var toastMessage by remember { mutableStateOf("") } | ||
| val colorWhite = colors.White | ||
| val colorRed = colors.Red | ||
| var toastColor by remember { mutableStateOf(colorWhite) } | ||
|
|
||
| val dailyGreetingLimitMessage = stringResource(R.string.group_room_chat_max) | ||
| val deleteSuccessMessage = stringResource(R.string.group_room_chat_delete_success) | ||
|
|
||
|
Comment on lines
+74
to
76
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. FIRST_WRITE 토스트 메시지 매핑 오류
- val dailyGreetingLimitMessage = stringResource(R.string.group_room_chat_max)
- val deleteSuccessMessage = stringResource(R.string.group_room_chat_delete_success)
+ val dailyGreetingLimitMessage = stringResource(R.string.group_room_chat_max)
+ val firstWriteMessage = stringResource(R.string.group_room_chat_first_write)
+ val deleteSuccessMessage = stringResource(R.string.group_room_chat_delete_success)
…
- ToastType.FIRST_WRITE -> {
- toastMessage = dailyGreetingLimitMessage
- toastColor = colorWhite
- }
+ ToastType.FIRST_WRITE -> {
+ toastMessage = firstWriteMessage
+ toastColor = colorWhite
+ }화면 외부 변경(리소스 추가)도 필요합니다: <!-- res/values/strings.xml -->
<string name="group_room_chat_first_write">첫 오늘의 한마디를 남겼어요!</string>Also applies to: 81-96 🤖 Prompt for AI Agents |
||
| LaunchedEffect(key1 = Unit) { | ||
| viewModel.eventFlow.collectLatest { event -> | ||
| when (event) { | ||
| is GroupRoomChatEvent.ShowToast -> { | ||
| activeToast = event.type | ||
| when (event.type) { | ||
| ToastType.DAILY_GREETING_LIMIT -> { | ||
| toastMessage = dailyGreetingLimitMessage | ||
| toastColor = colorRed | ||
| } | ||
| ToastType.FIRST_WRITE -> { | ||
| toastMessage = dailyGreetingLimitMessage | ||
| toastColor = colorWhite | ||
| } | ||
| ToastType.DELETE_GREETING_SUCCESS -> { | ||
| toastMessage = deleteSuccessMessage | ||
| toastColor = colorWhite | ||
| } | ||
| } | ||
| showToast = true | ||
| } | ||
| is GroupRoomChatEvent.ShowErrorToast -> { | ||
| Toast.makeText(context, event.message, Toast.LENGTH_SHORT).show() | ||
| } | ||
|
|
||
| else -> Unit | ||
| } | ||
| } | ||
| } | ||
|
|
||
| LaunchedEffect(showToast) { | ||
| if (showToast) { | ||
| delay(3000) | ||
| showToast = false | ||
| } | ||
| } | ||
|
|
||
| GroupRoomChatContent( | ||
| uiState = uiState, | ||
| onEvent = viewModel::onEvent, | ||
|
|
@@ -85,8 +119,9 @@ fun GroupRoomChatScreen( | |
| inputText = "" | ||
| }, | ||
| onNavigateBack = onBackClick, | ||
| activeToast = activeToast, | ||
| onDismissToast = { activeToast = null } | ||
| showToast = showToast, | ||
| toastMessage = toastMessage, | ||
| toastColor = toastColor | ||
| ) | ||
| } | ||
|
|
||
|
|
@@ -98,8 +133,9 @@ fun GroupRoomChatContent( | |
| onInputTextChanged: (String) -> Unit, | ||
| onSendClick: () -> Unit, | ||
| onNavigateBack: () -> Unit, | ||
| activeToast: ToastType?, | ||
| onDismissToast: () -> Unit | ||
| showToast: Boolean, | ||
| toastMessage: String, | ||
| toastColor: Color, | ||
| ) { | ||
| var isBottomSheetVisible by remember { mutableStateOf(false) } | ||
| var selectedMessage by remember { mutableStateOf<TodayCommentList?>(null) } | ||
|
|
@@ -240,54 +276,25 @@ fun GroupRoomChatContent( | |
| } | ||
|
|
||
| AnimatedVisibility( | ||
| visible = activeToast != null, | ||
| // visible 조건을 showToast로 변경 | ||
| visible = showToast, | ||
| enter = slideInVertically( | ||
| initialOffsetY = { -it }, // 위에서 아래로 | ||
| initialOffsetY = { -it }, | ||
| animationSpec = tween(durationMillis = 2000) | ||
| ), | ||
| exit = slideOutVertically( | ||
| targetOffsetY = { -it }, // 위로 사라짐 | ||
| targetOffsetY = { -it }, | ||
| animationSpec = tween(durationMillis = 2000) | ||
| ), | ||
| modifier = Modifier | ||
| .align(Alignment.TopCenter) | ||
| .padding(horizontal = 20.dp, vertical = 16.dp) | ||
| .zIndex(3f) | ||
| ) { | ||
| LaunchedEffect(activeToast) { | ||
| if (activeToast != null) { | ||
| delay(3000L) | ||
| onDismissToast() | ||
| } | ||
| } | ||
|
|
||
| AnimatedVisibility( | ||
| visible = activeToast != null, | ||
| enter = slideInVertically( | ||
| initialOffsetY = { -it }, | ||
| animationSpec = tween(durationMillis = 2000) | ||
| ), | ||
| exit = slideOutVertically( | ||
| targetOffsetY = { -it }, | ||
| animationSpec = tween(durationMillis = 2000) | ||
| ), | ||
| modifier = Modifier | ||
| .align(Alignment.TopCenter) | ||
| .padding(horizontal = 20.dp, vertical = 16.dp) | ||
| .zIndex(3f) | ||
| ) { | ||
| when (activeToast) { | ||
| ToastType.DAILY_GREETING_LIMIT -> { | ||
| ToastWithDate(color = colors.Red) | ||
| } | ||
|
|
||
| ToastType.FIRST_WRITE -> { | ||
| ToastWithDate() | ||
| } | ||
|
|
||
| null -> {} | ||
| } | ||
| } | ||
| ToastWithDate( | ||
| message = toastMessage, | ||
| color = toastColor | ||
| ) | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -298,7 +305,9 @@ fun GroupRoomChatContent( | |
| text = stringResource(R.string.delete), | ||
| color = colors.Red, | ||
| onClick = { | ||
| // TODO: 삭제 처리 | ||
| selectedMessage?.let { message -> | ||
| onEvent(GroupRoomChatEvent.DeleteGreeting(message.attendanceCheckId)) | ||
| } | ||
| isBottomSheetVisible = false | ||
| } | ||
| ) | ||
|
|
@@ -352,8 +361,9 @@ private fun GroupRoomChatScreenPreview() { | |
| onInputTextChanged = { newText -> inputText = newText }, | ||
| onSendClick = {}, | ||
| onNavigateBack = {}, | ||
| activeToast = null, | ||
| onDismissToast = {} | ||
| showToast = false, | ||
| toastMessage = "", | ||
| toastColor = colors.White | ||
| ) | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
초기 로딩 중복 여부 확인
LaunchedEffect(Unit)에서refreshData()를 호출하면 ViewModelinit에서도 초기 로딩을 한다면 이중 호출이 됩니다. 한쪽으로 일원화하는지 확인해 주세요.다음 스크립트로 중복 가능성을 점검할 수 있습니다:
🏁 Script executed:
Length of output: 1093
초기 데이터 로딩 중복 제거
GroupMyViewModel의
init { loadMyRooms(reset = true) }와 GroupMyScreen의LaunchedEffect(Unit)에서 호출하는viewModel.refreshData()(loadMyRooms)가 중복됩니다. 한쪽 호출을 제거해 단일 진입점으로 통일해 주세요.🤖 Prompt for AI Agents