Skip to content

[Feat] 리뷰v2 작성 중 뒤로가기시 다이알로그 추가#507

Open
HI-JIN2 wants to merge 8 commits intodevelopfrom
feat/write-review-undo-dialog
Open

[Feat] 리뷰v2 작성 중 뒤로가기시 다이알로그 추가#507
HI-JIN2 wants to merge 8 commits intodevelopfrom
feat/write-review-undo-dialog

Conversation

@HI-JIN2
Copy link
Copy Markdown
Member

@HI-JIN2 HI-JIN2 commented Mar 27, 2026

Summary

리뷰v2 작성 중 뒤로가기시 다이알로그 추가

Screen_recording_20260327_153750.webm
  1. 리뷰를 작성 중일때(별점을 눌렀다거나 텍스트를 썼다거나 좋아요를 눌렀다거나) 뒤로가기 했을때만 다이알로그 나옴
  2. 리뷰 작성 창에 아무것도 안했을때는 다이아로그 안나옴

Describe your changes

1. 리뷰작성/리뷰수정 중 뒤로가기(물리백버튼, <버튼)할 시 다이알로그로 한번 붙잡기

피그마
Review-UploadStopAlert 별도의 dialog 없이 바로 뒤로 가짐 스크린샷 2026-03-27 오후 3 39 09

2. 작성한 리뷰 없을때 텅 가운데로 가게 수정

(V2초안 코드에 중앙이었는데, paging3 하면서 코드가 유실된 것 같아요)

before after


Issue

To reviewers

@HI-JIN2 HI-JIN2 requested a review from PeraSite March 27, 2026 06:41
@HI-JIN2 HI-JIN2 self-assigned this Mar 27, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request establishes a commit message convention and improves the review management UI. Specifically, it refactors the review list layout and introduces a confirmation dialog in the write and modify screens to prevent data loss when navigating back with unsaved changes. Feedback focuses on improving the EatSsuDialog API to prevent semantic confusion between primary and secondary actions, and optimizing performance by using remember for state calculations that currently trigger on every recomposition.

Comment on lines +105 to +117
EatSsuDialog(
title = stringResource(R.string.review_exit_dialog_title),
description = stringResource(R.string.review_exit_dialog_description),
confirmText = stringResource(R.string.review_exit_dialog_confirm),
dismissText = stringResource(R.string.review_exit_dialog_dismiss),
onConfirmClick = { showExitDialog = false },
onDismissButtonClick = {
showExitDialog = false
onBack()
},
onDismissRequest = { showExitDialog = false },
visible = showExitDialog
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

EatSsuDialog 사용법이 매우 혼란스럽습니다. confirmText에 '계속 작성'을, dismissText에 '나가기'를 전달하고 있습니다. EatSsuDialog의 구현을 보면 confirm 버튼이 주 액션(primary color) 버튼입니다. 현재 코드대로라면 '계속 작성'이 주 액션으로 강조되는데, 이는 사용자의 데이터 손실을 막기 위한 의도된 UX 디자인일 수 있습니다.

하지만 코드상으로는 '확인(confirm)'을 의미하는 파라미터에 '취소'에 해당하는 액션을, '취소(dismiss)'를 의미하는 파라미터에 '확인'에 해당하는 액션을 연결하고 있어 매우 혼란스럽고 잠재적인 버그의 원인이 될 수 있습니다.

의도된 UX가 '계속 작성'을 강조하는 것이 맞다면, EatSsuDialog 컴포넌트의 API를 더 명확하게 개선하는 것을 고려해야 합니다. 만약 '나가기'가 주 액션(primary)이 되어야 한다면, 호출부에서 confirmdismiss에 전달하는 텍스트와 콜백을 서로 바꾸어 의미를 일치시켜야 합니다.

Comment on lines +130 to +142
EatSsuDialog(
title = stringResource(R.string.review_exit_dialog_title),
description = stringResource(R.string.review_exit_dialog_description),
confirmText = stringResource(R.string.review_exit_dialog_confirm),
dismissText = stringResource(R.string.review_exit_dialog_dismiss),
onConfirmClick = { showExitDialog = false },
onDismissButtonClick = {
showExitDialog = false
onBack()
},
onDismissRequest = { showExitDialog = false },
visible = showExitDialog
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

EatSsuDialog 사용법이 매우 혼란스럽습니다. confirmText에 '계속 작성'을, dismissText에 '나가기'를 전달하고 있습니다. EatSsuDialog의 구현을 보면 confirm 버튼이 주 액션(primary color) 버튼입니다. 현재 코드대로라면 '계속 작성'이 주 액션으로 강조되는데, 이는 사용자의 데이터 손실을 막기 위한 의도된 UX 디자인일 수 있습니다.

하지만 코드상으로는 '확인(confirm)'을 의미하는 파라미터에 '취소'에 해당하는 액션을, '취소(dismiss)'를 의미하는 파라미터에 '확인'에 해당하는 액션을 연결하고 있어 매우 혼란스럽고 잠재적인 버그의 원인이 될 수 있습니다.

의도된 UX가 '계속 작성'을 강조하는 것이 맞다면, EatSsuDialog 컴포넌트의 API를 더 명확하게 개선하는 것을 고려해야 합니다. 만약 '나가기'가 주 액션(primary)이 되어야 한다면, 호출부에서 confirmdismiss에 전달하는 텍스트와 콜백을 서로 바꾸어 의미를 일치시켜야 합니다.

Comment on lines +88 to +90
val hasUnsavedChanges = (ui as? UiState.Success)?.data?.let {
(it as? ModifyState.Editing)?.hasChanges ?: false
} ?: false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

hasUnsavedChanges가 recomposition이 일어날 때마다 계속해서 재계산되고 있습니다. remember를 사용하여 ui 상태가 변경될 때만 값을 다시 계산하도록 하여 불필요한 계산을 줄일 수 있습니다. 또한, 표현을 더 간결하게 만들 수 있습니다.

Suggested change
val hasUnsavedChanges = (ui as? UiState.Success)?.data?.let {
(it as? ModifyState.Editing)?.hasChanges ?: false
} ?: false
val hasUnsavedChanges = remember(ui) {
((ui as? UiState.Success)?.data as? ModifyState.Editing)?.hasChanges ?: false
}

Comment on lines +112 to +115
val hasUnsavedChanges = when (val data = (ui as? UiState.Success)?.data) {
is WriteReviewState.Editing -> data.rating > 0 || data.content.isNotEmpty() || data.selectedImageUri != null
else -> false
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

hasUnsavedChanges가 recomposition이 일어날 때마다 계속해서 재계산되고 있습니다. remember를 사용하여 ui 상태가 변경될 때만 값을 다시 계산하도록 하여 불필요한 계산을 줄일 수 있습니다.

    val hasUnsavedChanges = remember(ui) {
        when (val data = (ui as? UiState.Success)?.data) {
            is WriteReviewState.Editing -> data.rating > 0 || data.content.isNotEmpty() || data.selectedImageUri != null
            else -> false
        }
    }

Comment on lines 51 to 60
fun EatSsuDialog(
visible: Boolean,
title: String,
description: String,
confirmText: String,
onConfirmClick: () -> Unit,
onDismissRequest: () -> Unit,
modifier: Modifier = Modifier,
dismissText: String? = null,
onDismissButtonClick: (() -> Unit)? = null,
) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

이 다이얼로그 컴포넌트의 파라미터명(confirmText, dismissText)이 혼란을 줄 수 있습니다. 예를 들어, '작성 중 나가기'와 같은 확인창에서는 '계속 작성'이 긍정적 액션처럼 보이지만, 실제로는 다이얼로그의 질문('나가시겠어요?')에 대한 '취소' 액션입니다. 반면 '나가기'는 질문에 대한 '확인' 액션입니다.

현재 구현에서는 confirmText 버튼이 항상 primary color로 강조되는데, 이로 인해 호출부에서 의도와 다르게 파라미터를 전달하여 혼란을 야기할 수 있습니다 (실제로 ModifyReviewScreenWriteReviewScreen에서 이런 혼란이 보입니다).

컴포넌트의 재사용성과 명확성을 높이기 위해 파라미터명을 primaryButtonText, secondaryButtonText 등으로 변경하고, 각 버튼의 액션을 onPrimaryButtonClick, onSecondaryButtonClick으로 명확히 구분하는 것을 고려해보는 것이 좋겠습니다. 이렇게 하면 어떤 버튼이 강조될 것인지, 어떤 액션이 연결될 것인지가 코드상에서 더 명확해집니다.

@HI-JIN2
Copy link
Copy Markdown
Member Author

HI-JIN2 commented Mar 27, 2026

@PeraSite 리뷰 남겨주시면 제미나이 리뷰와 함께 반영하겠읍니다..

Copy link
Copy Markdown
Member

@PeraSite PeraSite left a comment

Choose a reason for hiding this comment

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

EatssuDialog가 쓰이다니, 좋습니당!
다른 이야기지만 커밋 컨벤션 AGENTS.md 너무 좋네요.... 맨날 컨벤션 안지켜서 화낫슨 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

리뷰v2 작성 중 뒤로가기시 다이알로그 추가

2 participants