-
Notifications
You must be signed in to change notification settings - Fork 269
Feat/connect search ff #4638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feat/connect search ff #4638
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR connects a feature flag for improved search functionality, enabling control over when the search improvements feature is released to users. The key change is switching from a development-only feature to one that can be remotely controlled via Firebase.
Key Changes:
- Enabled Firebase remote flag control for the
search_imporvementsfeature - Removed unused
languageparameter from autocomplete search API - Refactored episode row ViewModel to use shared StateFlow caching instead of assisted injection
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Feature.kt | Enabled Firebase remote control for search improvements feature flag |
| AutoCompleteSearchService.kt | Removed unused language query parameter from autocomplete endpoint |
| ImprovedSearchManagerImpl.kt | Updated autocomplete search call to remove language parameter |
| ImprovedSearchEpisodeResultRow.kt | Refactored ViewModel from assisted injection to cached StateFlow pattern |
| SearchHandler.kt | Added distinctUntilChanged() operators to prevent unnecessary recompositions |
| CHANGELOG.md | Added entries for search-related features and improvements |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| ), | ||
| IMPROVED_SEARCH_RESULTS( | ||
| key = "search_improvements", | ||
| title = "Improved search results", |
Copilot
AI
Oct 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'imporvements' to 'improvements' in feature flag name.
| @HiltViewModel(assistedFactory = ImprovedEpisodeRowViewModel.Factory::class) | ||
| class ImprovedEpisodeRowViewModel @AssistedInject constructor( | ||
| podcastManager: PodcastManager, | ||
| @HiltViewModel() |
Copilot
AI
Oct 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty parentheses are unnecessary for the @hiltviewmodel annotation. Remove () to follow Kotlin annotation conventions.
| @HiltViewModel() | |
| @HiltViewModel |
| val changedEpisode = episode.copy( | ||
| playedUpToModified = if (playbackState.episodeUuid == episodeUuid) { | ||
| System.currentTimeMillis() | ||
| } else { | ||
| episode.playedUpToModified | ||
| }, | ||
| ).also { | ||
| val isPlaying = playbackState.episodeUuid == episodeUuid && playbackState.state == PlaybackState.State.PLAYING | ||
| it.playing = isPlaying | ||
| it.playedUpToMs = if (playbackState.episodeUuid == episodeUuid) { | ||
| playbackState.positionMs | ||
| } else { | ||
| episode.playedUpToMs | ||
| } | ||
| it.durationMs = if (playbackState.episodeUuid == episodeUuid) { | ||
| playbackState.durationMs | ||
| } else { | ||
| episode.durationMs | ||
| } | ||
| if (isPlaying) { | ||
| it.playingStatus = EpisodePlayingStatus.IN_PROGRESS | ||
| } | ||
| } |
Copilot
AI
Oct 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repeated condition playbackState.episodeUuid == episodeUuid appears multiple times. Extract this to a variable (e.g., val isCurrentEpisode = playbackState.episodeUuid == episodeUuid) to improve readability and reduce duplication.
Description
Connects the FF flag
search_imporvementsThis will give us control over when to enable the feature for users.
Fixes https://linear.app/a8c/issue/PCDROID-211/create-ff-for-improved-results
Testing Instructions
There's nothing to test here