Skip to content

Conversation

@sztomek
Copy link
Contributor

@sztomek sztomek commented Oct 24, 2025

Description

Connects the FF flag search_imporvements
This will give us control over when to enable the feature for users.

Screenshot 2025-10-24 at 13 10 46

Fixes https://linear.app/a8c/issue/PCDROID-211/create-ff-for-improved-results

Testing Instructions

There's nothing to test here

@sztomek sztomek added this to the 7.101 milestone Oct 24, 2025
@Copilot Copilot AI review requested due to automatic review settings October 24, 2025 11:11
@sztomek sztomek requested a review from a team as a code owner October 24, 2025 11:11
@sztomek sztomek requested review from MiSikora and removed request for a team October 24, 2025 11:11
Copy link
Contributor

Copilot AI left a 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_imporvements feature
  • Removed unused language parameter 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",
Copy link

Copilot AI Oct 24, 2025

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.

Copilot uses AI. Check for mistakes.
@HiltViewModel(assistedFactory = ImprovedEpisodeRowViewModel.Factory::class)
class ImprovedEpisodeRowViewModel @AssistedInject constructor(
podcastManager: PodcastManager,
@HiltViewModel()
Copy link

Copilot AI Oct 24, 2025

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.

Suggested change
@HiltViewModel()
@HiltViewModel

Copilot uses AI. Check for mistakes.
Comment on lines +103 to 125
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
}
}
Copy link

Copilot AI Oct 24, 2025

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant