osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.3k stars 982 forks source link

Tracks folder listing is mixed up (Configure map>tracks>menu) #19634

Open Rowin63 opened 3 weeks ago

Rowin63 commented 3 weeks ago

Description

The track folders are not listed aphabetical anymore, but mixed up

Steps to reproduce

go to "configure map / tracks / folder menue"

Actual result

after changing some folders names the track folders are not in alphabetical order anymore

(but in "my places / tracks" the listing is correct)

Expected result

keep them in order

Your Environment (required)

OsmAnd Version: +4.7.10 Android/iOS version: 13 Device model: S20+

Rowin63 commented 3 weeks ago

Sotty, double!

sonora commented 3 weeks ago

It's a regressiion, and seems separate from and in addition to #19333.

sonora commented 3 weeks ago

Apparently, the function "Sort subfolders" on the MyTracks screen also successfully sorts all tracks of 'folder' "Visible on map" and on its associated screen, but not the folder list itself on that screen (neither the folder tabs nor the folder list).

sonora commented 3 weeks ago

The folder list on the 'Visible on map' screen and list menu seems always by the folders' time stamp, I find no way currently to sort it alphabetically.

vshcherb commented 3 weeks ago

To fix: The order on Configure Map should be identical to My places screen

sonora commented 3 weeks ago

It looks like now we 'reversed' the issue: The function "Sort subfolders" on the MyTracks screen now successfully also sorts all folders on "Visible on map", but now all tracks in the folders on "Visible on map" are always sorted by 'Last modified".

vshcherb commented 3 weeks ago

Technical note

vshcherb commented 3 weeks ago

Merged to https://github.com/osmandapp/OsmAnd/issues/19683

sonora commented 1 week ago

@Chumva

EDIT: Here's a more complete TODO analysis: https://github.com/osmandapp/OsmAnd/issues/19333#issuecomment-2097515818.

The issue is the sort mode for the "root" ("Tracks") folder in the MyPlaces>Tracks screen: That very sort mode should be also used

In https://github.com/osmandapp/OsmAnd/blob/21d390dc18ea61bbfaf60f97288f439e7d6015eb/OsmAnd/src/net/osmand/plus/configmap/tracks/TrackTabsHelper.java#L311

and when there is no track directly in the root folder (all in subfolders), no sort mode is saved for the Tracks folder (as there is no corresponding tab), and that causes https://github.com/osmandapp/OsmAnd/issues/19333. Also we need to add/correct code to use that sort mode for the tabs and the tab selection dialog to fix this issue.

sonora commented 1 week ago

@Chumva The connected issue #19333 of sort modes not syncing between the 2 track screens is fixed with PR https://github.com/osmandapp/OsmAnd/pull/19814.

To fix this issue here, we now just need to add code to sort the 'Configrue map>Tracks' tabs (and in a separate block the smart folder tabs) according to TRACKS_TABS_SORT_MODES(GPX-root-folder). (Potentially here here.)

Chumva commented 1 week ago

Yes, also we need to make it a universal code, for my places & configure tracks

sonora commented 3 days ago

@Chumva here's a hotfix to resolve the current randomness: https://github.com/osmandapp/OsmAnd/commit/a6e896f814343e7577ed139e915a14502197d53a. We can refine the code as we go along, ok?

sonora commented 3 days ago

PS: Perhaps we can even consider this issue solved for now, I am not sure it makes much sense in practice to offer more tab orders than A-Z and Z-A.

The hotfix uses the root folder's sorting also for the tab order, but is currently limited to A-Z and Z-A, defaulting to A-Z for all other root folder sort modes.