Skip to content

feat: Add StarredScreen to display starred repositories#13

Merged
TheRealAshik merged 1 commit into
developfrom
feature/starred-screen-3691899229925730222
May 16, 2026
Merged

feat: Add StarredScreen to display starred repositories#13
TheRealAshik merged 1 commit into
developfrom
feature/starred-screen-3691899229925730222

Conversation

@TheRealAshik
Copy link
Copy Markdown
Owner

Added the Starred screen which uses GitHubApiClient.getStarredRepos to show the list of the user's starred repositories. It is now accessible via the Profile screen using the "Starred" navigation row.


PR created automatically by Jules for task 3691899229925730222 started by @TheRealAshik

- Created `StarredScreen` and `StarredViewModel` to display user's starred repos.
- Updated `ProfileScreen` to wire the navigation to the new Starred route.
- Updated `App.kt` to define the new `Route.Starred`.
- Added string resource `starred_title`.
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new 'Starred' screen to the application, enabling users to view their starred repositories. The changes include new UI components, a dedicated ViewModel, and updated navigation logic. Key feedback points include addressing a potential resource leak caused by direct ViewModel instantiation in the navigation graph, sharing the GitHubApiClient instance across the app for efficiency, adding unique keys to the LazyColumn for better performance, and moving hardcoded error messages to string resources.

}
composable<Route.Starred> {
StarredScreen(
viewModel = StarredViewModel(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Instantiating the ViewModel directly inside the composable block causes a new instance to be created on every recomposition. Furthermore, since it's not obtained through a ViewModelStoreOwner (e.g., using viewModel()), its onCleared() method will never be called, leading to a resource leak of the HttpClient inside GitHubApiClient. Consider using a proper ViewModel provider that respects the navigation backstack lifecycle.

import kotlinx.coroutines.launch

class StarredViewModel : ViewModel() {
private val apiClient = GitHubApiClient(createTokenStorage())
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Creating a new GitHubApiClient (and thus a new HttpClient) inside every ViewModel is inefficient. HttpClient is a heavy resource that should be shared across the application. Consider injecting a shared instance of the API client or the HTTP client itself.

contentPadding = PaddingValues(vertical = Dimens.SpacingMedium),
verticalArrangement = Arrangement.spacedBy(Dimens.SpacingMedium)
) {
items(state.starredRepos) { repo ->
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It is recommended to provide a unique key for items in a LazyColumn. This helps Compose maintain the state of items correctly during recompositions and list updates, improving performance.

Suggested change
items(state.starredRepos) { repo ->
items(items = state.starredRepos, key = { it.id }) { repo ->

}
)
}
.onFailure { _uiState.value = StarredUiState.Error(it.message ?: "Unknown error") }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The error message "Unknown error" is hardcoded. It should be moved to a string resource to support internationalization.

@TheRealAshik TheRealAshik merged commit 599eb05 into develop May 16, 2026
3 of 4 checks passed
@TheRealAshik TheRealAshik deleted the feature/starred-screen-3691899229925730222 branch May 16, 2026 08:24
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