Skip to content

Fix profile sorting to ignore case differences#8813

Closed
Muntazir3i wants to merge 3 commits intoFreeTubeApp:developmentfrom
Muntazir3i:fix-profile-sorting
Closed

Fix profile sorting to ignore case differences#8813
Muntazir3i wants to merge 3 commits intoFreeTubeApp:developmentfrom
Muntazir3i:fix-profile-sorting

Conversation

@Muntazir3i
Copy link

@Muntazir3i Muntazir3i commented Mar 16, 2026

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Description

Profiles were previously sorted using direct string comparison:

if (a.name < b.name) return -1
if (a.name > b.name) return 1

This caused incorrect ordering when profile names contained different letter cases, because uppercase characters take precedence in ASCII sorting.

This change replaces the comparison with localeCompare using case-insensitive comparison so that profile names are sorted alphabetically regardless of case.

The existing logic that ensures the main profile (MAIN_PROFILE_ID) remains first is preserved.

Screenshots

Before sorting:

AB
Aa
Ab
Ac

After sorting:

Aa
AB
Ab
Ac

Testing

Steps to verify the fix:

  1. Run the development build:
npm install
npm run dev
  1. Create several profiles with names containing different letter cases, for example:
AB
Aa
Ab
Ac
  1. Open the profile list.

Profiles should now appear in alphabetical order ignoring case, while the main profile remains at the top.

Desktop

  • OS: Linux
  • OS Version: Linux Mint 20.2 (Uma)
  • FreeTube version: v0.23.14 development build

Additional context

This change only affects the sorting logic for profile names and does not modify any profile data or other functionality.

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) March 16, 2026 08:22
@github-actions github-actions bot added PR: dependencies Pull requests that update a dependency file PR: waiting for review For PRs that are complete, tested, and ready for review labels Mar 16, 2026
auto-merge was automatically disabled March 16, 2026 09:21

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) March 16, 2026 09:22
auto-merge was automatically disabled March 16, 2026 09:26

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) March 16, 2026 09:26
auto-merge was automatically disabled March 17, 2026 13:20

Pull request was closed

@FreeTubeApp FreeTubeApp locked and limited conversation to collaborators Mar 17, 2026
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Mar 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

PR: dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants