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

Wrong sorting order in models tree #1051

Open
Sonique opened this issue Jul 2, 2024 · 5 comments
Open

Wrong sorting order in models tree #1051

Sonique opened this issue Jul 2, 2024 · 5 comments

Comments

@Sonique
Copy link

Sonique commented Jul 2, 2024

Version of Archi

5.2.0.202311011021 silicon mac

Archi Plug-ins

yep

Operating System

mac silicon

Expected Behaviour

alphanumeric sorting

Actual Behaviour

character sorting

Steps to Reproduce the Behaviour

  1. create folders with numerals in naming like folder-15 folder-100
  2. look up in tree
  3. folder 100 will be first
image
@Phillipus
Copy link
Member

This is expected behaviour and can't be changed. Text comparison is based on the Java Collator class. This provides lexical comparison based on locale to account for characters like accents.

@Phillipus Phillipus closed this as not planned Won't fix, can't repro, duplicate, stale Jul 2, 2024
@Sonique
Copy link
Author

Sonique commented Jul 3, 2024

So how can it be changed? Because it's terrible behaviour for sorting, it's not usable at all, maybe only for Wittgenstein Tractatus table of content is good, but not for other cases. Digital sequences should be compared as numbers not as literals one by one.

More over most editors sort in the right way.

Look for example on Intellij Idea on same system

image

So I see it more as bug then expected behaviour

@Phillipus
Copy link
Member

So how can it be changed?

As I explained, in Java sorting is done by the Collator class. If you wish, as Archi is open source, you can provide your own solution.

@Phillipus
Copy link
Member

@Phillipus
Copy link
Member

Phillipus commented Jul 4, 2024

I'll keep the issue open. There are third-party implementations of an AlphaNumericComparator such as the link in the previous comment but I don't know what the impact is in performance. The implementation needs to support Collator.getInstance() so that Locale based sorting is also supported. Needs more investigation.

@Phillipus Phillipus reopened this Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants