Skip to content

Fix searching on iOS 18 - #1544

Merged
GianniCarlo merged 2 commits into
developfrom
fix/search-ios18
May 31, 2026
Merged

GianniCarlo merged 2 commits into
developfrom
fix/search-ios18

Conversation

@GianniCarlo

Copy link
Copy Markdown
Collaborator

Purpose

iOS 18 devices are currently just filtering on-screen items when searching, instead of a real database search

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  • filterContents now takes an optional SimpleItemType? scope (nil = all types), searches originalFileName in addition to title/details, and scopes folders by relativePath BEGINSWITH "<folder>/" for recursive subtree matches.
  • ItemListViewModel debounces query/scope changes (300ms) and calls filterContents; clearing search restores the first paginated browse page. Reorder is guarded by isFiltering.
  • New ContentUnavailableView.search overlay, 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)
}
}
@GianniCarlo
GianniCarlo merged commit 11f9f0a into develop May 31, 2026
1 check passed
@GianniCarlo
GianniCarlo deleted the fix/search-ios18 branch May 31, 2026 19:20
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants