feat(search): full-text event search from the top bar
A magnifier in each calendar screen's top bar opens a search overlay: type a query and matching events (title, location or description) appear, nearest-to- today first; tapping a result opens its detail. - Data: query the Events table directly with a LIKE selection on title / description / location (wildcards escaped), so search is unbounded in time and filtered provider-side. New SearchProjection + toSearchResult mapper reuse the .ics export's DURATION handling for recurring masters. Hidden calendars are filtered out, mirroring instances(). - SearchViewModel debounces the query (250 ms), needs >= 2 chars, and orders results upcoming-ascending then past-descending. - SearchScreen: autofocused inline field in the top bar, GroupedRow results reusing the agenda row style, idle/empty states. Hosted as a CalendarHost overlay below detail/edit so a tapped result's detail draws on top. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,7 @@ internal class FakeCalendarDataSource : CalendarDataSource {
|
||||
|
||||
var calendarsResult: List<CalendarSource> = emptyList()
|
||||
var instancesResult: (Long, Long) -> List<EventInstance> = { _, _ -> emptyList() }
|
||||
var searchResult: (String) -> List<EventInstance> = { _ -> emptyList() }
|
||||
var eventDetailResult: (Long) -> EventDetail? = { null }
|
||||
var eventColorPaletteResult: (Long) -> List<EventColorOption> = { emptyList() }
|
||||
var exportableEventsResult: List<IcsEvent> = emptyList()
|
||||
@@ -51,6 +52,7 @@ internal class FakeCalendarDataSource : CalendarDataSource {
|
||||
override fun calendars(): List<CalendarSource> = calendarsResult
|
||||
override fun instances(beginMillis: Long, endMillis: Long): List<EventInstance> =
|
||||
instancesResult(beginMillis, endMillis)
|
||||
override fun searchEvents(query: String): List<EventInstance> = searchResult(query)
|
||||
override fun eventDetail(eventId: Long): EventDetail? = eventDetailResult(eventId)
|
||||
override fun eventColorPalette(calendarId: Long): List<EventColorOption> =
|
||||
eventColorPaletteResult(calendarId)
|
||||
|
||||
Reference in New Issue
Block a user