Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

fix(ui): 统一资源图标并调整会话分叉标识 (#3430)

lyingbug014f95f1394a
diff --git a/frontend/src/components/ResourceListToolbar.vue b/frontend/src/components/ResourceListToolbar.vue
index c010fd90f..e17c4072c 100644
--- a/frontend/src/components/ResourceListToolbar.vue
+++ b/frontend/src/components/ResourceListToolbar.vue
@@ -11,7 +11,9 @@
<t-select v-if="mode === 'resource' && spaceOptions.length" class="space-filter"
:value="selectedSpace" :options="spaceOptions" :placeholder="$t('listSpaceSidebar.spaces')"
:aria-label="$t('listSpaceSidebar.spaces')" filterable clearable
- @change="(value: unknown) => $emit('update:modelValue', String(value || 'all'))" />
+ @change="(value: unknown) => $emit('update:modelValue', String(value || 'all'))">
+ <template #prefixIcon><ResourceIcon type="organization" :size="16" /></template>
+ </t-select>
</div>
<t-input :model-value="query" class="search-input" :placeholder="$t('menu.search')"
:aria-label="$t('menu.search')" clearable @update:model-value="(value: unknown) => $emit('update:query', String(value ?? ''))">
@@ -24,6 +26,7 @@
import { computed, onMounted } from 'vue'
import { useI18n } from 'vue-i18n'
import { useOrganizationStore } from '@/stores/organization'
+import ResourceIcon from '@/components/icons/ResourceIcon.vue'
const props = withDefaults(defineProps<{
modelValue: string
diff --git a/frontend/src/components/SessionSidebarRow.vue b/frontend/src/components/SessionSidebarRow.vue
index d5e4be0c6..4761c1d87 100644
--- a/frontend/src/components/SessionSidebarRow.vue
+++ b/frontend/src/components/SessionSidebarRow.vue
@@ -15,17 +15,18 @@
</form>
<span v-else class="submenu_title" :class="batchMode ? 'submenu_title--batch' : ''" :title="item.title">
<t-icon v-if="item.is_pinned" name="pin" class="submenu_pin_icon" />
- <t-tooltip v-if="item.parent_session_id" content="由其他会话分叉而来">
- <t-icon name="git-branch" class="submenu_fork_icon" />
- </t-tooltip>
<span ref="titleTextRef" class="submenu_title-text">{{ item.title }}</span>
<span v-if="apiOwnerTag" class="session-owner-tag" :class="`session-owner-tag--${apiOwnerTag.kind}`"
:title="apiOwnerTag.full">{{ apiOwnerTag.label }}</span>
</span>
<span v-if="running" class="session-running-indicator" role="status" :aria-label="t('menu.sessionInProgress')"
:title="t('menu.sessionInProgress')"><span class="session-running-indicator__spinner" aria-hidden="true" /></span>
- <div v-if="!batchMode" class="session-row-menu-wrap" @click.stop>
- <t-popup v-model:visible="menuOpen" :overlay-class-name="menuOverlayClass" trigger="click" destroy-on-close
+ <div v-if="!batchMode || item.parent_session_id" class="session-row-menu-wrap"
+ :class="{ 'session-row-menu-wrap--fork': item.parent_session_id }" @click.stop>
+ <span v-if="item.parent_session_id" class="session-fork-indicator" role="img" aria-label="由其他会话分叉而来">
+ <t-icon name="git-branch" class="submenu_fork_icon" />
+ </span>
+ <t-popup v-if="!batchMode" v-model:visible="menuOpen" :overlay-class-name="menuOverlayClass" trigger="click" destroy-on-close
placement="bottom-right" @visible-change="onMenuVisibleChange">
<button type="button" class="menu-more-wrap" :aria-label="t('chatHeader.moreActions')" aria-haspopup="menu" :aria-expanded="menuOpen" @click.stop>
<t-icon name="ellipsis" class="menu-more" />
@@ -249,6 +250,29 @@ const confirmDangerAction = (): void => {
pointer-events: none;
}
+.session-row-menu-wrap--fork {
+ flex-basis: 24px;
+ width: 24px;
+ height: 24px;
+ opacity: 1;
+ pointer-events: auto;
+
+ .menu-more-wrap { opacity: 0; }
+}
+
+.submenu_item_batch .session-row-menu-wrap--fork { pointer-events: none; }
+
+.session-fork-indicator {
+ position: absolute;
+ inset: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ pointer-events: none;
+
+ .submenu_fork_icon { font-size: var(--app-text-sm); }
+}
+
.submenu_item:hover,
.submenu_item:focus-within,
.submenu_item--menu-open {
@@ -260,6 +284,13 @@ const confirmDangerAction = (): void => {
}
}
+.submenu_item:not(.submenu_item_batch) {
+ &:hover, &:focus-within, &.submenu_item--menu-open {
+ .session-fork-indicator { opacity: 0; }
+ .session-row-menu-wrap--fork .menu-more-wrap { opacity: 1; }
+ }
+}
+
@media (hover: none) {
.session-row-menu-wrap {
flex-basis: 24px;
@@ -267,6 +298,10 @@ const confirmDangerAction = (): void => {
opacity: 1;
pointer-events: auto;
}
+ .submenu_item:not(.submenu_item_batch) {
+ .session-fork-indicator { display: none; }
+ .session-row-menu-wrap--fork .menu-more-wrap { opacity: 1; }
+ }
}
.session-title-edit {
diff --git a/frontend/src/components/icons/ResourceIcon.vue b/frontend/src/components/icons/ResourceIcon.vue
new file mode 100644
index 000000000..caac3bc1c
--- /dev/null
+++ b/frontend/src/components/icons/ResourceIcon.vue
@@ -0,0 +1,35 @@
+<template>
+ <span class="resource-icon" aria-hidden="true" :style="iconStyle" />
+</template>
+
+<script setup lang="ts">
+import { computed } from 'vue'
+import knowledgeIcon from '@/assets/img/zhishiku.svg'
+import agentIcon from '@/assets/img/agent.svg'
+import organizationIcon from '@/assets/img/organization.svg'
+
+const props = withDefaults(defineProps<{
+ type: 'knowledge' | 'agent' | 'organization'
+ size?: number
+}>(), { size: 20 })
+
+// Reuse the navigation assets while inheriting the surrounding theme color.
+const icons = { knowledge: knowledgeIcon, agent: agentIcon, organization: organizationIcon }
+const iconStyle = computed(() => ({
+ width: `${props.size}px`,
+ height: `${props.size}px`,
+ maskImage: `url("${icons[props.type]}")`,
+}))
+</script>
+
+<style scoped>
+.resource-icon {
+ display: inline-block;
+ flex-shrink: 0;
+ vertical-align: middle;
+ background-color: currentColor;
+ mask-repeat: no-repeat;
+ mask-position: center;
+ mask-size: contain;
+}
+</style>
diff --git a/frontend/src/components/menu.vue b/frontend/src/components/menu.vue
index 4b5418c04..6b56936df 100644
--- a/frontend/src/components/menu.vue
+++ b/frontend/src/components/menu.vue
@@ -1493,14 +1493,6 @@ const resizeSidebar = (delta: number, keyboard: boolean) => {
flex-shrink: 0;
}
- :deep(.submenu_fork_icon) {
- color: inherit;
- font-size: var(--app-text-sm);
- margin-right: 4px;
- vertical-align: middle;
- flex-shrink: 0;
- }
-
.submenu_source_icon {
width: 14px;
height: 14px;
@@ -1629,9 +1621,6 @@ const resizeSidebar = (delta: number, keyboard: boolean) => {
color: var(--td-text-color-primary);
}
- :deep(.menu-more-wrap) {
- opacity: 1;
- }
}
&.session-chat-row--active .session-list-row {
diff --git a/frontend/src/views/agent/AgentList.vue b/frontend/src/views/agent/AgentList.vue
index ba7994070..72665b524 100644
--- a/frontend/src/views/agent/AgentList.vue
+++ b/frontend/src/views/agent/AgentList.vue
@@ -583,8 +583,9 @@
</div>
<!-- 空状态:全部(保留创建 CTA) -->
- <EmptyState v-if="!keyword.trim() && spaceSelection === 'all' && filteredAgents.length === 0 && !loading" icon="chat-bubble-1" :title="$t('agent.empty.title')"
+ <EmptyState v-if="!keyword.trim() && spaceSelection === 'all' && filteredAgents.length === 0 && !loading" :title="$t('agent.empty.title')"
:description="$t('agent.empty.description')">
+ <template #icon><ResourceIcon type="agent" :size="32" /></template>
<t-button v-if="authStore.hasRole('contributor')" theme="primary" class="agent-create-btn"
data-guide="agent-list-create" @click="handleCreateAgent">
<template #icon>
@@ -616,8 +617,9 @@
<EmptyState v-if="!keyword.trim() && spaceSelection === 'recents' && filteredAgents.length === 0 && !loading" icon="history" :title="$t('agent.empty.recentsTitle')"
:description="$t('agent.empty.recentsDescription')" />
<!-- 空状态:我的 -->
- <EmptyState v-if="!keyword.trim() && spaceSelection === 'mine' && agents.length === 0 && !loading" icon="chat-bubble-1" :title="$t('agent.empty.title')"
+ <EmptyState v-if="!keyword.trim() && spaceSelection === 'mine' && agents.length === 0 && !loading" :title="$t('agent.empty.title')"
:description="$t('agent.empty.description')">
+ <template #icon><ResourceIcon type="agent" :size="32" /></template>
<t-button v-if="authStore.hasRole('contributor')" theme="primary" class="agent-create-btn"
@click="handleCreateAgent">
<template #icon>
@@ -643,8 +645,10 @@
</t-button>
</EmptyState>
<!-- 空状态:空间下 -->
- <EmptyState v-if="!keyword.trim() && spaceSelectionOrgId && !spaceAgentsLoading && spaceAgentsList.length === 0" icon="chat-bubble-1" :title="$t('agent.empty.sharedTitle')"
- :description="$t('agent.empty.sharedDescription')" />
+ <EmptyState v-if="!keyword.trim() && spaceSelectionOrgId && !spaceAgentsLoading && spaceAgentsList.length === 0" :title="$t('agent.empty.sharedTitle')"
+ :description="$t('agent.empty.sharedDescription')">
+ <template #icon><ResourceIcon type="agent" :size="32" /></template>
+ </EmptyState>
</div>
</div>
@@ -731,6 +735,7 @@ import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { MessagePlugin, Icon as TIcon } from 'tdesign-vue-next'
import EmptyState from '@/components/EmptyState.vue'
+import ResourceIcon from '@/components/icons/ResourceIcon.vue'
import { useConfirmDelete } from '@/components/settings/useConfirmDelete'
import { deleteAgent, copyAgent, type CustomAgent } from '@/api/agent'
import { useChatResourcesStore } from '@/stores/chatResources'
diff --git a/frontend/src/views/knowledge/KnowledgeBaseList.vue b/frontend/src/views/knowledge/KnowledgeBaseList.vue
index 1cccc6895..dfe96190f 100644
--- a/frontend/src/views/knowledge/KnowledgeBaseList.vue
+++ b/frontend/src/views/knowledge/KnowledgeBaseList.vue
@@ -586,8 +586,9 @@
</div>
<!-- 全部空状态:保留「新建知识库」CTA,因为是空间没有任何 KB 的真空场景 -->
- <EmptyState v-if="!keyword.trim() && spaceSelection === 'all' && filteredKnowledgeBases.length === 0 && !loading" icon="folder-open" :title="$t('knowledgeList.empty.title')"
+ <EmptyState v-if="!keyword.trim() && spaceSelection === 'all' && filteredKnowledgeBases.length === 0 && !loading" :title="$t('knowledgeList.empty.title')"
:description="$t('knowledgeList.empty.description')">
+ <template #icon><ResourceIcon type="knowledge" :size="32" /></template>
<t-button v-if="authStore.hasRole('contributor')" theme="primary" class="kb-create-btn"
data-guide="kb-list-create" @click="handleCreateKnowledgeBase">
<template #icon><t-icon name="folder-add" /></template>
@@ -605,8 +606,9 @@
:description="$t('knowledgeList.empty.recentsDescription')" />
<!-- 我的知识库空状态 -->
- <EmptyState v-if="!keyword.trim() && spaceSelection === 'mine' && kbs.length === 0 && !loading" icon="folder-open" :title="$t('knowledgeList.empty.title')"
+ <EmptyState v-if="!keyword.trim() && spaceSelection === 'mine' && kbs.length === 0 && !loading" :title="$t('knowledgeList.empty.title')"
:description="$t('knowledgeList.empty.description')">
+ <template #icon><ResourceIcon type="knowledge" :size="32" /></template>
<t-button v-if="authStore.hasRole('contributor')" theme="primary" class="kb-create-btn"
data-guide="kb-list-create" @click="handleCreateKnowledgeBase">
<template #icon><t-icon name="folder-add" /></template>
@@ -615,8 +617,10 @@
</EmptyState>
<!-- 空间下知识库空状态 -->
- <EmptyState v-if="!keyword.trim() && spaceSelectionOrgId && !spaceKbsLoading && spaceKbsList.length === 0" icon="folder-open" :title="$t('knowledgeList.empty.sharedTitle')"
- :description="$t('knowledgeList.empty.sharedDescription')" />
+ <EmptyState v-if="!keyword.trim() && spaceSelectionOrgId && !spaceKbsLoading && spaceKbsList.length === 0" :title="$t('knowledgeList.empty.sharedTitle')"
+ :description="$t('knowledgeList.empty.sharedDescription')">
+ <template #icon><ResourceIcon type="knowledge" :size="32" /></template>
+ </EmptyState>
</div>
</div>
@@ -702,6 +706,7 @@ import { onMounted, onUnmounted, ref, computed, watch, nextTick } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { MessagePlugin, Icon as TIcon } from 'tdesign-vue-next'
import EmptyState from '@/components/EmptyState.vue'
+import ResourceIcon from '@/components/icons/ResourceIcon.vue'
import { useConfirmDelete } from '@/components/settings/useConfirmDelete'
import { deleteKnowledgeBase, duplicateKnowledgeBase, togglePinKnowledgeBase } from '@/api/knowledge-base'
import { useChatResourcesStore } from '@/stores/chatResources'
diff --git a/frontend/src/views/organization/OrganizationList.vue b/frontend/src/views/organization/OrganizationList.vue
index 1064b26cb..559a2276b 100644
--- a/frontend/src/views/organization/OrganizationList.vue
+++ b/frontend/src/views/organization/OrganizationList.vue
@@ -167,8 +167,9 @@
</div>
<!-- 空状态(按筛选显示不同文案) -->
- <EmptyState v-if="!keyword.trim() && !loading && filteredOrganizations.length === 0" icon="usergroup" :title="emptyStateTitle"
+ <EmptyState v-if="!keyword.trim() && !loading && filteredOrganizations.length === 0" :title="emptyStateTitle"
:description="emptyStateDesc">
+ <template #icon><ResourceIcon type="organization" :size="32" /></template>
<t-tooltip :content="noPermissionTip" placement="top" :disabled="canManageOrg">
<t-button theme="default" variant="outline" class="org-join-btn" :disabled="!canManageOrg"
@click="handleJoinOrganization">
@@ -430,6 +431,7 @@ import { ref, reactive, onMounted, onUnmounted, computed, watch, nextTick } from
import { useRoute, useRouter } from 'vue-router'
import { MessagePlugin } from 'tdesign-vue-next'
import EmptyState from '@/components/EmptyState.vue'
+import ResourceIcon from '@/components/icons/ResourceIcon.vue'
import { useConfirmDelete } from '@/components/settings/useConfirmDelete'
import { useOrganizationStore } from '@/stores/organization'
import { useAuthStore } from '@/stores/auth'