Skip to content

Fix Recommended tab loading forever when all rows are empty - #2188

Open
AJadkarim wants to merge 2 commits into
damontecres:mainfrom
AJadkarim:fix-recommended-empty-state
Open

AJadkarim wants to merge 2 commits into
damontecres:mainfrom
AJadkarim:fix-recommended-empty-state

Conversation

@AJadkarim

Copy link
Copy Markdown

Description

In the Recommended tab of a library, the loading state only switched to success once a row returned at least one item. If every configured row and the suggestions query came back empty or failed, the tab stayed on the loading spinner indefinitely and the user got no feedback.

This PR updates the loading state as each row completes. The tab now finishes loading as soon as any row has content, or once every row has completed. When all rows complete with no items, it shows an empty state with a film icon and a localized "No media found" message.

The change is split into two commits:

  • Fix recommended loading when all rows are empty: updates the loading state as rows complete, so the tab finishes loading once all row queries are done. Row jobs also rethrow CancellationException instead of reporting it as a row error.
  • Show a message when recommended rows are all empty: adds an EmptyState component and shows it when every row completes with no media items.

Related issues

I could not find an open issue for this case. #1065 ("Suggestions stuck on 'Loading...'") reported a spinner on the single Suggestions row and was fixed separately.

Steps to reproduce:

  1. Create a library with no items (for example, a Movies library pointing to an empty folder).
  2. Open the library and go to the Recommended tab.
  3. The loading spinner never finishes and no message is shown.

Testing

  • Unit tests: 7 tests in TestRecommendedEmptyState cover row loading transitions, content arriving in a later row, empty rows, failures, pending rows, refresh after loading, and empty suggestions. All 7 pass on both commits.
  • ktlint: no new violations.
  • Device: TCL Google TV (Android 14), Jellyfin 10.11.11, debug builds. With v1.1.1, the Recommended tab of an empty Movies library was still showing the spinner after 60 seconds. With this branch, the same tab shows "No media found", and the Recommended tab of a populated Movies library still loads its rows as before.

Screenshots

Recommended tab of an empty library.

Before (v1.1.1, still loading after 60 seconds):

Recommended tab of an empty library stuck on the loading spinner

After (this PR):

Recommended tab of an empty library showing "No media found"

AI or LLM usage

I used AI tools for this change: OpenAI Codex for the initial implementation and the unit tests, Google Gemini (through Antigravity) to split the change into two commits and rebase it onto main, and Anthropic Claude for review. This covers the changes in RecommendedContent.kt, EmptyState.kt, strings.xml and TestRecommendedEmptyState.kt.

I tested the change with the unit tests above, ktlint, and on my TV as described in Testing. I have reviewed and understand the changes in this pull request and take responsibility for them.

Recommended content waited for a non-empty row to report success,
leaving the screen spinning indefinitely when all rows were empty or
failed. Update loading state as rows complete so the view finishes
loading once all query jobs complete.

Assisted-by: codex:gpt-6.1-sol
Assisted-by: agy:gemini-3.8-flash-high
Display an empty state message when all recommended rows finish
loading with no media items. Add an EmptyState component with a
placeholder icon and message so users receive clear visual feedback
instead of an empty screen.

Assisted-by: codex:gpt-6.1-sol
Assisted-by: agy:gemini-3.8-flash-high

This branch has not been deployed

No deployments
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.

1 participant