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

Sort building levels recents by regular, then roof #3117

Merged

Conversation

smichel17
Copy link
Member

@smichel17 smichel17 commented Aug 4, 2021

The new building levels recent values is great. However, I've found that the vast majority of the buildings in the areas I map are 5 values: 1/0, 1/1, 2/0, 2/1, and -- probably to the surprise of no one -- 3/0. With that in mind, a stabler sort order would be much easier for me to scan and find the entry I'm looking for than the current FIFO queue.

I haven't tried this yet, going to do it this morning. Tried it, works as intended.

@smichel17
Copy link
Member Author

smichel17 commented Aug 4, 2021

Did a little mapping this morning. Unfortunately, the neighborhood I walked through had only 1, 1|1, and 2 story houses. So while this did feel nicer, it also didn't feel like much of a stress test. Anyone in a more varied area want to take it for a spin? I can share a debug apk if needed.

@smichel17
Copy link
Member Author

smichel17 commented Aug 4, 2021

@matkoniecz 👀 They are still added and removed in the same order, just the display order is sorted instead of chronological. So it has the disadvantage that you can't be precisely sure which one will disappear next time, when you enter a new answer. In practice, I think it doesn't matter that much.

@smichel17 smichel17 force-pushed the sort-building-levels-recents branch from a41a842 to f3f7551 Compare August 4, 2021 18:49
The new building levels recent values is great. However, I've found that
the vast majority of the buildings in the areas I map are 4 values (1|0,
1|1, 2|0, and 2|1), so my recent values seldom change. As a result, a
stabler sort order is much easier for me to scan and find the entry I'm
looking for than the current FIFO queue, where they constantly re-order.

They are still added and removed in the same order; only the display
order is changed. So it has the drawback that you can't be precisely
sure which entry will disappear, after you add a new answer. In
practice, I think it doesn't matter that much.

Originally I tried sorting by total levels first, but when testing, I
found it harder to parse "1|1, 2|0, 1|2, 2|1" than "1|1, 1|2, 2|0, 2|1".

Unfortunately, the compiler can't figure out the type of `thenBy`
without the annotation.
@smichel17 smichel17 force-pushed the sort-building-levels-recents branch from f3f7551 to c51ffd8 Compare August 4, 2021 18:52
@smichel17
Copy link
Member Author

Updated formatting and added all the commentary here to the commit message. So aside from maybe waiting on testing from people in a different area, I consider this ready for merge.

Copy link
Member

@FloEdelmann FloEdelmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't get around testing this in the field, but the code looks fine and I imagine it being useful.

@westnordost
Copy link
Member

I also think the same. I'll merge this before the release of the next version but I'll wait because you said that you wanted to do some field testing.

@smichel17
Copy link
Member Author

I've done enough field testing now that I'm confident it works the way I'd like. But merge conflicts are extremely unlikely, so I'm happy to wait to merge.

@westnordost westnordost merged commit 9514e57 into streetcomplete:master Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants