Summary
In the new home feed mode, category filter chips can all appear selected at the same time when the filters do not have stable IDs.
Context
This was reported by Codex on PR #61:
#61 (comment)
The review thread is currently unresolved, although it is marked outdated because the diff anchor moved after later commits.
Current behavior
FeedSection.kt determines the selected chip with this comparison:
isSelect = selectedFilter?.id == filter.id
However, the home mock category filters are currently created with id = null:
FilterButtonData(id = null, name = "전체", imageUrl = null)
FilterButtonData(id = null, name = "인기", imageUrl = null)
FilterButtonData(id = null, name = "해석공유", imageUrl = null)
When legacyMode = false, the filter row is visible. Because every filter has id = null, the selected-state comparison becomes null == null for every chip, so multiple chips can render as selected at the same time.
Expected behavior
Only the currently selected filter chip should render as selected.
Relevant files
app/src/main/java/com/lyrics/feelin/presentation/view/home/component/FeedSection.kt
app/src/main/java/com/lyrics/feelin/presentation/view/home/HomeViewModel.kt
app/src/main/java/com/lyrics/feelin/core/designsystem/component/FilterButton.kt
app/src/main/java/com/lyrics/feelin/presentation/view/home/component/FeedTabState.kt
Suggested direction
Use a stable identity for home category filters instead of comparing nullable IDs directly. Possible options:
- compare the selected
FilterButtonData object/value directly when category filters are value-based;
- introduce a stable key/type for category filters;
- split the home category filter model from the artist filter model if their identity semantics differ.
The important part is that filters without server IDs should still have a stable UI selection identity.
Summary
In the new home feed mode, category filter chips can all appear selected at the same time when the filters do not have stable IDs.
Context
This was reported by Codex on PR #61:
#61 (comment)
The review thread is currently unresolved, although it is marked outdated because the diff anchor moved after later commits.
Current behavior
FeedSection.ktdetermines the selected chip with this comparison:However, the home mock category filters are currently created with
id = null:When
legacyMode = false, the filter row is visible. Because every filter hasid = null, the selected-state comparison becomesnull == nullfor every chip, so multiple chips can render as selected at the same time.Expected behavior
Only the currently selected filter chip should render as selected.
Relevant files
app/src/main/java/com/lyrics/feelin/presentation/view/home/component/FeedSection.ktapp/src/main/java/com/lyrics/feelin/presentation/view/home/HomeViewModel.ktapp/src/main/java/com/lyrics/feelin/core/designsystem/component/FilterButton.ktapp/src/main/java/com/lyrics/feelin/presentation/view/home/component/FeedTabState.ktSuggested direction
Use a stable identity for home category filters instead of comparing nullable IDs directly. Possible options:
FilterButtonDataobject/value directly when category filters are value-based;The important part is that filters without server IDs should still have a stable UI selection identity.