stellarium icon indicating copy to clipboard operation
stellarium copied to clipboard

Location: when changing location via map, keep the text filter

Open axd1967 opened this issue 4 months ago • 16 comments

Is your feature request related to a problem? Please describe. As the location map is small, I often have to probe it to find a desired location. (due to the 5deg filter at https://github.com/Stellarium/stellarium/blob/ba119d7bed24705dbf37441185ea39ccc354fca8/src/gui/LocationDialog.cpp#L646)

Eg to find Edmonton (when I don't want to type lat/long) I have to click in the map in the rough vicinity of Alberta, and use "Ed" as a text filter.

Image

The problem is that the text filter is cleared every time I poke the map; I have to re-type the filter text.

https://github.com/Stellarium/stellarium/blob/ba119d7bed24705dbf37441185ea39ccc354fca8/src/gui/LocationDialog.cpp#L650

Describe the solution you'd like Keep the text filter; don't clear it when clicking in the map. (Should reduce the memory problem?) Let the user manually clear the text filter if needed. (To that effect, add a clear button... User already has a crude workaround: empty the box manually...)

If this is not done automatically in the model, re-run filters after https://github.com/Stellarium/stellarium/blob/ba119d7bed24705dbf37441185ea39ccc354fca8/src/gui/LocationDialog.cpp#L646

Following might also needs a review: https://github.com/Stellarium/stellarium/blob/ba119d7bed24705dbf37441185ea39ccc354fca8/src/gui/LocationDialog.cpp#L1019

There is also a smell of code duplication here: https://github.com/Stellarium/stellarium/blob/ba119d7bed24705dbf37441185ea39ccc354fca8/src/gui/LocationDialog.cpp#L692-L693

In short: minimize the use cases that require to clear the text filter.

Describe alternatives you've considered The button Reset Location List, but it also clears the input box; remove the automatic clearing?

https://github.com/Stellarium/stellarium/blob/ba119d7bed24705dbf37441185ea39ccc354fca8/src/gui/LocationDialog.cpp#L988

Additional context

axd1967 avatar Aug 30 '25 12:08 axd1967

Eg to find Edmonton (when I don't want to type lat/long) I have to click in the map in the rough vicinity of Alberta, and use "Ed" as a text filter.

Why can't you just type Edmont and choose the Edmonton in North America?

10110111 avatar Aug 30 '25 12:08 10110111

Eg to find Edmonton (when I don't want to type lat/long) I have to click in the map in the rough vicinity of Alberta, and use "Ed" as a text filter.

Why can't you just type Edmont and choose the Edmonton in North America?

I suspect this is a UX issue. Reset Location List is not very clear what it is needed for. Why would one have to reset this list? Is it to clear the text filter?

I think it is because I don't use the Reset button and I'm used to click in the map to set a location, and then find the exact spot.

axd1967 avatar Aug 30 '25 14:08 axd1967

Reset Location List is not very clear what it is needed for. Why would one have to reset this list? Is it to clear the filter?

This button is literally reset list of locations and remove all filters.

alex-w avatar Aug 30 '25 16:08 alex-w

The button seems rather large for its intent and wastes pixel space: a discrete cross next to the input box (which clears the input box) could suffice?

But the essence remains: the text filter should not be cleared when poking the map.

axd1967 avatar Sep 04 '25 07:09 axd1967

But the essence remains: the filter should not be cleared when poking the map.

Every click on the map enabled filter...

alex-w avatar Sep 04 '25 07:09 alex-w

While we could replace the clear-description button by a red X (that causes new questions) next to the text entry, the behaviour will not change. A click in the map selects locations within some radius (IIRC 5 degrees?). There are sparsely populated regions where you then see 5 locations (where this functionality actually helps), or others like in central Europe where still hundreds of locations remain in the list. If you know a place name, you don't need to click the map, just type. I don't know if it would be beneficial to e.g. limit the list to the "nearest 20 locations (or whatever number can be seen on screen) within 5 degrees".

gzotti avatar Sep 04 '25 08:09 gzotti

We seem to have had a uibtBackspace.png in this field to clear the filter, no? This kind of button is quite ubiquitous in e.g. KDE GUI, and I don't think it causes any questions. E.g. this is from KDE's System Settings (the button disappears when there's no text):

Image

10110111 avatar Sep 04 '25 08:09 10110111

If the button disappears when there's no text, how would one reset the 5-degree filter activated by just clicking in the map?

gzotti avatar Sep 04 '25 08:09 gzotti

how would one reset the 5-degree filter activated by just clicking in the map?

Does this filter already exist? Is it the point of the current big button? Then it's hugely unintuitive. If I had clicked on the map and then changed my mind and decided to look for some name—and fail, I'd be very puzzled, but I wouldn't think that the "Reset Location List" button is supposed to fix that.

This needs to be made more intuitive. E.g. a label could be added that'd say something like "5° filter around lat ABC, lon EFG is active" and a [disable] button next to it.

10110111 avatar Sep 04 '25 09:09 10110111

The current button says "Reset location list" with all details given in the tooltip. It resets both the distance and name string selection filters. If you think it's necessary, write a half-page in SUB 4.2 about the detailed action of the button. Here in point 3 I wrote "vicinity", not the exact distance, while the feature was new and we experimented whether 3 or 5 degrees was better. as said above, the closest 20 locations within 5 degrees may be a real next improvement. Or a zoomable map, at least while online...

gzotti avatar Sep 04 '25 10:09 gzotti

If you think it's necessary, write a half-page in SUB 4.2 about the detailed action of the button.

No one will be interested what this button does if they won't even think it's relevant to the weird behavior they see: a location being searched for not appearing in the list while the filter input field is empty. So they'll not discover the tooltip, and even less so go to the User Guide, assuming that they've bumped into a bug.

It's the GUI that should make it obvious that something is being filtered after some user's action (and "which action? what have I done wrong? the filter text is empty!" would be the my question if I first faced this behavior and were told about this).

In fact, I think I have seen this at some point, and I did think it was a bug, but since I failed to reproduce it after Stellarium restart (not knowing that I should click the map), I didn't report it.

10110111 avatar Sep 04 '25 10:09 10110111

I don't remember seeing any other bug report or question about "I don't see my place name in the list and am completely lost" or similar since introducing the map click filter (2015?). I always assumed users will just get accustomed to this behaviour within 2 minutes or 4 mouse clicks, but feel free to propose your better and more intuitive solution.

gzotti avatar Sep 04 '25 10:09 gzotti

One could wonder if it might make sense to (optionally/checkbox controlled) sort locations by increasing distance from the clicked location, in combination with the text filter...

But it would make a significant effort to deal with https://github.com/Stellarium/stellarium/blob/ebd3887d3f7eabf3c10428103dda584899bae8dc/src/core/StelLocationMgr.hpp#L32

And yes, I'm completely, utterly, hyperbolic lost.

axd1967 avatar Sep 04 '25 15:09 axd1967

If the button disappears when there's no text, how would one reset the 5-degree filter activated by just clicking in the map?

To be clear: we are not talking about the geo filter, only the text filter. The geo filter is fine.

To be sure I refined/edited this in my previous comments.

axd1967 avatar Sep 04 '25 16:09 axd1967

And find the intended location in what then surely looks like an unsorted list? No. When clicking on the map, you may indicate "somewhere there". I doubt it makes sense to then sort the visible list by distance from actual clicked point. But the more I think of it, sort by distance in the background, and only show the 20 or 50 closest may be useful. Currently the list is often too long in Europe or China to see a difference from the full list. If you even only show as many as the list can display, you could click until you are there. But if you know the placename, you are almost certainly always faster with typing.

gzotti avatar Sep 04 '25 16:09 gzotti

I think what a checkbox may be useful for is to automatically check this on map click instead of having the unintuitive button:

  • [x] Only show locations within 5° from the cursor

10110111 avatar Sep 04 '25 17:09 10110111