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

Add container sorting to bookmark, new tab, reopen, settings menus #1136

Merged
merged 2 commits into from
Jul 27, 2023

Conversation

fsaresh
Copy link
Contributor

@fsaresh fsaresh commented Jul 26, 2023

See #354 for impetus.

Context

When opening a new tab, reopening a tab in a container, opening a bookmark in a container, or viewing available containers in Sidebery settings, they currently are displayed in the order of creation rather than alphabetically.

This changeset introduces a sorting function (sortContainers) into the Container Actions file for reusability, and uses that sorting function for those aforementioned context menus and settings menus. I chose to use localCompare to allow for cross language sorting based on browser settings.

Please note that I haven't worked in TypeScript in a long while and wasn't very familiar with it to begin with, so if there are better ways of doing these things, please let me know :)

Testing

I followed the steps in the Contributing Guide and tested locally, making sure containers were sorted in the new tab, reopen in, open bookmark in, and settings menus.

Before, reopen in menu:
Screen Shot 2023-07-26 at 12 32 45

After, reopen in menu:
Screen Shot 2023-07-26 at 12 36 18

@mbnuqw
Copy link
Owner

mbnuqw commented Jul 27, 2023

LGTM, thank you!

@mbnuqw mbnuqw merged commit 10ddabe into mbnuqw:v5 Jul 27, 2023
@siddhpant
Copy link
Contributor

siddhpant commented Sep 9, 2023

Any way to have custom ordering or disable sorting?

I'm used to my current setup* and this has thrown me off many times. I use icons, and the container I want to open is now not at the place it used to be.


* I actually put the current ordering deliberately by editing the container settings json file.

@siddhpant
Copy link
Contributor

Also, this introduces a mismatch between Firefox's right click context menu "Open Link in New Container Tab" and Sidebery's ordering.

This should be reverted.

@mbnuqw
Copy link
Owner

mbnuqw commented Sep 10, 2023

Ok, I'll make it optional.

@siddhpant
Copy link
Contributor

Thank you!

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

Successfully merging this pull request may close these issues.

3 participants