-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Searchbox: History for recently searched items #622
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
👍 👍 👍
I would prefer a history icon, so the user knows it is their history. This way it is easier for them to remember it and be sure it is the thing they want (because they wanted it last time). It removes some of the cognitive load for them. I suggest this icon:
I tested current version, and I am not sure myself. Both sounds good. I find the "most recent first" slightly better.
Good point, I would remove the one from geocoder. It shows later and user also would have to use some congnitive load to decide if this is what they want. On the other hand, historical result should recognizable easier. |
export const getSkeleton = ( | ||
option: GeocoderOption | HistoryOption, | ||
): Feature => { | ||
if (option.type === 'history') { | ||
const { history } = option; | ||
return { | ||
center: history.geometry.coordinates, | ||
type: 'Feature', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to create another function getHistorySkeleton and place it in the src/components/SearchBox/options/history.tsx
file?
btw, I think skeleton from search is not much used nowadays. It could be enough to use object with type
+center
only, as these are the only keys useUpdatePreviewMarker
works with.
@@ -110,10 +117,13 @@ export const onSelectedFactory = | |||
overpassOptionSelected(option, setOverpassLoading, bbox, showToast); | |||
break; | |||
case 'geocoder': | |||
geocoderOptionSelected(option, setFeature); | |||
geocoderOptionSelected(option, setFeature, addToHistoryOption); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future, I would like all the Option
types to be saved to history after they are selected. There is no reason why Preset or OsmOption shouldn't be offered as well.
Probably leave that to a followup PR. Maybe after #621 🙂
Description
Add a history to the searchbox.
There are a few things I'm not sure about.
TODO: