From b2888dfa4013f047c1248661e25d83df40ae1f48 Mon Sep 17 00:00:00 2001 From: Florian Bernard Date: Sun, 23 Nov 2025 11:20:40 +0100 Subject: [PATCH] feat: improve search by normalizing string (#283) * feat: improve search by normalizing string * docs(changelog): correct link reference --------- Co-authored-by: Naveen Singh <36371707+naveensingh@users.noreply.github.com> --- CHANGELOG.md | 3 +++ .../main/kotlin/org/fossify/home/fragments/AllAppsFragment.kt | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da5d12e..31e37aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed +- Search now ignores accents and diacritics ([#282]) ## [1.5.0] - 2025-10-29 ### Changed @@ -89,6 +91,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#182]: https://github.com/FossifyOrg/Launcher/issues/182 [#230]: https://github.com/FossifyOrg/Launcher/issues/230 [#234]: https://github.com/FossifyOrg/Launcher/issues/234 +[#282]: https://github.com/FossifyOrg/Launcher/issues/282 [Unreleased]: https://github.com/FossifyOrg/Launcher/compare/1.5.0...HEAD [1.5.0]: https://github.com/FossifyOrg/Launcher/compare/1.4.0...1.5.0 diff --git a/app/src/main/kotlin/org/fossify/home/fragments/AllAppsFragment.kt b/app/src/main/kotlin/org/fossify/home/fragments/AllAppsFragment.kt index 04ca43e..f43cdbb 100644 --- a/app/src/main/kotlin/org/fossify/home/fragments/AllAppsFragment.kt +++ b/app/src/main/kotlin/org/fossify/home/fragments/AllAppsFragment.kt @@ -200,7 +200,9 @@ class AllAppsFragment( binding.searchBar.onSearchTextChangedListener = { query -> val filtered = - launchers.filter { query.isEmpty() || it.title.contains(query, ignoreCase = true) } + launchers.filter { + query.isEmpty() || it.title.normalizeString().contains(query.normalizeString(), ignoreCase = true) + } getAdapter()?.submitList(filtered) { showNoResultsPlaceholderIfNeeded() }