Repository navigation
Fix searching on iOS 18 - #1544
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Switches item-list search from in-memory filtering of the loaded page to a database-backed query via LibraryService.filterContents, so iOS 18 users actually search the full library rather than just the items currently rendered. Also broadens search semantics (recursive subtree, optional scope, originalFileName field).
Changes:
filterContentsnow takes an optionalSimpleItemType?scope (nil = all types), searchesoriginalFileNamein addition totitle/details, and scopes folders byrelativePath BEGINSWITH "<folder>/"for recursive subtree matches.ItemListViewModeldebounces query/scope changes (300ms) and callsfilterContents; clearing search restores the first paginated browse page. Reorder is guarded byisFiltering.- New
ContentUnavailableView.searchoverlay, generated mock signature update, and added LibraryService tests for recursive/sibling-prefix/global/nil-scope/originalFileName cases.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Shared/Services/LibraryService.swift | Optional scope, recursive subtree predicate, search originalFileName. |
| BookPlayerTests/Services/LibraryServiceTests.swift | New tests for the updated semantics. |
| BookPlayer/Library/ItemList/Models/ItemListSearchScope.swift | Adds itemTypeScope mapping to SimpleItemType?. |
| BookPlayer/Library/ItemList/ItemListViewModel.swift | Debounced DB search, restoreBrowse, reorder guard, isFiltering helper. |
| BookPlayer/Library/ItemList/ItemListView.swift | moveDisabled while filtering; empty-search overlay. |
| BookPlayer/Generated/AutoMockable.generated.swift | Regenerated mock for optional scope. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+168
to
+172
| .overlay { | ||
| if !model.query.isEmpty && model.filteredResults.isEmpty { | ||
| ContentUnavailableView.search(text: model.query) | ||
| } | ||
| } |
matalvernaz
added a commit
to matalvernaz/BookPlayer
that referenced
this pull request
Jun 8, 2026
Brings the fork up to date with TortugaPower develop (14 commits since the TortugaPower#1524/TortugaPower#1491 reconciliation): - iOS 18 search fix (TortugaPower#1544) - last-played widget update after delete (TortugaPower#1545) — widget storage extracted to SharedWidgetStore - total remaining time in chapter context (TortugaPower#1547) - mp3 chapters without CTOC tag + fallback chapter extraction - play specific book via App Intents - prev-chapter button threshold (press-once-to-chapter-start) project.pbxproj: kept the Hummingbird LIBRARY_SEARCH_PATHS, adopted upstream MARKETING_VERSION 5.21.0, kept both the MediaServer group and the new SharedWidgetStore.swift reference. Audio-session recovery and multi-server fork code preserved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
iOS 18 devices are currently just filtering on-screen items when searching, instead of a real database search