diff --git a/app/src/main/kotlin/me/eternal/purrfectsnap/ui/manager/pages/features/FeaturesRootSection.kt b/app/src/main/kotlin/me/eternal/purrfectsnap/ui/manager/pages/features/FeaturesRootSection.kt index ca1ad21e..762f191e 100644 --- a/app/src/main/kotlin/me/eternal/purrfectsnap/ui/manager/pages/features/FeaturesRootSection.kt +++ b/app/src/main/kotlin/me/eternal/purrfectsnap/ui/manager/pages/features/FeaturesRootSection.kt @@ -134,7 +134,10 @@ class FeaturesRootSection : Routes.Route() { val containers = mutableMapOf>() fun queryContainerRecursive(container: ConfigContainer) { container.properties.forEach { - if (it.key.dataType.type == DataProcessors.Type.CONTAINER) { + if ( + it.key.dataType.type == DataProcessors.Type.CONTAINER && + !it.key.params.flags.contains(ConfigFlag.HIDDEN) + ) { containers[it.key.name] = PropertyPair(it.key, it.value) queryContainerRecursive(it.value.get() as ConfigContainer) } @@ -155,10 +158,15 @@ class FeaturesRootSection : Routes.Route() { properties } + private fun isSearchVisibleProperty(propertyKey: PropertyKey<*>): Boolean { + return !propertyKey.params.flags.contains(ConfigFlag.HIDDEN) + } + private data class SearchEntry(val keyword: String, val tokens: List) private fun buildSearchEntries(): List { return allProperties.keys.mapNotNull { key -> + if (!isSearchVisibleProperty(key)) return@mapNotNull null val name = context.translation[key.propertyName()] val description = context.translation[key.propertyDescription()] val tokens = listOfNotNull(name, description, key.name).map { it.trim() }.filter { it.isNotEmpty() } @@ -280,9 +288,11 @@ class FeaturesRootSection : Routes.Route() { composable(SEARCH_FEATURE_ROUTE) { backStackEntry -> backStackEntry.arguments?.getString("keyword")?.let { keyword -> val properties = allProperties.filter { - it.key.name.contains(keyword, ignoreCase = true) || + isSearchVisibleProperty(it.key) && ( + it.key.name.contains(keyword, ignoreCase = true) || context.translation[it.key.propertyName()].contains(keyword, ignoreCase = true) || context.translation[it.key.propertyDescription()].contains(keyword, ignoreCase = true) + ) }.map { PropertyPair(it.key, it.value) } PropertiesView( @@ -1573,7 +1583,7 @@ class FeaturesRootSection : Routes.Route() { val isActiveSearch = isSearchResults || liveSearchQuery.isNotBlank() val globalSearchProperties = remember(enableGlobalSearch) { if (enableGlobalSearch) { - allProperties.map { PropertyPair(it.key, it.value) } + allProperties.filter { isSearchVisibleProperty(it.key) }.map { PropertyPair(it.key, it.value) } } else { emptyList() } diff --git a/common/src/main/assets/lang/en_US.json b/common/src/main/assets/lang/en_US.json index 15c073ef..b02ce834 100644 --- a/common/src/main/assets/lang/en_US.json +++ b/common/src/main/assets/lang/en_US.json @@ -639,6 +639,7 @@ "scope_blacklist": "Everyone except", "events_section_title": "Events", "events_suffix": "events", + "scopes_suffix": "scopes", "no_events_text": "No events added yet", "add_event_dialog_title": "Add Event", "event_type_label": "Event Type", @@ -2984,7 +2985,7 @@ } }, "profile_picture_downloader": { - "button": "Download Profile Picture", + "button": "⬇", "title": "Profile Picture Downloader", "avatar_option": "Avatar", "background_option": "Background" diff --git a/core/src/main/kotlin/me/eternal/purrfectsnap/core/features/impl/downloader/ProfilePictureDownloader.kt b/core/src/main/kotlin/me/eternal/purrfectsnap/core/features/impl/downloader/ProfilePictureDownloader.kt index eab6ca9d..92ef94c8 100644 --- a/core/src/main/kotlin/me/eternal/purrfectsnap/core/features/impl/downloader/ProfilePictureDownloader.kt +++ b/core/src/main/kotlin/me/eternal/purrfectsnap/core/features/impl/downloader/ProfilePictureDownloader.kt @@ -99,4 +99,4 @@ class ProfilePictureDownloader : Feature("ProfilePictureDownloader") { } } } -} +} \ No newline at end of file