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
2 of 9 tasks
zbycz opened this issue Sep 8, 2024 · 4 comments
Open
2 of 9 tasks

SearchBox enhancements #523

zbycz opened this issue Sep 8, 2024 · 4 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

Fixes:

  • fix matching presets by name – searching for building p should offer Building Part on the first place

Explorations

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

Features

  • 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
  • add type coordinates – parse all coordinate types
  • add type osmId – parse shortId, apiId or URL with some of these ids.

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!!

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