Skip to content

Conversation

@WAHID-QANDIL
Copy link
Owner

No description provided.

@WAHID-QANDIL WAHID-QANDIL requested a review from Copilot June 20, 2025 01:49
@WAHID-QANDIL WAHID-QANDIL merged commit 4dd95a3 into main Jun 20, 2025
1 check passed
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 adds a first-launch onboarding flow, updates theme color logic, and overhauls the onboarding screen UI.

  • Renamed onboarding image resources and wired them into the OnBoarding sealed class.
  • Made theme text colors dynamic based on isDark, and updated the black color logic.
  • Rebuilt the onboarding screen layout with a full-screen image, gradient overlay, and typography updates.
  • Added navigation and storage logic to show onboarding on first app launch and persist that state.

Reviewed Changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
app/src/main/java/org/mahd_e_learning_platform/utils/OnBoarding.kt Updated image resource names for onboarding screens.
app/src/main/java/org/mahd_e_learning_platform/ui/theme/Theme.kt Made text and black colors conditional on isDark.
app/src/main/java/org/mahd_e_learning_platform/presentation/screens/onboarding/OnBoarding.kt Reworked layout to a full‐screen image with overlay and updated text styling.
app/src/main/java/org/mahd_e_learning_platform/presentation/navigation/Screen.kt Added ONBOARDING destination to routing.
app/src/main/java/org/mahd_e_learning_platform/presentation/navigation/AppNavigator.kt Registered the onboarding composable in the nav graph.
app/src/main/java/org/mahd_e_learning_platform/presentation/MainActivity.kt Injected SecureTokenStore, added first-launch logic, and navigation.
app/src/main/java/org/mahd_e_learning_platform/data/source/remote/auth/SecureTokenStore.kt Exposed accessFirstLaunchState flow for first-launch.
Comments suppressed due to low confidence (2)

app/src/main/java/org/mahd_e_learning_platform/presentation/MainActivity.kt:63

  • The log tag "isLoggedIn" is reused for printing isFirstLaunch. Use a distinct tag like "isFirstLaunch" to avoid confusion.
                    Log.d("isLoggedIn", "onCreate: $isFirstLaunch")

app/src/main/java/org/mahd_e_learning_platform/data/source/remote/auth/SecureTokenStore.kt:53

  • No unit tests cover accessFirstLaunchState. Add tests to verify the default true value and subsequent updates after saving.
    val accessFirstLaunchState = context.dataStore.data.map { prefs ->

Comment on lines +22 to 26
import androidx.compose.ui.graphics.BlendMode
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.LinearGradient
import androidx.compose.ui.graphics.TileMode
Copy link

Copilot AI Jun 20, 2025

Choose a reason for hiding this comment

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

LinearGradient, BlendMode, and TileMode are imported but not used. Consider removing these imports to clean up the code.

Suggested change
import androidx.compose.ui.graphics.BlendMode
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.LinearGradient
import androidx.compose.ui.graphics.TileMode
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color

Copilot uses AI. Check for mistakes.

override fun onStart() {
super.onStart()
CoroutineScope(Dispatchers.Main).launch {
Copy link

Copilot AI Jun 20, 2025

Choose a reason for hiding this comment

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

Creating a new CoroutineScope inside an Activity can lead to lifecycle leaks. Consider using lifecycleScope.launch instead.

Suggested change
CoroutineScope(Dispatchers.Main).launch {
lifecycleScope.launch {

Copilot uses AI. Check for mistakes.
Comment on lines +92 to +95
CoroutineScope(Dispatchers.Main).launch {
secureTokenStore.saveFirstLaunch(false)
}

Copy link

Copilot AI Jun 20, 2025

Choose a reason for hiding this comment

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

Persisting firstLaunch = false in onStart may mark the app as launched before onboarding completes. Consider saving this flag after the user finishes onboarding.

Suggested change
CoroutineScope(Dispatchers.Main).launch {
secureTokenStore.saveFirstLaunch(false)
}
// Removed logic to save firstLaunch flag here.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants