From e3ec06a762c12ecf16c42b722357214ecbbfb075 Mon Sep 17 00:00:00 2001 From: Tobias Frischmann Date: Fri, 18 Sep 2026 12:35:46 +0200 Subject: [PATCH] sort labels in settings --- app/components/Settings/Categories.vue | 7 ++++++- app/components/Settings/Tags.vue | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/components/Settings/Categories.vue b/app/components/Settings/Categories.vue index 619ccfe..909f026 100644 --- a/app/components/Settings/Categories.vue +++ b/app/components/Settings/Categories.vue @@ -12,7 +12,12 @@ const { t } = useI18n(); - const { data: categories } = useQuery(useCategoriesQuery()); + const { data: rawCategories } = useQuery(useCategoriesQuery()); + const categories = computed(() => { + return rawCategories.value?.toSorted((a, b) => + a.name.localeCompare(b.name), + ); + }); const { mutate: addCategory } = useAddCategory(); function onAddCategory(category: CategoryType) { diff --git a/app/components/Settings/Tags.vue b/app/components/Settings/Tags.vue index 2d74ece..0b94993 100644 --- a/app/components/Settings/Tags.vue +++ b/app/components/Settings/Tags.vue @@ -8,7 +8,12 @@ const { t } = useI18n(); - const { data: tags } = useQuery(useTagsQuery()); + const { data: rawTags } = useQuery(useTagsQuery()); + const tags = computed(() => { + return rawTags.value?.toSorted( + (a, b) => b.group - a.group || a.name.localeCompare(b.name), + ); + }); const { mutate: addTag } = useAddTag(); function onAddTag(tag: TagType) { -- 2.51.2