Skip to content

Conversation

@AndrewCheung360
Copy link
Member

@AndrewCheung360 AndrewCheung360 commented Sep 26, 2025

Overview

Implemented Basic Auth Screens (Sign In, Profile) for testing

Changes Made

  • Implemented barebones SignIn Screen to test google sign in
  • Implemented barebones Profile Screen to test sign out
  • Minor change to HomeScreen to import view model

Test Coverage

  • See recording below

Next Steps

  • Navigation integration

Related PRs or Issues

Screenshots

Screen.Recording.2025-09-26.at.3.32.38.PM.mov

Notes

  • Ignore the gradle or strings.xml changes (those are handled in related PR part 1)
  • Check andrew/google-auth branch for full change that spans the PRs

@AndrewCheung360 AndrewCheung360 added the enhancement New feature or request label Sep 26, 2025
@AndrewCheung360 AndrewCheung360 self-assigned this Sep 26, 2025
Copy link

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 implements basic authentication screens for Google Sign-In functionality, adding SignIn and Profile screens to test authentication flow.

  • Added new SignInScreen with Google Sign-In button and error handling
  • Added ProfileScreen displaying user information and sign-out functionality
  • Updated dependencies to include Firebase authentication and credential manager libraries

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
gradle/libs.versions.toml Added Firebase, credential manager, and Google ID dependencies
app/src/main/res/values/strings.xml Added Google OAuth client ID configuration
app/src/main/java/com/cornellappdev/hustle/ui/screens/profile/ProfileScreen.kt New profile screen with user info display and sign-out functionality
app/src/main/java/com/cornellappdev/hustle/ui/screens/onboarding/SignInScreen.kt New sign-in screen with Google authentication button
app/src/main/java/com/cornellappdev/hustle/ui/screens/home/HomeScreen.kt Added missing import for HomeScreenViewModel
app/build.gradle.kts Added Firebase and authentication dependencies with organized comments

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -1,3 +1,4 @@
<resources>
<string name="app_name">Hustle</string>
<string name="default_web_client_id">1054767037583-oh008pkkqev5veggoa896b8lj3e4hd86.apps.googleusercontent.com</string>
Copy link

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

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

The Google OAuth client ID should not be hardcoded in the repository. Consider using build variants or environment variables to manage sensitive configuration data, especially for production builds.

Suggested change
<string name="default_web_client_id">1054767037583-oh008pkkqev5veggoa896b8lj3e4hd86.apps.googleusercontent.com</string>
<string name="default_web_client_id">${GOOGLE_OAUTH_CLIENT_ID}</string>

Copilot uses AI. Check for mistakes.
Copy link

@zachseidner1 zachseidner1 left a comment

Choose a reason for hiding this comment

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

Nice work overall, but some questions about ProfileScreen parameters


@Composable
fun SignInScreen(
signInWithGoogle: () -> Unit,

Choose a reason for hiding this comment

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

nit: the name onGoogleSignInButtonClick sort of makes the UI dumber, and just more closely follows standard naming conventions

signInWithGoogle: () -> Unit,
isLoading: Boolean,
errorMessage: String?,
clearError: () -> Unit,

Choose a reason for hiding this comment

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

nit: same thing here this could be called onDismissError or something

Comment on lines +44 to +48
class SignInErrorMessageProvider : PreviewParameterProvider<String?> {
override val values = sequenceOf(
null,
"Sign in failed. Please sign in with your Cornell email"
)

Choose a reason for hiding this comment

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

this makes me happy to see you are using this!


@Composable
fun ProfileScreen(
user: User?,

Choose a reason for hiding this comment

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

in what case would we navigate to the profile screen with a null user? I feel like this should be non-null?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh yeah, good point. I forgot that for hustle, we're enforcing people to sign up unlike some of our other apps.

fun ProfileScreen(
user: User?,
onSignOut: () -> Unit,
isLoading: Boolean,

Choose a reason for hiding this comment

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

This name is unclear, I think ifSignOutLoading would be much better. At first I thought you meant that the whole screen could be loading here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, will change

@AndrewCheung360 AndrewCheung360 merged commit 9e40550 into main Oct 1, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants