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

SearchBox enhancements #523

Open
3 of 9 tasks
zbycz opened this issue Sep 8, 2024 · 6 comments
Open
3 of 9 tasks

SearchBox enhancements #523

zbycz opened this issue Sep 8, 2024 · 6 comments
Labels
good first issue Good for newcomers

Comments

@zbycz
Copy link
Owner

zbycz commented Sep 8, 2024

Few ideas - each one should be one PR

Features

  • add coordinates search – parse all coordinate types + plus codes (Add support for Open Location Codes? #834)
  • add search history -> if I searched for San Francisco, it should be offered to me
  • when coordinates are out of BBox, show an arrow like this
  • allow users to share search -> add search term to URL after 2 seconds eg /?q=op:node["shop"] #119

Fixes:

Explorations

  • find what is practical limit for overpass query size, eg if user asks for op:nwr, it can freeze their browser.

Completed

@zbycz zbycz added the good first issue Good for newcomers label Sep 8, 2024
@Dlurak
Copy link
Collaborator

Dlurak commented Sep 9, 2024

fix broken flyTo on mobile – search for anything with bbox, eg Bexhill-on-Sea - it can't be clicked

On my iOS device it works, but only with a double click.

@amenk
Copy link
Contributor

amenk commented Sep 15, 2024

allow users to share search -> add search term to URL after 2 seconds eg /?q=op:node["shop"]

depends on #119

add type coordinates – parse all coordinate types

see also #510

@Dlurak
Copy link
Collaborator

Dlurak commented Sep 16, 2024

How about also adding types to the options?
Even though it's internal, I believe this would greatly simplify future enhancements to the search box and make it easier to maintain!

@zbycz
Copy link
Owner Author

zbycz commented Sep 20, 2024

 How about also adding types to the options?

@Dlurak – yes, please! There is a TODO in code already, though we would need to completely refactor the types. Typescript can't discriminate among the different options based on our current shape. It need explicit type field with enum

// from
{
  star: { ... }
}
// to
{
  type: "star",    // enum "star" | "geocoder" | "preset" | "overpass" | "coordinates" | "osmId" | "loader"
  ...
}

I will review your #552 today, and then you can add the types. If you decided to do that, please, create one PR only for the refactoring, and second PR (based on first) with the additional types with adding new functionality. Otherwise the code review is a headache 😃

//edit @Dlurak - wow, I am reviewing the #552 and I am very pleasantly surprised! You already added the type: "x" all by yourself! Good job!!

@Dlurak
Copy link
Collaborator

Dlurak commented Oct 3, 2024

How about also adding search support for the name suggestion index. While the tagging presets have real categories like supermarket or school the name suggestion index has companies, like supermarket companies...

https://nsi.guide/

@zbycz
Copy link
Owner Author

zbycz commented Oct 4, 2024

Interesting idea. 👍 One issue is that the nsi.json is 11 MB alone, so it is too big to load it the same way we load presets. We needed presets anyway for displaying the feature types and showing the FeaturePanel, so even though preset.json is 0.6 MB, it is an exception.

The way we could execute this is implementing our own /api endpoint. The server can load the file from node_modules and look up the info - we should test how many miliseconds it takes, if it is too much (>50ms?), we would need to load it in postgre first.

Also the UI would have to be rethinked a little, because firing two requests could result in jumpy UI, or even worse displaying nothing when one of the request fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants