소스 검색

统一群聊与 Bots Group 图标

LSamien 2 달 전
부모
커밋
08f8c39301
3개의 변경된 파일과 9개의 추가작업 그리고 20개의 파일을 삭제
  1. 3 7
      src/client/components/app/WorkspaceShell.vue
  2. 5 8
      src/client/components/common/AppIcon.vue
  3. 1 5
      src/client/components/common/YaoYaoSidebarIcon.vue

+ 3 - 7
src/client/components/app/WorkspaceShell.vue

@@ -10,7 +10,7 @@ type NavItem = {
   key: 'chat' | 'groups' | 'files'
   key: 'chat' | 'groups' | 'files'
   label: string
   label: string
   path: string
   path: string
-  icon: 'bots' | 'groups' | 'files'
+  icon: 'chat' | 'groups' | 'files'
 }
 }
 
 
 const SIDEBAR_COLLAPSED_KEY = 'hermes-yaoyao:sidebar-collapsed'
 const SIDEBAR_COLLAPSED_KEY = 'hermes-yaoyao:sidebar-collapsed'
@@ -61,7 +61,7 @@ const desktopSidebarContext = ref<HTMLElement | null>(null)
 const mobileSidebarContext = ref<HTMLElement | null>(null)
 const mobileSidebarContext = ref<HTMLElement | null>(null)
 
 
 const navItems: NavItem[] = [
 const navItems: NavItem[] = [
-  { key: 'chat', label: '对话', path: '/chat', icon: 'bots' },
+  { key: 'chat', label: '对话', path: '/chat', icon: 'chat' },
   { key: 'groups', label: '群聊', path: '/groups', icon: 'groups' },
   { key: 'groups', label: '群聊', path: '/groups', icon: 'groups' },
   { key: 'files', label: '文件库', path: '/files', icon: 'files' },
   { key: 'files', label: '文件库', path: '/files', icon: 'files' },
 ]
 ]
@@ -99,10 +99,6 @@ function toggleSidebar() {
   try { localStorage.setItem(SIDEBAR_COLLAPSED_KEY, sidebarCollapsed.value ? '1' : '0') } catch { /* optional persistence */ }
   try { localStorage.setItem(SIDEBAR_COLLAPSED_KEY, sidebarCollapsed.value ? '1' : '0') } catch { /* optional persistence */ }
 }
 }
 
 
-function navIcon(key: NavItem['key']): 'bots' | 'folder' | 'people' {
-  return key === 'groups' ? 'people' : key === 'files' ? 'folder' : 'bots'
-}
-
 async function openSidebarSearch(host: HTMLElement | null) {
 async function openSidebarSearch(host: HTMLElement | null) {
   if (sidebarCollapsed.value) {
   if (sidebarCollapsed.value) {
     sidebarCollapsed.value = false
     sidebarCollapsed.value = false
@@ -225,7 +221,7 @@ onBeforeUnmount(() => {
           :title="item.label"
           :title="item.label"
           @click="navigate(item.path)"
           @click="navigate(item.path)"
         >
         >
-          <YaoYaoSidebarIcon :name="navIcon(item.key)" />
+          <AppIcon :name="item.icon" :size="18" />
           <span>{{ item.label }}</span>
           <span>{{ item.label }}</span>
         </button>
         </button>
       </nav>
       </nav>

+ 5 - 8
src/client/components/common/AppIcon.vue

@@ -1,7 +1,6 @@
 <script setup lang="ts">
 <script setup lang="ts">
 type IconName =
 type IconName =
   | 'chat'
   | 'chat'
-  | 'bots'
   | 'groups'
   | 'groups'
   | 'files'
   | 'files'
   | 'artifacts'
   | 'artifacts'
@@ -67,14 +66,12 @@ withDefaults(defineProps<{ name: IconName; size?: number }>(), { size: 18 })
       <path d="M8 18h-3a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2h-5l-6 4z" />
       <path d="M8 18h-3a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2h-5l-6 4z" />
       <path d="M8 9h8M8 13h5" />
       <path d="M8 9h8M8 13h5" />
     </template>
     </template>
-    <template v-else-if="name === 'bots'">
-      <rect x="4" y="7" width="16" height="12" rx="3" />
-      <path d="M12 3v4M9 12h.01M15 12h.01M9 16h6" />
-    </template>
     <template v-else-if="name === 'groups'">
     <template v-else-if="name === 'groups'">
-      <path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" />
-      <circle cx="9" cy="7" r="4" />
-      <path d="M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75" />
+      <circle cx="12" cy="7" r="3.25" fill="currentColor" stroke="none" />
+      <path d="M5.9 20.5c.55-3.9 2.74-5.85 6.1-5.85s5.55 1.95 6.1 5.85" fill="currentColor" stroke="none" />
+      <circle cx="5.1" cy="9.2" r="2.35" fill="currentColor" stroke="none" opacity=".82" />
+      <circle cx="18.9" cy="9.2" r="2.35" fill="currentColor" stroke="none" opacity=".82" />
+      <path d="M1.7 20.5c.38-2.85 1.8-4.38 4.25-4.6M22.3 20.5c-.38-2.85-1.8-4.38-4.25-4.6" fill="currentColor" stroke="none" opacity=".82" />
     </template>
     </template>
     <template v-else-if="name === 'files'">
     <template v-else-if="name === 'files'">
       <path d="M4 4a2 2 0 0 1 2-2h5l2 3h5a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z" />
       <path d="M4 4a2 2 0 0 1 2-2h5l2 3h5a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z" />

+ 1 - 5
src/client/components/common/YaoYaoSidebarIcon.vue

@@ -5,20 +5,16 @@ import {
   AddOutline,
   AddOutline,
   ChatbubbleOutline,
   ChatbubbleOutline,
   FolderOutline,
   FolderOutline,
-  PeopleOutline,
   SearchOutline,
   SearchOutline,
 } from '@vicons/ionicons5'
 } from '@vicons/ionicons5'
-import { Robot } from '@vicons/tabler'
 
 
-type SidebarIconName = 'add' | 'bots' | 'chat' | 'folder' | 'people' | 'search'
+type SidebarIconName = 'add' | 'chat' | 'folder' | 'search'
 
 
 const props = withDefaults(defineProps<{ name: SidebarIconName; size?: number }>(), { size: 20 })
 const props = withDefaults(defineProps<{ name: SidebarIconName; size?: number }>(), { size: 20 })
 const component = computed(() => ({
 const component = computed(() => ({
   add: AddOutline,
   add: AddOutline,
-  bots: Robot,
   chat: ChatbubbleOutline,
   chat: ChatbubbleOutline,
   folder: FolderOutline,
   folder: FolderOutline,
-  people: PeopleOutline,
   search: SearchOutline,
   search: SearchOutline,
 })[props.name])
 })[props.name])
 </script>
 </script>