Skip to content

Conversation

@yuni-ju
Copy link
Member

@yuni-ju yuni-ju commented Sep 6, 2025

작업 내용

글 수정하기 기능

  1. 게시글의 옵션에서 수정하기 버튼을 누르면 수정 화면으로 이동합니다.
  2. 해당 글의 정보를 불러옵니다.
    a. 글 작성하기 화면을 재사용 하므로 editMode인 경우에만 정보를 불러오며, postEditId가 null일 때 한 번만 불러오도록 합니다.
    b. 불러올 수 없는 경우 메시지를 보여주고 이전 화면으로 돌아갑니다.
  3. 수정하기 클릭 시 로딩, 성공, 실패 상태에 따라 결과를 처리합니다. (기존 write상태 이용)
  4. 작성 및 수정 상태에 따라 액션바의 텍스트를 변경합니다.
  5. 글 수정 시 이미지는 편집할 수 없고, 서버에서 불러오므로 모드에 따라 postImages로 따로 관리하도록 했습니다.

게시글 작성

  1. 게시글 작성 성공 시 해당 게시글로 이동하는 기능을 구현했습니다.

기타

  1. WriteViewModel에서 같은 역할을 하지만 사용하지 않고 혼동을 줄 수 있는 LiveData들을 제거했습니다. (접두어가 post인 것)
  2. 스낵바가 시스템 내비게이션에 가려지는 문제를 수정했습니다.

참고

@yuni-ju yuni-ju requested a review from DongJun-H September 6, 2025 14:07
@yuni-ju yuni-ju self-assigned this Sep 6, 2025
@yuni-ju yuni-ju added this to DAYO 2.0 Sep 6, 2025
@yuni-ju yuni-ju added the feature label Sep 6, 2025
@github-project-automation github-project-automation bot moved this to Todo in DAYO 2.0 Sep 6, 2025
Comment on lines 346 to 354
if (isPostEditMode) {
PostEditImages(images = postImages)
} else {
WriteUploadImages(
images = processedImages,
deleteImage = { index -> deleteImageUri(index) },
onEditImage = { index -> editImage(index) },
)
}
Copy link
Member

Choose a reason for hiding this comment

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

WriteUploadImages 내부에서 editMode로 분기처리하면 더 복잡해질까요??

Copy link
Member Author

Choose a reason for hiding this comment

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

별도의 변수로 관리하고 있었고, 추후 다른 디자인 가능성에 따라 분리된 컴포저블로 만들었었습니다.

아래 리뷰처럼 ImageAsset으로 통합하고 하나의 processedImages로 관리한 뒤, 내부에서 분기하도록 변경하겠습니다

Comment on lines 86 to 87
private val _postImages = MutableStateFlow<List<String>>(emptyList())
val postImages = _postImages.asStateFlow()
Copy link
Member

Choose a reason for hiding this comment

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

image관련 변수를 2개 유지하는 것보다 ImageAsset data class쪽을 확장시켜서 하나로 통합해서 관리하는게 더 좋지않을까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

좋습니다!

Comment on lines 301 to 306
private fun setPostEditImages(images: List<String>) {
viewModelScope.launch {
_postImages.emit(images)
}
}

Copy link
Member

Choose a reason for hiding this comment

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

addOriginalImages(uris: List) 와 통합해서 사용하면 좋지않을까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

addOriginalImages에서는 readExifInfo를 통해서 exif 정보를 가져오도록 하는데, 서버에서 불러온 이미지는 contentResolver를 통해 정보를 불러 올 수 없어서 따로 처리 했습니다.

@yuni-ju yuni-ju requested a review from DongJun-H September 8, 2025 12:41
@github-project-automation github-project-automation bot moved this from Todo to In Progress in DAYO 2.0 Sep 9, 2025
@yuni-ju
Copy link
Member Author

yuni-ju commented Sep 10, 2025

@DongJun-H 글 작성화면에서 BackHandler가 제대로 동작하지 않는 문제도 추가로 수정했습니닷

@yuni-ju yuni-ju merged commit 647f16c into develop Sep 10, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in DAYO 2.0 Sep 10, 2025
@yuni-ju yuni-ju deleted the feature/issue-678 branch September 10, 2025 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[feature] Implement Post Editing

3 participants