guidocioni / point_wx

4 stars 0 forks source link

Add favorites to drop down #125

Closed guidocioni closed 3 months ago

guidocioni commented 3 months ago

Basically every time the user selects something we add this to a new store component which will only store up to 5 favorites place (we need to remove them in case they're too many). Then every time we make the options for the drop-down we add this favorites at the end of the list by Reading the state of the store component. this way the list will always be populated by the favorites (if they're there ).which will be appended at the end. We also need to filter duplicates in this list before adding the options. Maybe check the id

guidocioni commented 3 months ago

This could work BUT there is a problem when the location is generated with geolocation or map click. In this case we save information with a ficticious ID, which cannot be used in the future as option.

We could rewrite the part that creates the options part in case of geolocation and map click to make an additional call to the geocoding API so that the resulting object will have the correct information. This would also avoid having to manually create this dictionary. However, this would still not work in case a "CustomLocation" is created.

We could change the way the id is created in geolocation and map click events to have a ficticious ID which still changes every time. This way it should still be unique.

guidocioni commented 3 months ago

Should be easier now that 95ee500f5017d65db9321ebdb73a0b0081be30f4 implements a custom ID generation. Now whatever the location is (geolocation, mapclick, user searched...) everything should have a unique id

guidocioni commented 3 months ago

Should be completed by 859a018e1a252d6189f5bce6e048db32d17fd1db The feature is still a little bit weird...to be tested