fix(android): search filter bar usable on empty results #1378

Merged
chris merged 1 commit from fix/search-filter-empty-state into main 2026-10-25 15:22:03 +01:00
Owner

Root cause (one sentence)

The report's mechanism — a filter bar living inside the branch the empty state replaces — does not exist in SearchScreen (verified: input + chips are composed unconditionally above the weighted content box, and an empty answer never clobbers the SearchUiState behind them), but it exists verbatim in the Photos timeline, where the screen-level when swapped the whole TimelineGrid (header + search entry + filter chips) for a full-screen MessageBox whenever a filter/scope reload emptied days, leaving only Refresh — which re-runs the same filter.

Changes

  • TimelineScreen: chrome hoisted above the state branch; loading/empty/error bodies moved into the new TimelineStateContent, which fills the content area only. Picker header likewise stays on screen in every state (loading, results, empty, error).
  • SearchScreen: filtered empty answers now show search_no_results_filtered ("Keine Fotos für diesen Filter") instead of blaming the typed words; the empty body stays inside the content box — never a takeover (comment added stating the invariant).
  • Strings de/en/da: search_no_results_filtered.
  • SearchViewModelTest: 2 regression tests — an empty filtered answer keeps query/filters/picker state intact (the state feeding control visibility is independent of result count), and chips still drive new searches after an empty answer (18 → 20 tests).
  • KNOWN_ISSUES.md: ISSUE-204 med/resolved/area:search (ISSUE-203 already claimed by open PR #1377).

Sibling surfaces checked — no identical flaw

PeopleScreen, AlbumListScreen, AlbumDetailScreen, TrashScreen and MapScreen keep their headers/search inputs outside the empty-state branch (or have no on-screen filter bar); the web search page's filters sit above the results section as well.

Validation

rtk ./gradlew :app:testDebugUnitTest (ANDROID_HOME set), run twice on the final tree: 693 tests, 0 failures, 0 errors, 0 skipped.

## Root cause (one sentence) The report's mechanism — a filter bar living inside the branch the empty state replaces — does not exist in `SearchScreen` (verified: input + chips are composed unconditionally above the weighted content box, and an empty answer never clobbers the `SearchUiState` behind them), but it exists verbatim in the Photos timeline, where the screen-level `when` swapped the whole `TimelineGrid` (header + search entry + filter chips) for a full-screen `MessageBox` whenever a filter/scope reload emptied `days`, leaving only *Refresh* — which re-runs the same filter. ## Changes - **TimelineScreen**: chrome hoisted above the state branch; loading/empty/error bodies moved into the new `TimelineStateContent`, which fills the content area only. Picker header likewise stays on screen in every state (loading, results, empty, error). - **SearchScreen**: filtered empty answers now show `search_no_results_filtered` ("Keine Fotos für diesen Filter") instead of blaming the typed words; the empty body stays inside the content box — never a takeover (comment added stating the invariant). - **Strings** de/en/da: `search_no_results_filtered`. - **SearchViewModelTest**: 2 regression tests — an empty filtered answer keeps query/filters/picker state intact (the state feeding control visibility is independent of result count), and chips still drive new searches after an empty answer (18 → 20 tests). - **KNOWN_ISSUES.md**: ISSUE-204 `med`/`resolved`/`area:search` (ISSUE-203 already claimed by open PR #1377). ## Sibling surfaces checked — no identical flaw PeopleScreen, AlbumListScreen, AlbumDetailScreen, TrashScreen and MapScreen keep their headers/search inputs outside the empty-state branch (or have no on-screen filter bar); the web search page's filters sit above the results section as well. ## Validation `rtk ./gradlew :app:testDebugUnitTest` (ANDROID_HOME set), run twice on the final tree: **693 tests, 0 failures, 0 errors, 0 skipped**.
fix(android): search filters stay interactive on empty results
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 3s
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build Android CI image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Deploy review instance (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 5s
Build and Deploy / Android unit tests and debug APK (push) Successful in 3m53s
65b6ee480f
The 0.10.8 report (stuck on an empty filtered result, filter bar
unreachable) was reproduced in code: SearchScreen itself gates nothing —
its input and chips are composed unconditionally above the weighted
content box and an empty answer never clobbers the uiState behind them
(now locked by two SearchViewModel regression tests). The report's
literal mechanism lived in the Photos timeline: the screen-level `when`
swapped the whole TimelineGrid (header + search entry + filter chips)
for a full-screen MessageBox whenever a filter/scope reload emptied
`days`, leaving only Refresh — which re-ran the same filter. The state
bodies now live in TimelineStateContent inside the content area while
the chrome stays composed in every state (loading/empty/error too).

Search empty body with active filters now says what happened
(search_no_results_filtered, de/en/da); ISSUE-204.
chris merged commit a460619cf3 into main 2026-10-25 15:22:03 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
chris/memories!1378
No description provided.