Skip to content

Fix/misc/clean up toasts #361

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

taghizadlaura
Copy link
Contributor

Clean up the toasts messages (UX oriented)

And task : Clean up the error messages (UX oriented #344

Description

This PR focuses on removing the use of Toast messages across the application and replacing them with Log statements for improved user experience and debugging. It also includes code refactoring to eliminate unnecessary context parameters and handlers, enhancing code clarity and maintainability. I closes issue #343 and #344.

Note: The toasts in the TODOs were not removed because they need to be addressed simultaneously in #346.

Changes

Files

Modified

  • AlertLists.kt: Removed Toast messages in AlertListsScreen and AlertAcceptButtons, replaced with Log statements.
  • CreateAlert.kt: Updated Toast messages in CreateAlertScreen to Log statements.
  • EditAlert.kt: Replaced Toast messages with Log statements in EditAlertScreen.
  • SignIn.kt: Removed context parameters and handlers for Toast messages in SignInScreen and attemptSignIn.
  • SignUp.kt: Cleaned up context parameters and handlers in SignUpScreen and attemptSignUp.
  • ProfileComponents.kt: Removed context parameters and handlers in ProfileSaveButton and related functions.
  • AuthenticationComponents.kt: Enhanced error state handling for email and password input fields.
  • Map.kt: Replaced Toast messages in FetchAlertsAndDrawMarkers with Log statements.
  • CreateProfile.kt: Removed unnecessary context parameters in CreateProfileScreen.

Removed

  • Redundant Toast messages and related context handlers.

Dependencies Added

  • None.

Testing

  • Verified that Log statements function correctly and provide meaningful debugging information.
  • Ensured refactored components operate without errors.
  • Manual testing across different scenarios to validate changes.

Points to Consider

  • Maintains user feedback clarity with appropriate logging.
  • Reduces runtime distractions caused by redundant Toast messages.

@taghizadlaura taghizadlaura added the clean up Clean up of already written code label Dec 20, 2024
@taghizadlaura taghizadlaura self-assigned this Dec 20, 2024
@taghizadlaura taghizadlaura linked an issue Dec 20, 2024 that may be closed by this pull request
3 tasks
Copy link
Contributor

@Harrish92 Harrish92 left a comment

Choose a reason for hiding this comment

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

Summary

Good implementation of the feature that streamlines the user flow.

Important

Code Quality

  • Code quality is consistent with the rest of the project.

Functionality

  • The apps runs as intended.

Testing

  • No tests needed.

Documentation

  • No documentation needed.

Suggestions

  • Read my review comments
  • Remove unused toast text in strings.xml .

Steps before PR approved

  • LGTM

@@ -183,7 +168,6 @@ fun CreateAlertScreen(
else -> null
}
if (errorMessage != null) {
Toast.makeText(context, errorMessage, Toast.LENGTH_SHORT).show()
Copy link
Contributor

Choose a reason for hiding this comment

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

add a Log.d for errorMessage

@@ -177,15 +173,9 @@ fun EditAlertScreen(
else -> null
}
if (errorMessage != null) {
Toast.makeText(context, errorMessage, Toast.LENGTH_SHORT).show()
Copy link
Contributor

Choose a reason for hiding this comment

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

add a Log.d for errorMessage

@coaguila coaguila self-requested a review December 20, 2024 05:31
Copy link
Contributor

@coaguila coaguila left a comment

Choose a reason for hiding this comment

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

Summary

Great last minute cleanup, should make users' experience smoother and lighter without the toasts.

Important (which includes)

Code Quality

LGTM

Functionality

LGTM

Suggestions

Perhaps add the Log.d like Harrishan asked but I feel as if it is a nitpick.

@lazarinibruno lazarinibruno removed the request for review from francelu December 20, 2024 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clean up Clean up of already written code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean up the toasts messages (UX oriented)
3 participants