Skip to content

Conversation

@RyanCheung555
Copy link

Overview

  • Created 'Add Favorites' button in the favorites tab
  • Improved user experience when adding favorites by showing a toast instead of dismissing the bottom sheet

Changes Made

  • Created 'AddFavoriteButton' component under components/home
  • Refactored current implementation of Add Favorites bottom sheet to use ModalBottomSheet instead of BottomSheetScaffold
  • Changed the behavior of onItemClick for the AddFavoritesSearchSheet to show a toast when clicking an item to add instead of dismissing the entire sheet for each item

Test Coverage

  • Tested on Medium Phone emulator
  • Opened add favorites tab from home screen and from search bar

Next Steps

  • Work on functional favorites cards
  • Change the ModalBottomSheet to be an entirely new screen as per design
    • Currently using the existing ModalBottomSheet to save time and work on other ecosystem designs, since it is technically functional as is
  • Implement designs for search results (e.g. different icons for eateries vs libraries vs gyms etc.)

Screenshots

Add Favorites Button Screenshot 2026-02-08 at 3 23 50 PM

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

Adds an “Add Favorites” entry point in the Favorites tab and updates the add-favorites flow to use a ModalBottomSheet, keeping the sheet open while confirming additions via toast.

Changes:

  • Introduces an AddFavoriteButton (with new plus icon) and wires it into the Favorites list UI.
  • Refactors the Add Favorites sheet from BottomSheetScaffold to ModalBottomSheet, with ViewModel-backed visibility state.
  • Updates add-item behavior to show a toast confirmation instead of dismissing the sheet per item.

Reviewed changes

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

Show a summary per file
File Description
app/src/main/res/drawable/ic_addition.xml Adds a plus icon used by the new Add Favorites button.
app/src/main/java/com/cornellappdev/transit/ui/viewmodels/HomeViewModel.kt Adds state + setter for controlling Add Favorites sheet visibility.
app/src/main/java/com/cornellappdev/transit/ui/screens/HomeScreen.kt Switches to ModalBottomSheet for Add Favorites and adjusts add-item behavior/toasts.
app/src/main/java/com/cornellappdev/transit/ui/components/home/EcosystemBottomSheetContent.kt Inserts the new Add Favorites button into the Favorites filter list and plumbs callback.
app/src/main/java/com/cornellappdev/transit/ui/components/home/BottomSheetFilterItem.kt Updates label color to use theme tokens for active/inactive states.
app/src/main/java/com/cornellappdev/transit/ui/components/home/AddFavoritesSearchSheet.kt Minor modifier ordering change for layout.
app/src/main/java/com/cornellappdev/transit/ui/components/home/AddFavoriteButton.kt New composable for the “Add Favorites” button with icon + styling.
app/build.gradle.kts Updates build type signing configuration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

onAddFavoriteClick: () -> Unit,
modifier: Modifier = Modifier
) {
Button(
Copy link
Member

Choose a reason for hiding this comment

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

Nit: In the future, would be good to have a general button component eg. NaviButton that you can reuse for any type of button component to reduce redundancy

@AndrewCheung360
Copy link
Member

Would be good to link to figma designs in the PR description for reviewers to reference

),
modifier = modifier
.fillMaxWidth()
.padding(horizontal = 12.dp, vertical = 20.dp)
Copy link
Member

Choose a reason for hiding this comment

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

horizontal padding here doesn't seem necessary if you are giving it fillmaxwidth. Should probably give it any horizontal padding outside of component if necessary

Copy link
Member

Choose a reason for hiding this comment

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

Same thing with vertical padding. If you need padding for this component for the composables inside the button itself, then you should probably use the contentPadding parameter of button

ExperimentalFoundationApi::class,
)
@Composable
fun HomeScreen(
Copy link
Member

Choose a reason for hiding this comment

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

Nit: eventually, we should refactor so that there is something like HomeScreenContent and HomeScreen to separate stuff like viewmodels, so we can make use of previews since using emulator is inefficient

ExperimentalFoundationApi::class,
)
@Composable
fun HomeScreen(
Copy link
Member

@AndrewCheung360 AndrewCheung360 Feb 10, 2026

Choose a reason for hiding this comment

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

Nit: Eventually, we should refactor this composable so that it makes use of some composables because it is way too big 😭

}
}

var editState by remember {
Copy link
Member

Choose a reason for hiding this comment

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

Unsure about the context, but this and the editText seem like things we should refactor to have stored in some sort of view model

@AndrewCheung360
Copy link
Member

Should probably also add screen recording to pr description since some of the functionality involves opening up a modal and showing toasts

@AndrewCheung360
Copy link
Member

Also, make sure to resolve the conflicts before I can give approval for merging

@AndrewCheung360
Copy link
Member

Would also be good to point out that the reviewer should set the ecosystem feature flag for the debug release to true when they are testing in order to see the changes

@AndrewCheung360
Copy link
Member

Overall, nice work! Just some minor changes, and a lot of my comments are just to bring up some potential refactors for the future to keep in mind.

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