compact filter row with bottom sheet for source/follows/sort

Replaces the two-row, mixed-control filter UI under the search bar with a
single segmented row for scope (All/People/Notes) and a Tune icon button
that opens a ModalBottomSheet containing Source, Follows-only, and Sort
controls. A primary-color dot on the icon indicates non-default filter
state.

Also renames SearchSortOrder.DEFAULT_EVENT/DEFAULT_PEOPLE to
EVENT_DEFAULT/PEOPLE_DEFAULT for consistency with EVENT_OPTIONS/
PEOPLE_OPTIONS, and routes the sheet's reset button through these
canonical constants so the UI default cannot drift from the ViewModel.
This commit is contained in:
davotoula
2026-04-23 14:17:42 +02:00
parent 3b0bf07e58
commit 458d9bcbab
5 changed files with 208 additions and 85 deletions
@@ -84,10 +84,10 @@ class AdvancedSearchBarState(
val noteResults: StateFlow<ImmutableList<Event>> = _noteResults.asStateFlow()
// Sort orders
private val _eventSortOrder = MutableStateFlow(SearchSortOrder.DEFAULT_EVENT)
private val _eventSortOrder = MutableStateFlow(SearchSortOrder.EVENT_DEFAULT)
val eventSortOrder: StateFlow<SearchSortOrder> = _eventSortOrder.asStateFlow()
private val _peopleSortOrder = MutableStateFlow(SearchSortOrder.DEFAULT_PEOPLE)
private val _peopleSortOrder = MutableStateFlow(SearchSortOrder.PEOPLE_DEFAULT)
val peopleSortOrder: StateFlow<SearchSortOrder> = _peopleSortOrder.asStateFlow()
// Derived sorted results
@@ -266,8 +266,8 @@ class AdvancedSearchBarState(
_peopleResults.value = persistentListOf()
_noteResults.value = persistentListOf()
_relayStates.value = persistentListOf()
_eventSortOrder.value = SearchSortOrder.DEFAULT_EVENT
_peopleSortOrder.value = SearchSortOrder.DEFAULT_PEOPLE
_eventSortOrder.value = SearchSortOrder.EVENT_DEFAULT
_peopleSortOrder.value = SearchSortOrder.PEOPLE_DEFAULT
activeSubIds.value = emptySet()
eventDeduplicator.clear()
}
@@ -34,7 +34,7 @@ enum class SearchSortOrder(
companion object {
val EVENT_OPTIONS = listOf(RELEVANCE, NEWEST, POPULAR)
val PEOPLE_OPTIONS = listOf(NAME_AZ, NAME_ZA)
val DEFAULT_EVENT = NEWEST
val DEFAULT_PEOPLE = NAME_AZ
val EVENT_DEFAULT = NEWEST
val PEOPLE_DEFAULT = NAME_AZ
}
}