From 12b742371637c740490a4a2811c43fb70ee11f98 Mon Sep 17 00:00:00 2001 From: pa Date: Mon, 23 Mar 2026 20:35:20 +0900 Subject: [PATCH] improve friend sidebar settings UI with sections and collapsible advanced options --- src/localization/en.json | 5 + src/views/Sidebar/Sidebar.vue | 272 ++++++++++++-------- src/views/Sidebar/__tests__/Sidebar.test.js | 8 + 3 files changed, 180 insertions(+), 105 deletions(-) diff --git a/src/localization/en.json b/src/localization/en.json index 969bb922..268ab2be 100644 --- a/src/localization/en.json +++ b/src/localization/en.json @@ -187,6 +187,11 @@ "offline": "OFFLINE", "pending_offline": "Pending Offline", "settings": { + "display": "Display", + "sort": "Sort", + "advanced": "Advanced", + "sorting": "Sorting", + "favorites_section": "Favorites", "group_by_instance": "Group by Instance", "split_favorite_friends": "Show Favorite Groups", "hide_friends_in_same_instance": "Hide Grouped Friends", diff --git a/src/views/Sidebar/Sidebar.vue b/src/views/Sidebar/Sidebar.vue index 72e61db2..03aaca0d 100644 --- a/src/views/Sidebar/Sidebar.vue +++ b/src/views/Sidebar/Sidebar.vue @@ -63,6 +63,10 @@
+ + + {{ t('side_panel.settings.display') }} + {{ t('side_panel.settings.group_by_instance') }} - - - {{ t('side_panel.settings.favorite_groups') }} - - - - + + + + + {{ t('side_panel.settings.sort') }} + - {{ t('side_panel.settings.sort_primary') }} - - - - - {{ - t('dialog.gallery_select.none') - }} - - {{ opt.label }} - - - - - - - {{ t('side_panel.settings.sort_tertiary') }} - - - - + + + + + + + + + +
+ + + {{ t('side_panel.settings.sorting') }} + + + {{ t('side_panel.settings.sort_secondary') }} + + + + + + {{ t('side_panel.settings.sort_tertiary') }} + + + + + + + + + + {{ t('side_panel.settings.favorites_section') }} + + + {{ t('side_panel.settings.favorite_groups') }} + + + + + +
+
+
@@ -259,7 +319,7 @@ SelectTrigger, SelectValue } from '@/components/ui/select'; - import { Bell, RefreshCw, Search, Settings } from 'lucide-vue-next'; + import { Bell, ChevronDown, RefreshCw, Search, Settings } from 'lucide-vue-next'; import { toast } from 'vue-sonner'; import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger } from '@/components/ui/context-menu'; import { Field, FieldContent, FieldLabel } from '@/components/ui/field'; @@ -267,6 +327,7 @@ import { computed, ref } from 'vue'; import { useMagicKeys, whenever } from '@vueuse/core'; import { Button } from '@/components/ui/button'; + import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible'; import { Kbd } from '@/components/ui/kbd'; import { Separator } from '@/components/ui/separator'; import { Spinner } from '@/components/ui/spinner'; @@ -375,6 +436,7 @@ const CLEAR_VALUE = '__clear__'; const isGroupOrderDialogOpen = ref(false); const isSettingsPopoverOpen = ref(false); + const isAdvancedOpen = ref(false); const sortOptions = computed(() => [ { value: 'Sort Alphabetically', label: t('view.settings.appearance.side_panel.sorting.alphabetical') }, diff --git a/src/views/Sidebar/__tests__/Sidebar.test.js b/src/views/Sidebar/__tests__/Sidebar.test.js index d56e9d30..cb707ca2 100644 --- a/src/views/Sidebar/__tests__/Sidebar.test.js +++ b/src/views/Sidebar/__tests__/Sidebar.test.js @@ -38,6 +38,7 @@ vi.mock('../../../stores', () => ({ sidebarSortMethod3: ref(''), isSidebarGroupByInstance: ref(false), isHideFriendsInSameInstance: ref(false), + isSameInstanceAboveFavorites: ref(false), isSidebarDivideByFriendGroup: ref(false), sidebarFavoriteGroups: ref([]), setSidebarSortMethod1: vi.fn(), @@ -45,6 +46,7 @@ vi.mock('../../../stores', () => ({ setSidebarSortMethod3: vi.fn(), setIsSidebarGroupByInstance: vi.fn(), setIsHideFriendsInSameInstance: vi.fn(), + setIsSameInstanceAboveFavorites: vi.fn(), setIsSidebarDivideByFriendGroup: vi.fn(), setSidebarFavoriteGroups: vi.fn() }), @@ -117,8 +119,14 @@ vi.mock('@/components/ui/kbd', () => ({ vi.mock('@/components/ui/separator', () => ({ Separator: { template: '
' } })); +vi.mock('@/components/ui/collapsible', () => ({ + Collapsible: { template: '
' }, + CollapsibleTrigger: { template: '
' }, + CollapsibleContent: { template: '
' } +})); vi.mock('lucide-vue-next', () => ({ Bell: { template: '' }, + ChevronDown: { template: '' }, RefreshCw: { template: '' }, Search: { template: '' }, Settings: { template: '' }