Skip to content

Commit

Permalink
Allow search error message to be collapsed.
Browse files Browse the repository at this point in the history
  • Loading branch information
lamba92 committed Feb 2, 2024
1 parent 84252b3 commit 971d8ee
Showing 1 changed file with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,17 +306,27 @@ class PackageListBuilder(
attributes: List<String> = emptyList(),
additionalContent: PackageListItem.Header.AdditionalContent.VariantsText? = null,
) {
val headerState = when (headerCollapsedStates[headerId]) {
TargetState.OPEN -> PackageListItem.Header.State.OPEN
else -> PackageListItem.Header.State.CLOSED
}
addHeader(
title = PackageSearchBundle.message("packagesearch.ui.toolwindow.tab.packages.searchResults"),
id = headerId,
state = when (headerCollapsedStates[headerId]) {
TargetState.OPEN -> PackageListItem.Header.State.OPEN
else -> PackageListItem.Header.State.CLOSED
},
state = headerState,
attributes = attributes,
additionalContent = additionalContent,
)
items.add(PackageListItem.SearchError(id = PackageListItem.SearchError.Id(headerId.moduleIdentity, headerId)))
if (headerState == PackageListItem.Header.State.OPEN) {
items.add(
PackageListItem.SearchError(
id = PackageListItem.SearchError.Id(
headerId.moduleIdentity,
headerId
)
)
)
}
}

private fun addFromSearchQueryWithVariants(
Expand Down

0 comments on commit 971d8ee

Please sign in to comment.