Skip to content

Home feed filter chips can all appear selected when filter IDs are null #62

Description

@gdaegeun539

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.

Metadata

Metadata

Assignees

Labels

design디자인 관련 수정feat새로운 기능

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions