Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.LinearProgressIndicator
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
Expand Down Expand Up @@ -90,7 +91,8 @@ data class ConversationListTopBarState(
val avatarUrl: String?,
val credentials: String,
val showFilterActive: Boolean,
val showThreadsButton: Boolean
val showThreadsButton: Boolean,
val isSearchLoading: Boolean = false
)

@Suppress("LongParameterList")
Expand Down Expand Up @@ -133,6 +135,7 @@ fun ConversationListTopBar(
)
is TopBarMode.SearchActive -> TopBarSearchActiveContent(
query = mode.query,
isLoading = state.isSearchLoading,
onQueryChange = actions.onSearchQueryChange,
onSearchClose = actions.onSearchClose,
focusRequester = focusRequester
Expand Down Expand Up @@ -256,6 +259,7 @@ private fun IdleSearchBarActions(
@Composable
private fun TopBarSearchActiveContent(
query: String,
isLoading: Boolean,
onQueryChange: (String) -> Unit,
onSearchClose: () -> Unit,
focusRequester: FocusRequester
Expand Down Expand Up @@ -301,7 +305,14 @@ private fun TopBarSearchActiveContent(
),
windowInsets = WindowInsets(0)
)
HorizontalDivider()
if (isLoading) {
LinearProgressIndicator(
modifier = Modifier.fillMaxWidth(),
color = MaterialTheme.colorScheme.primary
)
} else {
HorizontalDivider()
}
}
LaunchedEffect(Unit) { focusRequester.requestFocus() }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ fun ConversationsListScreen(
avatarUrl = avatarUrl,
credentials = state.credentials,
showFilterActive = showFilterActive,
showThreadsButton = showThreadsButton
showThreadsButton = showThreadsButton,
isSearchLoading = isSearchLoading
),
actions = ConversationListTopBarActions(
onSearchQueryChange = { viewModel.setSearchQuery(it) },
Expand Down
Loading