Skip to content

fix(onboarding): restore search/OPML suggestions handoff loader and seed filtering - #960

Merged
ashwkun merged 3 commits into
masterfrom
fix/onboarding-search-suggestions-handoff
Aug 7, 2026
Merged

fix(onboarding): restore search/OPML suggestions handoff loader and seed filtering#960
ashwkun merged 3 commits into
masterfrom
fix/onboarding-search-suggestions-handoff

Conversation

@ashwkun

@ashwkun ashwkun commented Aug 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Fix suggestions loading gate so search/OPML isAiLoading / isSynthesizing show a real loader instead of an empty “No suggestions yet” state.
  • Clear stale curriculum on continue/back; filter seed picks out of similar-show lanes; do not auto-select recommendations on search/OPML.
  • Tighten CTAs (“Continue with N”, “Start without adding” / “Add N & start”) and structured loader copy; match FeedMediaCard bottom art clip.

Listener impact

What changes in the user’s life

After choosing shows in “I know my shows” (or OPML), continue now shows a clear “subscribed → finding more” loading screen, then optional similar shows that aren’t already picked — without stale cards flashing on back.

Test plan

  • Search onboarding: pick shows → Continue → loader (“Subscribed to N shows”) → suggestions without seed cards checked
  • Tap no extras → CTA “Start without adding”; pick extras → “Add N & start”
  • Back from suggestions → search picks preserved, no stale suggestion flash on re-enter
  • OPML path: same loader/filter/no auto-select behavior
  • Genre/AI suggestions still auto-select / “Subscribe & start” as before
  • Suggestion cards show curved art bottom corners like home/explore

…eed filtering

Show a real loading state while similar shows fetch, clear stale rows on back, exclude already-picked seeds from lanes, and tighten CTA/loader copy.
@ashwkun ashwkun added the user-impact-medium Noticeable but not headline — include in README when space allows label Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ashwkun, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 52 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9cd8b571-0f77-4b16-bb74-c1f8a322840e

📥 Commits

Reviewing files that changed from the base of the PR and between 41122dd and fcb676d.

📒 Files selected for processing (6)
  • feature/onboarding/README.md
  • feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/OnboardingSuggestionsPresentation.kt
  • feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/OnboardingViewModelAi.kt
  • feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/OnboardingViewModelSearch.kt
  • feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/OnboardingViewModelSimilarShows.kt
  • feature/onboarding/src/test/java/cx/aswin/boxlore/feature/onboarding/OnboardingSuggestionsPresentationTest.kt
📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Improved onboarding suggestions with clearer loading messages and context-sensitive completion actions.
    • Filters suggested shows to avoid duplicates with selected or imported shows.
    • Preserves existing selections while preventing automatically suggested shows from being selected.
    • Added cleaner back-navigation behavior that clears temporary suggestion results when appropriate.
    • Updated suggestion cards with refined artwork clipping and gradient presentation.
  • UI Improvements

    • Renamed the onboarding completion action to “Continue with (…)” for non-AI flows.
  • Bug Fixes

    • Improved cleanup of suggestion loading, error, and result states during navigation.

Walkthrough

Onboarding suggestions now use shared presentation helpers, track and filter search or OPML seeds, avoid automatic recommendation subscriptions, clear suggestion state on back navigation, and update loading copy, CTA labels, artwork clipping, documentation, and tests.

Changes

Onboarding suggestion flow

Layer / File(s) Summary
Suggestion presentation and state contracts
feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/OnboardingSuggestionsPresentation.kt, feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/OnboardingUiModels.kt, feature/onboarding/src/test/.../OnboardingSuggestionsPresentationTest.kt
Added shared loading, error, filtering, loading-copy, CTA, back-navigation, and cleanup logic. Added suggestionSeedCount state and unit tests.
Seed-aware recommendation generation
feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/OnboardingViewModelSearch.kt
Search and OPML flows now track seed IDs and counts, reset suggestion state, exclude seeds from results, and stop auto-selecting recommendations.
Suggestion screen and navigation integration
feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/AiSuggestionsScreen.kt, feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/OnboardingViewModelAi.kt, feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/SearchOnboardingScreen.kt, feature/onboarding/README.md
Screens use presentation helpers for loading states and CTA labels. Back navigation clears suggestion payloads when required. The standard completion label and onboarding documentation were updated.
Suggestion card artwork rendering
feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/AiSuggestionCards.kt
Artwork and gradient rendering now use a shared clipped container with 16.dp bottom corners.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant SearchOnboardingScreen
  participant OnboardingViewModelSearch
  participant OnboardingSuggestionsPresentation
  participant AiSuggestionsScreen

  User->>SearchOnboardingScreen: Start search or OPML suggestions
  SearchOnboardingScreen->>OnboardingViewModelSearch: Generate recommendations
  OnboardingViewModelSearch->>OnboardingSuggestionsPresentation: Reset state and apply seed filtering
  OnboardingSuggestionsPresentation-->>OnboardingViewModelSearch: Return presentation state
  OnboardingViewModelSearch-->>AiSuggestionsScreen: Update suggestion state
  AiSuggestionsScreen->>OnboardingSuggestionsPresentation: Request loading copy and CTA label
  OnboardingSuggestionsPresentation-->>AiSuggestionsScreen: Return presentation text
  User->>AiSuggestionsScreen: Navigate back
  AiSuggestionsScreen->>OnboardingViewModelSearch: Request navigation
Loading

Possibly related PRs


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (3 errors)

Check name Status Explanation Resolution
Title check ❌ Error The title uses the required Conventional Commit format and imperative mood, but it exceeds the approximate 72-character limit at 82 characters. Shorten the title to approximately 72 characters or fewer while preserving the main change.
Unresolved Review Threads ❌ Error Two listed review threads remain unaddressed: tests do not call isError, and withClearedSuggestionPayload does not clear reachedSuggestionsVia*Flow flags. Add isError tests, clear all three suggestion-flow flags in the cleanup helper, and mark both review threads resolved or explicitly dismissed with rationale.
Jvm Tests For Changed Logic ❌ Error The PR adds JVM tests for most pure helpers, but it does not test the new isError branch or the changed search/OPML ViewModel success and error paths. Add hermetic JVM regression tests for isError true/false and search/OPML recommendation flows, including empty results, API failure, seed filtering, and no auto-selection.
✅ Passed checks (6 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the onboarding loader, filtering, CTA, state-clearing, UI, and test changes in the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Architecture Compliance ✅ Passed ARCHITECTURE.md rules remain satisfied: the PR changes only onboarding, adds no feature imports, PostHog, DI, PlaybackRepository/AppContainer construction, or identity/storage changes; dependencies...
Module Readme Updated ✅ Passed The PR changes production Kotlin in feature/onboarding/src/main, and feature/onboarding/README.md is modified in the same commit with matching onboarding documentation updates.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
  • 🛠️ update changelog

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Extract shared launchSimilarShowsFetch so the search and OPML handoffs no longer trip the new-code duplication gate.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/OnboardingViewModelSearch.kt (1)

293-321: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Add hermetic ViewModel tests for both seed handoffs.

The new presentation-helper tests do not execute generateRecommendationsFromSearch or generateRecommendationsFromOpml. Add JVM tests with fakes that verify seed subscription state, seed-row filtering, no automatic recommendation selection, retry reset behavior, and backend error behavior.

As per coding guidelines, production ViewModel changes must add or extend hermetic JVM tests under src/test.

Also applies to: 356-372, 397-427, 457-473

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/OnboardingViewModelSearch.kt`
around lines 293 - 321, Add hermetic JVM tests under src/test covering both
generateRecommendationsFromSearch and generateRecommendationsFromOpml using
fakes. Verify seed subscription state, filtering seed rows, no automatic
recommendation selection, retry-state reset behavior, and backend error handling
for each handoff path.

Sources: Coding guidelines, Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/OnboardingSuggestionsPresentation.kt`:
- Around line 103-117: Update withClearedSuggestionPayload to reset all
reachedSuggestionsVia*Flow flags, including the search, OPML, and AI flow state,
alongside the existing suggestion payload fields. Add a regression test covering
a cleared seed flow followed by an AI suggestions transition, and verify
loadingCopy and finishCtaLabel use the AI-flow behavior rather than stale
seed-flow behavior.

In
`@feature/onboarding/src/test/java/cx/aswin/boxlore/feature/onboarding/OnboardingSuggestionsPresentationTest.kt`:
- Line 11: Add JVM coverage in OnboardingSuggestionsPresentationTest for
OnboardingSuggestionsPresentation.isError, asserting true for errors without
content and validating behavior for errors containing existing curriculum or
chart content; follow the test class’s existing setup and assertion patterns.

---

Outside diff comments:
In
`@feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/OnboardingViewModelSearch.kt`:
- Around line 293-321: Add hermetic JVM tests under src/test covering both
generateRecommendationsFromSearch and generateRecommendationsFromOpml using
fakes. Verify seed subscription state, filtering seed rows, no automatic
recommendation selection, retry-state reset behavior, and backend error handling
for each handoff path.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4f72e258-5bd0-4687-9e43-c3ca924dd012

📥 Commits

Reviewing files that changed from the base of the PR and between b576d6a and 41122dd.

📒 Files selected for processing (9)
  • feature/onboarding/README.md
  • feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/AiSuggestionCards.kt
  • feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/AiSuggestionsScreen.kt
  • feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/OnboardingSuggestionsPresentation.kt
  • feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/OnboardingUiModels.kt
  • feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/OnboardingViewModelAi.kt
  • feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/OnboardingViewModelSearch.kt
  • feature/onboarding/src/main/java/cx/aswin/boxlore/feature/onboarding/SearchOnboardingScreen.kt
  • feature/onboarding/src/test/java/cx/aswin/boxlore/feature/onboarding/OnboardingSuggestionsPresentationTest.kt

Move similar-shows fetch into its own file to stay under TooManyFunctions, clear suggestion-flow flags when leaving search/OPML suggestions, and cover isError.
@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

@ashwkun
ashwkun merged commit f199202 into master Aug 7, 2026
6 checks passed
@ashwkun
ashwkun deleted the fix/onboarding-search-suggestions-handoff branch August 7, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

user-impact-medium Noticeable but not headline — include in README when space allows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant