Skip to content
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

1214: Add pois to favorites #1461

Merged
merged 11 commits into from
Jun 17, 2024
Merged

1214: Add pois to favorites #1461

merged 11 commits into from
Jun 17, 2024

Conversation

seluianova
Copy link
Contributor

@seluianova seluianova commented May 28, 2024

Short description

Add the ability to save POIs as favorites on device

Proposed changes

  • provide the functionality to add/remove a store to the favorites on the store detail page. save the information on the device
  • display snack bar notification when a favorite has neen added/removed
  • add a "favorite" BottomNavigationBar item
  • add a favorite page that shows store favorites. style similar to the search list

Not included:

  • mark the favorites with the favorites icon on the map

Maybe we could separate this part?
It's taking a while, because I'm not quite sure how to do it yet, if we don't make “Favorites” as a category.
Or I might need some help with that.

UPD. As discussed in the channel, we will implement that separately.

Side effects

Couldn't find any
Not tested on iOS

Resolved issues

Fixes: #1214

@seluianova seluianova linked an issue May 28, 2024 that may be closed by this pull request
@seluianova seluianova changed the title 1214 add pois to favorites 1214: Add pois to favorites May 28, 2024
@seluianova seluianova force-pushed the 1214-add-pois-to-favorites branch 2 times, most recently from a860d16 to ef16ad2 Compare May 29, 2024 09:27
@seluianova seluianova marked this pull request as ready for review May 29, 2024 09:32
Copy link
Member

@ztefanie ztefanie left a comment

Choose a reason for hiding this comment

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

Looks good. Nice job 🚀

Tested on Android, works as expected 👍

frontend/lib/app.dart Outdated Show resolved Hide resolved
frontend/lib/favorites/favorites_store.dart Outdated Show resolved Hide resolved
frontend/lib/favorites/favorites_store.dart Outdated Show resolved Hide resolved
Copy link
Contributor

@f1sh1918 f1sh1918 left a comment

Choose a reason for hiding this comment

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

Good work 👍
There is one scenario we should catch.

  1. User adds a store to favorites.
  2. Later the store will be deleted because it doesn't participate anymore. (i removed from database to test)

Current behavior
The store is still in favorites. That ok but when i click on the store, the user is lost in this error screenshot. Retry doesn't help
Currently there is no proper error handling for this case. We should show in this case probably another error message and provide a way to go back

frontend/assets/l10n/app_en.json Show resolved Hide resolved
frontend/assets/l10n/app_en.json Show resolved Hide resolved
frontend/assets/l10n/app_en.json Outdated Show resolved Hide resolved
frontend/lib/home/home_page.dart Outdated Show resolved Hide resolved
@seluianova
Copy link
Contributor Author

seluianova commented Jun 4, 2024

There is one scenario we should catch

@f1sh1918 I think I would need your help to reproduce that.
I tried, but catched a different issue:
If favorites contain a store that is not in the database, AcceptingStoreByIdQuery returned it as Null, resulting in a casting error in _fetchPage().
I fixed that in the last commit, so the deleted store just won't show up in the favorites list without any fallbacks.

The store is still in favorites. That ok but when i click on the store, the user is lost in this error screenshot. Retry doesn't help
We should show in this case probably another error message and provide a way to go back

Currently I'm not quite sure how we can achieve this result, because in order to display a store item in the favorites list we need data about this store (name, description, category). But from where we could get it, if not from the database?
Perhaps I am missing something?

UPD: I also wonder, if you reproduce this scenario, do you get the same error if you open the removed store details on the “Search” page?

@seluianova
Copy link
Contributor Author

seluianova commented Jun 11, 2024

UPD:

  • all comments have been addressed;
  • more data about favorite stores is now saved on the device (id, name, category id);
  • if a favorite store has been deleted from the database, it is still displayed in favorites with a note that the store is no longer available and with the option to remove it from favorites;
  • favorites are now stored in shared preferences rather than secure storage because they are not sensitive data and we basically don't need encryption for them (hopefully this change doesn't break on iOS, as I haven't tested it);
  • I also started to add tests, but will continue within a separate task.

Copy link
Contributor

@f1sh1918 f1sh1918 left a comment

Choose a reason for hiding this comment

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

Super nice pr 👍
Thx for adding tests :)
Tested on ios and works fine.
Just some small things
I think the icon size of the favorite icon should be increased a little bit.
I suggest iconSize:36 to be more prominent
Added screenshot with increased icon size

frontend/assets/l10n/app_de.json Outdated Show resolved Hide resolved
frontend/assets/l10n/app_en.json Outdated Show resolved Hide resolved
frontend/lib/store_widgets/removed_store_summary.dart Outdated Show resolved Hide resolved
@seluianova seluianova merged commit 3858aac into main Jun 17, 2024
1 check passed
@seluianova seluianova deleted the 1214-add-pois-to-favorites branch June 17, 2024 10:18
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.

Add POIs to favorites
3 participants