-
Notifications
You must be signed in to change notification settings - Fork 2
[NDGL-118] 내 여행 관련 API 연동 #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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
40bf3fd
[NDGL-118] feature: 새 여행 추가 시 Home, MyTravel Screen에 반영(Event-Bus 패턴)
mj010504 aa9db63
[NDGL-118] fix: InputModal에 텍스트 입력 시 자음/모음 결합이 안되던 오류 수정
mj010504 d01c4de
[NDGL-118] feature: 인기 여행 따라가기 더 보기, 여행 검색에서 카드 클릭 시 FollowTravel 연결
mj010504 286fd87
[NDGL-118] fix: 장소 검색 API 매개변수 국가 제한 -> 지역 편향으로 변경
mj010504 e41e6ab
[NDGL-118] feature: PlaceDetailScreen에서 PlanB로 장소 변경시 로직 추가
mj010504 6287c38
[NDGL-118] feature: 장소 상세 조회 응답 필드 regularOpeningHours를 placeInfo ope…
mj010504 783b829
[NDGL-118] feature: 내 여행 관련 API 연동
mj010504 c2f5d7f
[NDGL-118] design: 일정이 없을 때 화면 추가
mj010504 1e71e68
[NDGL-118] refactor: 코드래빗 리뷰 반영
mj010504 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
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
File renamed without changes.
File renamed without changes.
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
18 changes: 18 additions & 0 deletions
18
data/travel/src/main/java/com/yapp/ndgl/data/travel/model/AddItineraryRequest.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,18 @@ | ||
| package com.yapp.ndgl.data.travel.model | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class AddItineraryRequest( | ||
| val googlePlaceId: String, | ||
| val day: Int, | ||
| val sequence: Int, | ||
| val startTime: String? = null, | ||
| val estimatedDuration: Int, | ||
| val memo: String? = null, | ||
| @SerialName("budget") | ||
| val cost: Int? = null, | ||
| val distanceKm: Double? = null, | ||
| val transportation: List<TransportationItem>? = null, | ||
| ) |
48 changes: 48 additions & 0 deletions
48
data/travel/src/main/java/com/yapp/ndgl/data/travel/model/AddItineraryResponse.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,48 @@ | ||
| package com.yapp.ndgl.data.travel.model | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class AddItineraryResponse( | ||
| val id: Long, | ||
| val day: Int, | ||
| val sequence: Int, | ||
| val startTime: String? = null, | ||
| val estimatedDuration: Int, | ||
| val memo: String? = null, | ||
| @SerialName("budget") | ||
| val cost: Int? = null, | ||
| val distanceKm: Double? = null, | ||
| val transportation: List<Transportation>? = null, | ||
| val travelerTips: List<String>? = null, | ||
| val planB: List<PlanBPlace>? = null, | ||
| val place: ItineraryPlace, | ||
| ) { | ||
| @Serializable | ||
| data class Transportation( | ||
| val mode: TransportCategory, | ||
| val timeMin: Int, | ||
| ) | ||
|
|
||
| @Serializable | ||
| data class PlanBPlace( | ||
| val googlePlaceId: String, | ||
| val name: String, | ||
| val thumbnail: String? = null, | ||
| val category: PlaceCategory, | ||
| ) | ||
|
|
||
| @Serializable | ||
| data class ItineraryPlace( | ||
| val googlePlaceId: String, | ||
| val thumbnail: String? = null, | ||
| val latitude: Double, | ||
| val longitude: Double, | ||
| val name: String, | ||
| val regularOpeningHours: String? = null, | ||
| val googleMapsUri: String? = null, | ||
| val category: PlaceCategory, | ||
| val priceRange: String? = null, | ||
| ) | ||
| } |
9 changes: 9 additions & 0 deletions
9
data/travel/src/main/java/com/yapp/ndgl/data/travel/model/ChangePlaceEvent.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,9 @@ | ||
| package com.yapp.ndgl.data.travel.model | ||
|
|
||
| data class ChangePlaceEvent( | ||
| val travelId: Long, | ||
| val itineraryId: Long, | ||
| val day: Int, | ||
| val oldGooglePlaceId: String, | ||
| val newGooglePlaceId: String, | ||
| ) |
9 changes: 9 additions & 0 deletions
9
data/travel/src/main/java/com/yapp/ndgl/data/travel/model/TransportationItem.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,9 @@ | ||
| package com.yapp.ndgl.data.travel.model | ||
|
|
||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class TransportationItem( | ||
| val mode: TransportCategory, | ||
| val timeMin: Int, | ||
| ) |
6 changes: 6 additions & 0 deletions
6
data/travel/src/main/java/com/yapp/ndgl/data/travel/model/TravelCreatedEvent.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,6 @@ | ||
| package com.yapp.ndgl.data.travel.model | ||
|
|
||
| data class TravelCreatedEvent( | ||
| val userTravelId: Long, | ||
| val templateId: Long, | ||
| ) |
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
11 changes: 11 additions & 0 deletions
11
data/travel/src/main/java/com/yapp/ndgl/data/travel/model/UpdateTravelPlaceRequest.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,11 @@ | ||
| package com.yapp.ndgl.data.travel.model | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class UpdateTravelPlaceRequest( | ||
| val memo: String? = null, | ||
| @SerialName("budget") | ||
| val cost: Int? = null, | ||
| ) |
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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
🧩 Analysis chain
🏁 Script executed:
fd "NDGLInputModal.kt" --type fRepository: YAPP-Github/27th-App-Team-1-Android
Length of output: 153
🏁 Script executed:
cat -n "core/ui/src/main/java/com/yapp/ndgl/core/ui/designsystem/NDGLInputModal.kt"Repository: YAPP-Github/27th-App-Team-1-Android
Length of output: 10320
value외부 변경이 입력창에 반영되지 않아 상태 불일치가 발생합니다.Line 60에서
textFieldValue가remember만으로 초기화되고 외부value변경을 감지하는 의존성이 없습니다. 이로 인해 모달이 열린 상태에서 부모 컴포넌트가value를 변경해도 입력 필드는 이전 값을 유지합니다. 특히 Line 147의 확인 버튼 활성화 조건은 외부value를 사용하지만 표시되는 텍스트는textFieldValue이므로, 버튼 상태와 입력 필드 내용이 불일치할 수 있습니다.🔧 제안 수정
var textFieldValue by remember { mutableStateOf(TextFieldValue(value, selection = TextRange(value.length))) } LaunchedEffect(Unit) { focusRequester.requestFocus() } + +LaunchedEffect(value) { + // 외부 value 변경만 동기화하고, IME 조합 중에는 덮어쓰지 않음 + if (value != textFieldValue.text && textFieldValue.composition == null) { + textFieldValue = textFieldValue.copy( + text = value, + selection = TextRange(value.length), + composition = null, + ) + } +}🤖 Prompt for AI Agents
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.
onValuechange에서 textFieldValue = newValue 하고 있기 때문에 문제가 발생하지는 않았습니다.
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.
@mj010504님, 맞습니다!onValueChange에서 사용자 입력은 잘 처리되고 있습니다.다만 제가 지적한 부분은 사용자 입력이 아닌 외부에서
valueprop이 변경될 때의 동기화였습니다. PR 설명에서 한글 자음/모음 결합 문제를 해결하셨다고 하셨는데, 이는 올바른 접근입니다. 한글 IME 조합 중에textFieldValue를 외부 값으로 덮어쓰면 조합이 깨지는 것이 맞습니다.한 가지 확인할 점이 있습니다:
onValueChange는textFieldValue.text를 전달하지만value를 사용합니다:if (value.isNotEmpty())현재 구현에서는 모달이 열려있는 동안 외부에서
value를 변경하는 경우가 없다면 문제가 없습니다. 하지만 일관성을 위해 Line 147도textFieldValue.text.isNotEmpty()를 사용하는 것이 더 안전할 수 있습니다.모달이 열려있는 동안 외부에서
value를 변경할 가능성이 있나요? 없다면 현재 구현이 적절합니다! 🐰🧠 Learnings used