From 6fb29f45dfdd45f0bc8954bd7effc6106ce76d03 Mon Sep 17 00:00:00 2001 From: Vishal Kumar Singh Date: Thu, 23 Apr 2026 15:00:36 +0530 Subject: [PATCH] fix(sites): keep Other as the last framework filter The `Clone a template` picker builds its framework filter from `frameworkOrder`, which listed every known framework followed by `Other` as the tail entry. Any framework not in that list falls through to the `aIndex === -1` branch of the comparator and ends up sorted after every known entry, so once `React Native` started appearing in the template catalogue it rendered below `Other` even though `Other` is meant to be the catch-all bucket. Hoist the `Other` check above the indexed comparison and drop it from `frameworkOrder` so it no longer depends on staying at a fixed position in the list. Any not-yet-known framework now sits between the explicitly ordered frameworks and `Other`, which is the expected grouping. Fixes #2895. --- .../sites/create-site/templates/+page.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/routes/(console)/project-[region]-[project]/sites/create-site/templates/+page.ts b/src/routes/(console)/project-[region]-[project]/sites/create-site/templates/+page.ts index 5f876a9d8f..15ca325f7a 100644 --- a/src/routes/(console)/project-[region]-[project]/sites/create-site/templates/+page.ts +++ b/src/routes/(console)/project-[region]-[project]/sites/create-site/templates/+page.ts @@ -36,11 +36,13 @@ export const load = async ({ url, params }) => { 'Lynx', 'Angular', 'Analog', - 'Vite', - 'Other' + 'Vite' ]; const frameworks = Array.from(frameworksSet).sort((a, b) => { + // 'Other' always sorts last, regardless of any other framework's position. + if (a === 'Other') return 1; + if (b === 'Other') return -1; const aIndex = frameworkOrder.indexOf(a); const bIndex = frameworkOrder.indexOf(b); if (aIndex === -1 && bIndex === -1) return a.localeCompare(b);