Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: sort users alphabetically when adding to album#27731

Merged
danieldietzler merged 2 commits into
immich-app:mainfrom
OdinOxin:feat/sort-users-alphabetically
Apr 14, 2026
Merged

feat: sort users alphabetically when adding to album#27731
danieldietzler merged 2 commits into
immich-app:mainfrom
OdinOxin:feat/sort-users-alphabetically

Conversation

@OdinOxin

@OdinOxin OdinOxin commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

Description

Changed the order of users are displayed in the AlbumAddUsersModal, from ID-sorted to sorted alphabetically by user name. For large immich-instances it is now easier to find a specific user to share an album with.

How Has This Been Tested?

  • Created multiple users in the dev container environment and check the sort order.

Screenshots (if appropriate)

Unsorted

rev bee49ce
Unsorted

Sorted

rev d328b31
Sorted

Checklist:

  • I have carefully read CONTRIBUTING.md
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable (not applicable)
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary. (none new dependencies)
  • I have written tests for new code (if applicable) (not applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

Please describe to which degree, if any, an LLM was used in creating this pull request.

generated commit message

@OdinOxin OdinOxin marked this pull request as ready for review April 12, 2026 12:28

@danieldietzler danieldietzler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice one! Little side note; you've stated that users are currently sorted by id in the description. That's not true, they aren't sorted at all

Comment on lines +20 to +22
users
.filter(({ id }) => !excludedUserIds.includes(id))
.sort((a, b) => (a.name > b.name ? 1 : b.name > a.name ? -1 : 0)),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Using lodash's sortBy with sortBy(users.filter..., ['name']) is probably cleaner

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Now implemented with lodash's sortBy function as suggested and resolved merge conflicts. Sorting and filtering (#27732) were tested again.

@OdinOxin OdinOxin force-pushed the feat/sort-users-alphabetically branch from d328b31 to 0e1d267 Compare April 14, 2026 18:48

@danieldietzler danieldietzler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@danieldietzler danieldietzler merged commit 3753b7a into immich-app:main Apr 14, 2026
48 checks passed
@OdinOxin OdinOxin deleted the feat/sort-users-alphabetically branch April 14, 2026 19:24
svfoxat pushed a commit to svfoxat/immich that referenced this pull request May 11, 2026
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.

3 participants