From 9c243cbe8dbad9c0eea46dad0a9c1eb1df68ef04 Mon Sep 17 00:00:00 2001 From: proddy Date: Wed, 17 Dec 2025 22:09:32 +0100 Subject: [PATCH] sort types --- .../src/app/main/SensorsAnalogDialog.tsx | 22 ++++++++++--------- interface/src/app/main/types.ts | 4 ++-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/interface/src/app/main/SensorsAnalogDialog.tsx b/interface/src/app/main/SensorsAnalogDialog.tsx index c6af79319..032bd1605 100644 --- a/interface/src/app/main/SensorsAnalogDialog.tsx +++ b/interface/src/app/main/SensorsAnalogDialog.tsx @@ -108,16 +108,18 @@ const SensorsAnalogDialog = ({ // Memoize menu items to avoid recreation on each render const analogTypeMenuItems = useMemo( () => - AnalogTypeNames.map((val, i) => ( - - {val} - - )), - [] + AnalogTypeNames.map((val, i) => ({ name: val, value: i + 1 })) + .sort((a, b) => a.name.localeCompare(b.name)) + .map(({ name, value }) => ( + + {name} + + )), + [disabledTypeList] ); const uomMenuItems = useMemo( diff --git a/interface/src/app/main/types.ts b/interface/src/app/main/types.ts index ff71dca0a..67b88d10e 100644 --- a/interface/src/app/main/types.ts +++ b/interface/src/app/main/types.ts @@ -262,7 +262,7 @@ export const AnalogTypeNames = [ 'PWM 0', // 7 'PWM 1', // 8 'PWM 2', // 9 - 'NTC Temp.', // 10 + 'NTC Temp', // 10 'RGB Led', // 11 'Pulse', // 12 'Freq 0', // 13 @@ -270,7 +270,7 @@ export const AnalogTypeNames = [ 'Freq 2', // 15 'Counter 0', // 16 'Counter 1', // 17 - 'Counter2' // 18 + 'Counter 2' // 18 ] as const; export const BOARD_PROFILES = {