Allow users to reorder favorite friend groups in the sidebar

This commit is contained in:
pa
2026-02-24 21:34:43 +09:00
committed by Natsumi
parent 304413c1e3
commit 60fc08b472
8 changed files with 344 additions and 5 deletions

View File

@@ -120,7 +120,8 @@
isSidebarGroupByInstance,
isHideFriendsInSameInstance,
isSidebarDivideByFriendGroup,
sidebarFavoriteGroups
sidebarFavoriteGroups,
sidebarFavoriteGroupOrder
} = storeToRefs(useAppearanceSettingsStore());
const { gameLogDisabled } = storeToRefs(useAdvancedSettingsStore());
const { showUserDialog } = useUserStore();
@@ -228,7 +229,15 @@
}
}
return result.sort((a, b) => a[0].key.localeCompare(b[0].key));
const order = sidebarFavoriteGroupOrder.value;
return result.sort((a, b) => {
const idxA = order.indexOf(a[0]?.key);
const idxB = order.indexOf(b[0]?.key);
if (idxA !== -1 && idxB !== -1) return idxA - idxB;
if (idxA !== -1) return -1;
if (idxB !== -1) return 1;
return (a[0]?.key ?? '').localeCompare(b[0]?.key ?? '');
});
});
const buildToggleRow = ({