Skip to content

Conversation

@ZogStriP
Copy link
Member

Plugins in the admin sidebar were displayed in an unpredictable order based on load sequence. This makes it harder for admins to find specific plugins, especially as the number of installed plugins grows.

Sort plugin links alphabetically by their translated display name, with the internal plugin name as a secondary sort key for stability.

The sorting uses localeCompare for proper internationalization support.

BEFORE

CleanShot 2025-12-13 at 10 31 07

AFTER

CleanShot 2025-12-13 at 10 28 20

@jjaffeux
Copy link
Contributor

jjaffeux commented Dec 13, 2025

Do you see any reason why we shouldn't do it server side?

Ah never mind, we will get the translated name only on client. I guess given we don't paginate we could return a list already translated/sorted though.

Plugins in the admin sidebar were displayed in an unpredictable order
based on plugin load sequence, making it difficult for admins to locate
specific plugins as their number grows.

Additionally, plugin display names were inconsistent - the server-side
`humanized_name` stripped the "Discourse" prefix, but client-side
translated labels (e.g., "Discourse Footnotes") retained it.

Changes:

- Sort plugin links alphabetically by translated display name using
  `localeCompare` for i18n support, with plugin name as tiebreaker
- Add `stripDiscoursePrefix` utility to remove "Discourse " or
  "discourse-" prefixes (case-insensitive)
- Update server-side `humanized_name` to use regex `/\Adiscourse[\s-]+/i`
  instead of chained `delete_prefix` calls
- Apply prefix stripping to sidebar link text and plugin settings page
  titles (via `nameTitleized` getter)
@ZogStriP ZogStriP force-pushed the ux-order-plugins-by-displayed-name branch from 461077b to 9ecf9ce Compare December 14, 2025 20:42
@ZogStriP
Copy link
Member Author

I guess given we don't paginate we could return a list already translated/sorted though.

Except the translations are only available on the client side 🤔

Add null/undefined guard to prevent "Cannot read properties of
undefined (reading 'replace')" errors when text is not provided.
@ZogStriP ZogStriP force-pushed the ux-order-plugins-by-displayed-name branch from efcccb3 to 709e825 Compare December 14, 2025 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants