# Alphabetical sorting of widgets in the dashboard selector

**URL:** <https://community.gladysassistant.com/t/tri-alphabetique-des-widgets-dans-le-selecteur-du-tableau-de-bord/10335>\
**Category:** Développement\
**Created:** [July 11, 2026, 2:23pm UTC](https://community.gladysassistant.com/t/tri-alphabetique-des-widgets-dans-le-selecteur-du-tableau-de-bord/10335 "2026-07-11T14:23:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [July 11, 2026, 2:23pm UTC](https://community.gladysassistant.com/t/tri-alphabetique-des-widgets-dans-le-selecteur-du-tableau-de-bord/10335/1 "2026-07-11T14:23:24Z")

</div>

@pierre-gilles,

Small PR to sort widgets alphabetically in the dashboard selector.

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/f/0/f00d3242ce0c1788f880b3933f29507f6c223682.png)

> <https://github.com/GladysAssistant/Gladys/pull/2654>
>
> Titre :
> Front: Sort widget types alphabetically in dashboard box selector
> 
> De…scription :
> \### Pull Request check-list
> 
> \- \[x\] If your changes affect the code, did you write the tests?
> \- \[\] Are server tests passing with coverage? (\`cd server && npm run coverage\`) — N/A, front-end only
> \- \[\] Did Cypress E2E tests pass? (\`npm run cypress:run\` from repo root, if UI changed)
> \- \[x\] Is the linter passing? (\`npm run eslint\` on both front/server)
> \- \[x\] Did you run prettier? (\`npm run prettier\` on both front/server)
> \- \[\] If you are adding a new feature/service, did you run the integration comparator? — N/A
> \- \[x\] Did you test this pull request in real life? With real devices?
> \- \[\] If your changes modify the API (REST or Node.js), did you modify the API documentation? — N/A
> \- \[\] If you are adding a new features/services which needs explanation, did you modify the user documentation? — N/A
> \- \[\] Did you add fake requests data for the demo mode? — N/A
> 
> \### Description of change
> 
> In the dashboard editor, the "Select a type" dropdown listed widgets in the raw
> order of the \`DASHBOARD\_BOX\_TYPE\_LIST\` constant (historical order of addition),
> which makes it hard to find a widget as the list grows.
> 
> This PR sorts the widget list alphabetically \*\*by translated label, at render
> time\*\*:
> 
> \- \`SelectBoxType\` now gets the i18n dictionary through the existing
> \`withIntlAsProp\` helper, resolves each \`dashboard.boxTitle.\*\` label and sorts
> the options with \`localeCompare\` (accent-aware, e.g. "Écowatt",
> "Consommation Énergétique").
> \- The sort automatically follows the user's language (fr/en/de) and any widget
> added to \`DASHBOARD\_BOX\_TYPE\_LIST\` in the future will be sorted without any
> extra work. If a translation is missing, the widget type is used as fallback.
> \- The empty "---------" option stays on top, and the \`value\` sent on selection
> is still the raw box type — no behavior change besides the display order.
> 
> \<img width="391" height="617" alt="image" src="https://github.com/user-attachments/assets/f866bbd3-7a79-4576-9681-dcd39057bf91" /\>

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [July 11, 2026, 3:44pm UTC](https://community.gladysassistant.com/t/tri-alphabetique-des-widgets-dans-le-selecteur-du-tableau-de-bord/10335/2 "2026-07-11T15:44:00Z")

</div>

and also a PR for the scenes

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/3X/9/4/94fcbc758abc2a6f117943c118f9eded69eea665.png)

> <https://github.com/GladysAssistant/Gladys/pull/2655>
>
> Description :
> \### Pull Request check-list
> 
> To ensure your Pull Request can be… accepted as fast as possible, make sure to review and check all of these items:
> 
> \- \[\] If your changes affect the code, did you write the tests? — N/A, display order only, no logic change
> \- \[\] Are server tests passing with coverage? (\`cd server && npm run coverage\`) — N/A, front-end only
> \- \[x\] Did Cypress E2E tests pass? (\`npm run cypress:run\` from repo root, if UI changed)
> \- \[x\] Is the linter passing? (\`npm run eslint\` on both front/server)
> \- \[x\] Did you run prettier? (\`npm run prettier\` on both front/server)
> \- \[\] If you are adding a new feature/service, did you run the integration comparator? (\`npm run compare-translations\` on front) — N/A
> \- \[x\] Did you test this pull request in real life? With real devices?
> \- \[\] If your changes modify the API (REST or Node.js), did you modify the API documentation? — N/A
> \- \[\] If you are adding a new features/services which needs explanation, did you modify the user documentation? — N/A
> \- \[\] Did you add fake requests data for the demo mode (\`front/src/config/demo.js\`)? — N/A
> 
> \### Description of change
> 
> In the scene editor, the trigger and action dropdowns listed their entries in
> the raw order of the server constants (historical order of addition), which
> makes items hard to find as the lists grow. This PR sorts both lists
> alphabetically \*\*by translated label, at render time\*\*, so the order follows
> the user's language (fr/en/de) and any trigger/action added in the future is
> sorted without extra work:
> 
> \- \*\*Scene trigger selector\*\* (\`ChooseTriggerTypeCard\`): options were already
> built from the i18n dictionary (\`editScene.triggers.\*\`), they are now
> sorted with \`localeCompare\` (accent-aware).
> \- \*\*Scene action selector\*\* (\`ChooseActionTypeCard\`): options are sorted the
> same way on their translated label (\`editScene.actions.\*\`), with the raw
> action type as fallback when a translation is missing. The sort also
> applies to filtered action lists used in condition blocks (if/then/else).
> 
> 
> \<img width="564" height="454" alt="image" src="https://github.com/user-attachments/assets/094e3e96-3427-4f29-9cc7-4376cf3d3081" /\>
> \<img width="399" height="488" alt="image" src="https://github.com/user-attachments/assets/c54fb199-6cae-45ad-881b-eb44337dfea0" /\>

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [July 13, 2026, 7:51am UTC](https://community.gladysassistant.com/t/tri-alphabetique-des-widgets-dans-le-selecteur-du-tableau-de-bord/10335/3 "2026-07-13T07:51:01Z")

</div>

Thanks for the 2 PRs, it’s good for me, it’s merged 🙂
