Skip to content

[Refactor/#153] 멤버 선택 바텀시트 리팩토링 - #154

Merged
doyeon0307 merged 5 commits into
developfrom
refactor/#153-member-select-bottomsheet
Jul 20, 2026
Merged

[Refactor/#153] 멤버 선택 바텀시트 리팩토링#154
doyeon0307 merged 5 commits into
developfrom
refactor/#153-member-select-bottomsheet

Conversation

@doyeon0307

@doyeon0307 doyeon0307 commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Related issue 🛠️

Work Description ✏️

  • coreMemberSelectBottomSheet 제거
  • party.component.MemberSelectBottomSheet 사용
  • 멤버 선택 로직 수정
    • AS-IS : 선택된 멤버 인덱스를 저장 -> filter 사용 등 로직 복잡했음
    • TO-BE : 선택된 Member 객체 자체를 관리해 List<Member>로 저장

Screenshot 📸

Uncompleted Tasks 😅

  • N/A

To Reviewers 📢

Summary by CodeRabbit

  • Breaking Changes
    • 멤버 선택 바텀시트의 공개 컴포저블이 제거되어, 관련 호출부가 재구성되었습니다.
  • Refactor
    • 선택 상태가 인덱스 기반에서 Member 목록 기반으로 전환되어 초기화·동기화·저장 흐름이 업데이트되었습니다.
    • 화면 호출 시 전체 멤버와 선택 멤버를 분리 전달하도록 입력이 변경되었고, 표시용 이름/식별자 매핑과 칩/그리드 선택 표기가 정리되었습니다.
    • 바텀시트 타이틀·버튼 텍스트 전달 방식이 문자열 리소스 기반으로 정돈되었습니다.

@doyeon0307 doyeon0307 linked an issue Jun 13, 2026 that may be closed by this pull request
2 tasks
@doyeon0307 doyeon0307 self-assigned this Jun 13, 2026
@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@doyeon0307, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 58388ce9-173a-495a-a8f7-b1b8f30c6d48

📥 Commits

Reviewing files that changed from the base of the PR and between 9961226 and 44af606.

📒 Files selected for processing (2)
  • app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListViewModel.kt
  • app/src/main/java/com/poti/android/presentation/party/product/partylist/model/Contracts.kt
📝 Walkthrough

Walkthrough

인덱스 기반 멤버 선택을 Member 객체 기반으로 변경하여 계약, ViewModel 상태 로직, Screen 호출을 갱신하고 기존 core designsystem 바텀시트 구현을 제거했습니다.

Changes

Member 객체 기반 선택 처리로 전환

Layer / File(s) Summary
계약 및 상태 모델 변경
app/src/main/java/com/poti/android/presentation/party/product/partylist/model/Contracts.kt
bottomSheetSelectedMembersIdicesbottomSheetSelectedMembers로 교체하고, OnMemberSelect 페이로드를 Member 객체로 변경했습니다.
ViewModel 상태 관리 로직 업데이트
app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListViewModel.kt
멤버 선택 토글, 필터 갱신, 초기화, 저장 로직을 Member 객체 목록 기반으로 변경했습니다.
Screen 호출 방식 업데이트
app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListScreen.kt
바텀시트 import 경로와 호출 파라미터를 변경하고, allMembers·selectedMembers 및 이름/ID 매핑 람다를 전달하도록 수정했습니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Screen as ProductPartyListScreen
  participant ViewModel as ProductPartyListViewModel
  participant State as ProductPartyListUiState

  Screen->>ViewModel: OnMemberSelect(member: Member)
  ViewModel->>ViewModel: onBottomSheetMemberChanged(member)
  ViewModel->>State: bottomSheetSelectedMembers 토글 업데이트
  Screen->>ViewModel: 멤버 필터 갱신
  ViewModel->>State: 선택 멤버 기준 displayMembers 갱신
  Screen->>ViewModel: 멤버 선택 저장
  ViewModel->>State: selectedMembers 갱신
Loading

Possibly related PRs

Suggested labels: 🔎 UI, 🐣 도연

Suggested reviewers: cmj7271, jyvnee

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 멤버 선택 바텀시트 리팩토링이라는 핵심 변경을 정확히 요약합니다.
Description check ✅ Passed 템플릿의 관련 이슈, 작업 내용, 스크린샷, 미완료 작업 항목을 대부분 채워 설명이 충분합니다.
Linked Issues check ✅ Passed #153의 핵심 요구사항인 party.component 전환과 core MemberSelectBottomSheet 삭제가 반영되었습니다.
Out of Scope Changes check ✅ Passed 멤버 선택 흐름과 호출부 수정은 전환 작업에 필요한 범위이며, 명확한 무관 변경은 보이지 않습니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/#153-member-select-bottomsheet

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListScreen.kt (1)

149-149: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

LazyColumn items에 key 파라미터 추가를 권장합니다.

items(productPartyListInfo.partySummaries)key 파라미터가 누락되어 있습니다. 리스트 아이템이 추가/삭제/재정렬될 때 Compose가 각 아이템을 식별하지 못하면 불필요한 리컴포지션이 발생할 수 있습니다.

파티 목록은 필터링/정렬로 인해 순서가 바뀔 수 있으므로, partyId를 key로 사용하는 것이 좋습니다.

♻️ key 파라미터 추가 예시
-items(productPartyListInfo.partySummaries) { party ->
+items(
+    items = productPartyListInfo.partySummaries,
+    key = { it.partyId }
+) { party ->
     PartyCard(

코딩 가이드라인에 따르면, LazyColumn 등 리스트에서 key 파라미터 누락 여부를 확인하여 불필요한 리컴포지션을 방지하도록 권장하고 있습니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListScreen.kt`
at line 149, The LazyColumn items call in ProductPartyListScreen is missing a
stable key, so update the items(productPartyListInfo.partySummaries) { party ->
... } invocation to include a key parameter that uses the party's stable
identifier (e.g., items(productPartyListInfo.partySummaries, key = { it.partyId
}) { party -> ... }) to prevent unnecessary recompositions when the list is
filtered, sorted, or items are added/removed.

Source: Coding guidelines

🧹 Nitpick comments (4)
app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListViewModel.kt (2)

153-156: ⚡ Quick win

멤버 토글 로직의 성능을 개선할 수 있습니다.

member in selectedMembers 체크가 List에서 O(n) 시간이 소요됩니다. 멤버가 많아질수록 성능 저하가 발생할 수 있습니다.

Line 23에서 bottomSheetSelectedMembersSet<Member>로 변경하면 이 체크가 O(1)이 되어 성능이 개선됩니다.

현재는 List의 +/- 연산자를 사용하여 불변성을 잘 유지하고 있습니다만, Set을 사용해도 동일한 연산자로 불변성을 유지할 수 있습니다.

♻️ Set 사용 시 코드 변경 (참고)
 private fun onBottomSheetMemberChanged(member: Member) {
     val selectedMembers = uiState.value.bottomSheetSelectedMembers
-    val newSelectedMembers = if (member in selectedMembers) selectedMembers - member else selectedMembers + member
+    val newSelectedMembers = if (member in selectedMembers) selectedMembers - member else selectedMembers + member
     updateState { copy(bottomSheetSelectedMembers = newSelectedMembers, isMemberBottomSheetToucehd = true) }
 }

Set도 +/- 연산자를 지원하므로 로직 변경 없이 타입만 바꾸면 됩니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListViewModel.kt`
around lines 153 - 156, Change the type of bottomSheetSelectedMembers from
List<Member> to Set<Member> in the UI state/data class so membership checks
become O(1); no logic changes are required in onBottomSheetMemberChanged (which
uses "member in bottomSheetSelectedMembers" and "+"/"-" to produce
newSelectedMembers and calls updateState { copy(bottomSheetSelectedMembers =
newSelectedMembers, isMemberBottomSheetToucehd = true) }) because Set also
supports + and - and preserves immutability.

146-146: ⚡ Quick win

멤버 필터링 성능을 개선할 수 있습니다.

displayMembers.filter { it in bottomSheetSelectedMembers }bottomSheetSelectedMembersList일 경우 각 요소마다 O(n) 탐색이 발생하여 전체 O(n²) 복잡도를 가집니다.

두 가지 개선 방안이 있습니다:

  1. bottomSheetSelectedMembersSet으로 변경 (Line 23 참고)
  2. 임시로 Set으로 변환하여 필터링

멤버 수가 적다면 큰 문제는 아니지만, 확장성을 고려하면 개선하는 것이 좋습니다.

♻️ 성능 개선 방안

방안 1: State를 Set으로 변경한 경우 (권장)

-val newSelectedMembers = uiState.value.displayMembers.filter { it in uiState.value.bottomSheetSelectedMembers }
+val newSelectedMembers = uiState.value.displayMembers.filter { it in uiState.value.bottomSheetSelectedMembers }

변경 없이 자동으로 O(n) 성능 확보됩니다.

방안 2: List를 유지해야 하는 경우

-val newSelectedMembers = uiState.value.displayMembers.filter { it in uiState.value.bottomSheetSelectedMembers }
+val selectedSet = uiState.value.bottomSheetSelectedMembers.toSet()
+val newSelectedMembers = uiState.value.displayMembers.filter { it in selectedSet }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListViewModel.kt`
at line 146, The current filtering in ProductPartyListViewModel (val
newSelectedMembers = uiState.value.displayMembers.filter { it in
uiState.value.bottomSheetSelectedMembers }) is O(n²) when
bottomSheetSelectedMembers is a List; fix by making bottomSheetSelectedMembers a
Set in state (see the state declaration around line 23) so the membership test
is O(1), or if you must keep it as a List, convert it once to a Set before
filtering (e.g., val selectedSet =
uiState.value.bottomSheetSelectedMembers.toSet(); val newSelectedMembers =
uiState.value.displayMembers.filter { it in selectedSet }) to ensure O(n)
overall.
app/src/main/java/com/poti/android/presentation/party/product/partylist/model/Contracts.kt (2)

23-23: ⚡ Quick win

선택 멤버 저장에 Set<Member>를 고려해보세요.

bottomSheetSelectedMembersList<Member>로 선언하셨는데, 멤버 선택은 중복이 불필요하고 순서가 중요하지 않은 경우가 많습니다. Set<Member>를 사용하면 다음과 같은 이점이 있습니다:

  • 중복 방지가 자동으로 보장됩니다
  • ViewModel에서 member in selectedMembers 체크 시 List는 O(n)이지만 Set은 O(1)입니다 (Line 155에서 성능 개선)
  • 의도가 명확해집니다 (선택된 멤버의 집합)

다만 UI에서 선택 순서를 표시해야 한다면 List가 적절할 수 있으니, 요구사항을 확인해주세요.

♻️ Set으로 변경 시 제안 diff
-    val bottomSheetSelectedMembers: List<Member> = emptyList(),
+    val bottomSheetSelectedMembers: Set<Member> = emptySet(),

이 경우 ViewModel의 Line 142, 155도 함께 수정이 필요합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@app/src/main/java/com/poti/android/presentation/party/product/partylist/model/Contracts.kt`
at line 23, Change bottomSheetSelectedMembers from List<Member> to Set<Member>
(e.g., val bottomSheetSelectedMembers: Set<Member> = emptySet()) to prevent
duplicates and make membership checks O(1); then update the ViewModel usages
that manipulate or query this collection (places that add/remove members and
checks like "member in selectedMembers") to use Set semantics (use
toMutableSet() when mutating, add/remove on the mutable set, and assign back as
an immutable Set) and ensure any UI code that depends on ordering is adjusted or
retained as a separate ordered list if needed.

13-25: ⚡ Quick win

Compose 안정성을 위해 @Immutable 어노테이션 추가를 고려해주세요.

ProductPartyListUiStateList<Member> 등 복잡한 타입을 포함하고 있습니다. Compose 컴파일러가 이 클래스의 안정성을 추론하지 못하면 불필요한 리컴포지션이 발생할 수 있습니다.

MemberProductPartyList가 모두 불변 타입이라면 @Immutable 어노테이션을 추가하여 Compose에게 안정성을 명시적으로 알려주는 것이 좋습니다.

♻️ 안정성 어노테이션 추가 예시
+import androidx.compose.runtime.Immutable
+
+@Immutable
 data class ProductPartyListUiState(
     val productPartyListInfo: ApiState<ProductPartyList> = ApiState.Loading,

단, MemberProductPartyList도 모두 불변이어야 합니다. 그렇지 않다면 @Stable 사용을 고려해주세요.

코딩 가이드라인에 따르면, List나 일반 클래스를 State로 사용할 때 불필요한 리컴포지션을 막기 위해 @Immutable이나 @Stable 어노테이션 사용을 권장합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@app/src/main/java/com/poti/android/presentation/party/product/partylist/model/Contracts.kt`
around lines 13 - 25, Add a Compose stability annotation to the
ProductPartyListUiState data class: if Member and ProductPartyList are
immutable, annotate ProductPartyListUiState with `@Immutable`; if those types are
not fully immutable, annotate with `@Stable` instead. Verify and, if necessary,
make Member and ProductPartyList immutable (or adjust their annotations) so the
chosen annotation on ProductPartyListUiState is correct, then import
androidx.compose.runtime.Immutable or Stable and apply it above the
ProductPartyListUiState declaration.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In
`@app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListScreen.kt`:
- Line 149: The LazyColumn items call in ProductPartyListScreen is missing a
stable key, so update the items(productPartyListInfo.partySummaries) { party ->
... } invocation to include a key parameter that uses the party's stable
identifier (e.g., items(productPartyListInfo.partySummaries, key = { it.partyId
}) { party -> ... }) to prevent unnecessary recompositions when the list is
filtered, sorted, or items are added/removed.

---

Nitpick comments:
In
`@app/src/main/java/com/poti/android/presentation/party/product/partylist/model/Contracts.kt`:
- Line 23: Change bottomSheetSelectedMembers from List<Member> to Set<Member>
(e.g., val bottomSheetSelectedMembers: Set<Member> = emptySet()) to prevent
duplicates and make membership checks O(1); then update the ViewModel usages
that manipulate or query this collection (places that add/remove members and
checks like "member in selectedMembers") to use Set semantics (use
toMutableSet() when mutating, add/remove on the mutable set, and assign back as
an immutable Set) and ensure any UI code that depends on ordering is adjusted or
retained as a separate ordered list if needed.
- Around line 13-25: Add a Compose stability annotation to the
ProductPartyListUiState data class: if Member and ProductPartyList are
immutable, annotate ProductPartyListUiState with `@Immutable`; if those types are
not fully immutable, annotate with `@Stable` instead. Verify and, if necessary,
make Member and ProductPartyList immutable (or adjust their annotations) so the
chosen annotation on ProductPartyListUiState is correct, then import
androidx.compose.runtime.Immutable or Stable and apply it above the
ProductPartyListUiState declaration.

In
`@app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListViewModel.kt`:
- Around line 153-156: Change the type of bottomSheetSelectedMembers from
List<Member> to Set<Member> in the UI state/data class so membership checks
become O(1); no logic changes are required in onBottomSheetMemberChanged (which
uses "member in bottomSheetSelectedMembers" and "+"/"-" to produce
newSelectedMembers and calls updateState { copy(bottomSheetSelectedMembers =
newSelectedMembers, isMemberBottomSheetToucehd = true) }) because Set also
supports + and - and preserves immutability.
- Line 146: The current filtering in ProductPartyListViewModel (val
newSelectedMembers = uiState.value.displayMembers.filter { it in
uiState.value.bottomSheetSelectedMembers }) is O(n²) when
bottomSheetSelectedMembers is a List; fix by making bottomSheetSelectedMembers a
Set in state (see the state declaration around line 23) so the membership test
is O(1), or if you must keep it as a List, convert it once to a Set before
filtering (e.g., val selectedSet =
uiState.value.bottomSheetSelectedMembers.toSet(); val newSelectedMembers =
uiState.value.displayMembers.filter { it in selectedSet }) to ensure O(n)
overall.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 853cffab-feae-4594-9723-24820e07cb0e

📥 Commits

Reviewing files that changed from the base of the PR and between dcce33e and 424ffa5.

📒 Files selected for processing (4)
  • app/src/main/java/com/poti/android/core/designsystem/component/bottomsheet/MemberSelectBottomSheet.kt
  • app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListScreen.kt
  • app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListViewModel.kt
  • app/src/main/java/com/poti/android/presentation/party/product/partylist/model/Contracts.kt
💤 Files with no reviewable changes (1)
  • app/src/main/java/com/poti/android/core/designsystem/component/bottomsheet/MemberSelectBottomSheet.kt

@doyeon0307

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListViewModel.kt (2)

153-156: ⚡ Quick win

멤버십 체크 성능 개선을 권장해요.

List에 대해 in 연산자를 사용하면 O(n) 선형 탐색이 발생합니다. toSet()으로 변환하여 O(1) 조회를 하는 것이 더 효율적이에요.

♻️ 제안하는 개선 방법
 private fun onBottomSheetMemberChanged(member: Member) {
     val selectedMembers = uiState.value.bottomSheetSelectedMembers
-    val newSelectedMembers = if (member in selectedMembers) selectedMembers - member else selectedMembers + member
+    val selectedMembersSet = selectedMembers.toSet()
+    val newSelectedMembers = if (member in selectedMembersSet) {
+        selectedMembers - member
+    } else {
+        selectedMembers + member
+    }
     updateState { copy(bottomSheetSelectedMembers = newSelectedMembers, isMemberBottomSheetToucehd = true) }
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListViewModel.kt`
around lines 153 - 156, The membership check in onBottomSheetMemberChanged
currently uses "member in selectedMembers" on a List
(uiState.value.bottomSheetSelectedMembers) causing O(n) checks; change the
implementation to perform the containment test on a Set (e.g., val selectedSet =
selectedMembers.toMutableSet()), then add or remove the member on that set and
convert back to the List type expected by uiState (e.g., newSelectedMembers =
selectedSet.toList()) before calling updateState {
copy(bottomSheetSelectedMembers = newSelectedMembers, isMemberBottomSheetToucehd
= true) }; alternatively, if bottomSheetSelectedMembers can be changed to a Set
at the state level, update the state type and use constant-time
contains/add/remove on that Set in onBottomSheetMemberChanged.

146-146: ⚡ Quick win

멤버십 체크 성능 개선을 권장해요.

List에 대해 in 연산자를 사용하면 O(n) 선형 탐색이 발생합니다. 멤버 리스트가 일반적으로 작긴 하지만, toSet()으로 변환하여 O(1) 조회를 하는 것이 Kotlin 모범 사례예요.

♻️ 제안하는 개선 방법
 private fun saveSelectedMember() {
-    val newSelectedMembers = uiState.value.displayMembers.filter { it in uiState.value.bottomSheetSelectedMembers }
+    val selectedMembersSet = uiState.value.bottomSheetSelectedMembers.toSet()
+    val newSelectedMembers = uiState.value.displayMembers.filter { it in selectedMembersSet }

     updateState { copy(selectedMembers = newSelectedMembers) }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListViewModel.kt`
at line 146, The filter uses "in" against a List causing O(n^2) behavior when
checking membership; convert the membership collection to a Set first and use
that for O(1) lookups. For example, in the ProductPartyListViewModel where
newSelectedMembers is computed, build a Set from
uiState.value.bottomSheetSelectedMembers (e.g., val selectedSet =
uiState.value.bottomSheetSelectedMembers.toSet()) and then use
uiState.value.displayMembers.filter { it in selectedSet } so membership checks
are O(1).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListViewModel.kt`:
- Around line 153-156: The membership check in onBottomSheetMemberChanged
currently uses "member in selectedMembers" on a List
(uiState.value.bottomSheetSelectedMembers) causing O(n) checks; change the
implementation to perform the containment test on a Set (e.g., val selectedSet =
selectedMembers.toMutableSet()), then add or remove the member on that set and
convert back to the List type expected by uiState (e.g., newSelectedMembers =
selectedSet.toList()) before calling updateState {
copy(bottomSheetSelectedMembers = newSelectedMembers, isMemberBottomSheetToucehd
= true) }; alternatively, if bottomSheetSelectedMembers can be changed to a Set
at the state level, update the state type and use constant-time
contains/add/remove on that Set in onBottomSheetMemberChanged.
- Line 146: The filter uses "in" against a List causing O(n^2) behavior when
checking membership; convert the membership collection to a Set first and use
that for O(1) lookups. For example, in the ProductPartyListViewModel where
newSelectedMembers is computed, build a Set from
uiState.value.bottomSheetSelectedMembers (e.g., val selectedSet =
uiState.value.bottomSheetSelectedMembers.toSet()) and then use
uiState.value.displayMembers.filter { it in selectedSet } so membership checks
are O(1).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bf196957-560f-4669-b8f8-17f9cb039ca8

📥 Commits

Reviewing files that changed from the base of the PR and between dcce33e and 424ffa5.

📒 Files selected for processing (4)
  • app/src/main/java/com/poti/android/core/designsystem/component/bottomsheet/MemberSelectBottomSheet.kt
  • app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListScreen.kt
  • app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListViewModel.kt
  • app/src/main/java/com/poti/android/presentation/party/product/partylist/model/Contracts.kt
💤 Files with no reviewable changes (1)
  • app/src/main/java/com/poti/android/core/designsystem/component/bottomsheet/MemberSelectBottomSheet.kt

@doyeon0307
doyeon0307 requested review from cmj7271 and jyvnee June 13, 2026 11:43
@doyeon0307 doyeon0307 moved this from To-do to In review in POTI-ANDROID Jun 13, 2026

@cmj7271 cmj7271 left a comment

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.

멋져용 수고하셨습니닷

@jyvnee jyvnee left a comment

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.

수고햇서~~~~

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
app/src/main/java/com/poti/android/presentation/party/product/partylist/model/Contracts.kt (1)

26-26: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Compose 상태의 컬렉션 안정성을 보장해 주세요.

이번 변경으로 UiState에 일반 List<Member>가 추가되었습니다. Compose에서 List는 불안정 타입으로 판단될 수 있어, 바텀시트 선택 상태가 변경될 때 관련 UI에 불필요한 리컴포지션이 발생할 수 있습니다. 프로젝트에서 지원한다면 ImmutableList<Member>persistentListOf()를 사용하거나, Member 및 컬렉션의 불변성을 보장하는 안정적인 래퍼를 적용해 주세요.

As per path instructions, List나 일반 클래스를 State로 사용할 때는 불필요한 리컴포지션을 막기 위해 @Immutable 또는 @Stable 사용을 검토해야 합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@app/src/main/java/com/poti/android/presentation/party/product/partylist/model/Contracts.kt`
at line 26, Update the UiState property bottomSheetSelectedMembers to use an
immutable collection type such as ImmutableList<Member>, initialized with
persistentListOf(). If project support prevents that, apply an appropriate
`@Immutable` or `@Stable` wrapper that guarantees Member and collection
immutability, while preserving the existing empty-list default and state
behavior.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@app/src/main/java/com/poti/android/presentation/party/product/partylist/model/Contracts.kt`:
- Line 26: Update the UiState property bottomSheetSelectedMembers to use an
immutable collection type such as ImmutableList<Member>, initialized with
persistentListOf(). If project support prevents that, apply an appropriate
`@Immutable` or `@Stable` wrapper that guarantees Member and collection
immutability, while preserving the existing empty-list default and state
behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 48559e9c-c052-42f4-9df7-5d249f8e62ab

📥 Commits

Reviewing files that changed from the base of the PR and between 424ffa5 and 9961226.

📒 Files selected for processing (3)
  • app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListScreen.kt
  • app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListViewModel.kt
  • app/src/main/java/com/poti/android/presentation/party/product/partylist/model/Contracts.kt
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListScreen.kt
  • app/src/main/java/com/poti/android/presentation/party/product/partylist/ProductPartyListViewModel.kt

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown

Ktlint check passed.

Run: https://github.com/team-poti/POTI-ANDROID/actions/runs/29725470375

@doyeon0307
doyeon0307 merged commit e90fb17 into develop Jul 20, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in POTI-ANDROID Jul 20, 2026
@doyeon0307
doyeon0307 deleted the refactor/#153-member-select-bottomsheet branch July 20, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Refactor] 멤버 선택 바텀시트 리팩토링

3 participants