-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[Settings] Sort Navigation-Pane items alphabetically #31183
Conversation
The Navigation Pane items are now sorted alphabetically based on their Display Names. Fixes microsoft#31089, microsoft#23763
Nice. Looks so simple! Just wondering - isn't there some sort of "ArraySort" function that could be applied to the "original" list? |
This comment was marked as resolved.
This comment was marked as resolved.
yep. Flaky test. Rerunning |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@crutkas is it even possible to locally test this when there are no translated resources locally available? |
You can just take the .pri file for settings (WinUI3Apps/PowerToys.Settings.pri) from the installation path of PowerToys and replace the one in the installation folder. To be honest I never tried it with settings, but it works with other modules. |
|
We can if wanted, the same sorting process can be applied there.
It should do it based on translated names (haven't tested it myself though, there's discussion above regarding this). |
I think we should do this for oobe to be aligned with the setting ux and maybe the tray flyout. |
My thoughts are expanding on this:
I also wonder what it would look like if there is only a part translated to non-Latin languages. |
We can (1) have all the items and their details in the code-behind and not in the XAML, so we sort and insert directly. Edit: Can we combine the NavigationViewItem attributes from OobeShellPage and ShellPage? Also, if we do want both of them to use the same sorted list, we either do the remove and insert sorted thing wherever we are storing it or fetch it from the one which is sorted earlier, both of which don't seem right. So what we can and should do is I think Also, what does OOBE mean? |
This is the "Welcome to PowerToys" window. |
A common helper function is made which sorts the items for both the shell pages. Fixes microsoft#31089, microsoft#23763
I have made the Settings and OOBE consistently sorted and use a common helper function. Re: create, remove, re-create workflow; I think that would need to stay as the sorting is relied on the |
I think this will add a perf hit on start up as we're removing and adding stuff to the DOM. I don't think this change should go in. |
@crutkas Insertion into the DOM is necessary to be able to solve this problem as I don't think there's a way we can reorder in place with . So, will try for a solution that can cut-off the removal part and load the items into the DOM in a sorted way. Will that be fine? |
@crutkas Nice to see that concept! 😄 The larger issue would still apply to that new interface/menu, though. What are your thoughts for the best approach? |
@crutkas Modules would still need to be sorted within those groups I guess. Though yes, the work would somewhat conflict. For the current setup, I was thinking that we can put the items to be inserted/sorted in a separate xaml file, we can fetch, sort, and insert into the Navigation Panes based on the |
With the new system being proposed, would the main sections also be reordered? Our way of doing it also is inline with windows settings. The order is the order. Having a fixed order also helps us determine quickly (and debug) what screen something is having an issue Regardless of language. This would need to be an off by default setting as well. |
One of the problems that makes this difficult is the fact that some are translated and some are not. |
Closing this out as the current system is intentionally "by design" for the navigation system |
Summary of the Pull Request
The Navigation Pane items are now sorted alphabetically based on their Display Names.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed