Revert "fix(ui): distinguish file types and enlarge chat resource chips"

This reverts commit 42aceb17fb.
main
lyingbug 2026-09-15 22:54:39 +08:00
parent 42aceb17fb
commit 6f98ff80c3
4 changed files with 20 additions and 74 deletions

View File

@ -2680,8 +2680,8 @@ defineExpose({
</span>
</span>
<span class="mention-chip__name" :title="item.name">{{ item.name }}</span>
<button type="button" class="mention-chip__remove" @click.stop="removeSelectedItem(item)"
:aria-label="`${$t('common.remove')} ${item.name}`" :title="$t('common.remove')">×</button>
<span class="mention-chip__remove" @click.stop="removeSelectedItem(item)"
:aria-label="$t('common.remove')">×</span>
</span>
</div>
@ -3059,16 +3059,15 @@ const getImgSrc = (url: string) => {
display: inline-flex;
align-items: center;
gap: 5px;
min-height: 32px;
max-width: 100%;
padding: 3px 4px 3px 8px;
min-height: 26px;
padding: 3px 7px 3px 6px;
border-radius: var(--td-radius-medium, 6px);
box-sizing: border-box;
font-size: 14px;
font-size: 12px;
font-weight: 500;
cursor: default;
transition: background 0.15s, border-color 0.15s;
line-height: 20px;
line-height: 18px;
&:hover {
.chat-resource-chip-hover();
@ -3080,14 +3079,14 @@ const getImgSrc = (url: string) => {
display: inline-flex;
width: 16px;
height: 16px;
flex: 0 0 auto;
flex: 0 1 auto;
min-width: 0;
align-items: center;
justify-content: center;
}
.mention-chip__icon {
font-size: 14px;
font-size: 12px;
display: flex;
align-items: center;
justify-content: center;
@ -3116,8 +3115,7 @@ const getImgSrc = (url: string) => {
}
.mention-chip__name {
min-width: 0;
max-width: 160px;
max-width: 100px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@ -3128,19 +3126,15 @@ const getImgSrc = (url: string) => {
display: inline-flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
padding: 0;
border: 0;
background: transparent;
width: 14px;
height: 14px;
margin-left: 1px;
border-radius: 50%;
font-family: inherit;
font-size: 18px;
font-size: 14px;
line-height: 1;
font-weight: 400;
cursor: pointer;
opacity: 0.75;
opacity: 0.5;
transition: opacity 0.15s, background 0.15s, color 0.15s;
color: currentColor;
flex-shrink: 0;
@ -3150,18 +3144,12 @@ const getImgSrc = (url: string) => {
opacity: 0.85;
}
.mention-chip__remove:hover,
.mention-chip__remove:focus-visible {
.mention-chip__remove:hover {
opacity: 1;
background: var(--td-bg-color-component);
color: var(--td-text-color-primary, #1f2937);
}
.mention-chip__remove:focus-visible {
outline: 2px solid var(--td-brand-color);
outline-offset: 1px;
}
/* 标签表面保持中性,仅用图标颜色表达资源类型。 */
.mention-chip--kb {
color: var(--td-text-color-primary);

View File

@ -1,28 +0,0 @@
// Share file-type colors between knowledge cards and list icons.
.file-type-tone(@icon, @light, @dark) {
&[data-file-icon="@{icon}"] {
--file-type-color: @light;
:root[theme-mode="dark"] & {
--file-type-color: @dark;
}
}
}
.file-type-colors() {
--file-type-color: var(--td-text-color-secondary);
.file-type-tone(file-pdf, #b52a35, #f28b94);
.file-type-tone(file-word, #245bb2, #82b2ff);
.file-type-tone(file-excel, #187449, #6dcea0);
.file-type-tone(file-powerpoint, #ad4d17, #f5ad77);
.file-type-tone(code, #7250ad, #baa0ee);
.file-type-tone(image, #8f4090, #df9bde);
.file-type-tone(sound, #0e747b, #74cdd3);
.file-type-tone(video, #654bbb, #b7a1ff);
.file-type-tone(link, #245bb2, #82b2ff);
.file-type-tone(edit, #0e747b, #74cdd3);
color: var(--file-type-color);
background: color-mix(in srgb, var(--file-type-color) 10%, var(--td-bg-color-container));
}

View File

@ -1,7 +1,7 @@
<script setup lang="ts">
import { ref, computed, nextTick, onBeforeUnmount, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { formatFileSize, getFileIcon } from '@/utils/files';
import { formatFileSize } from '@/utils/files';
import { useTagChipsOverflow } from '@/composables/useTagChipsOverflow';
import DocumentActionMenu from './DocumentActionMenu.vue';
import FolderPickerMenu, { type FolderOption } from './FolderPickerMenu.vue';
@ -609,8 +609,7 @@ const handleAction = (action: 'download' | 'edit' | 'view-trace' | 'reparse' | '
</div>
</template>
</div>
<div class="card-type" :data-file-icon="getFileIcon(item)">
<t-icon :name="getFileIcon(item)" aria-hidden="true" />
<div class="card-type">
<span>{{ getKnowledgeType(item) }}</span>
</div>
</div>
@ -687,7 +686,6 @@ const handleAction = (action: 'download' | 'edit' | 'view-trace' | 'reparse' | '
</template>
<style scoped lang="less">
@import '@/components/css/file-type-colors.less';
@keyframes contentFadeIn {
from { opacity: 0; transform: translateY(6px); }
to { opacity: 1; transform: translateY(0); }
@ -994,21 +992,14 @@ const handleAction = (action: 'download' | 'edit' | 'view-trace' | 'reparse' | '
}
.card-type {
.file-type-colors();
display: inline-flex;
align-items: center;
gap: 4px;
flex-shrink: 0;
color: var(--td-text-color-placeholder);
font-family: var(--app-font-family);
font-size: 11px;
font-weight: 500;
line-height: 18px;
padding: 1px 5px;
border-radius: 4px;
padding: 0;
background: transparent;
letter-spacing: 0.02em;
.t-icon { font-size: 13px; }
}
}

View File

@ -310,7 +310,7 @@ const handleAction = (action: 'download' | 'edit' | 'reparse' | 'cancel-parse' |
</div>
<div class="cell cell-name">
<span class="row-file-icon-wrap" :data-file-icon="getFileIcon(item)">
<span class="row-file-icon-wrap">
<t-icon :name="getFileIcon(item)" />
</span>
<div class="row-file-text">
@ -483,7 +483,6 @@ const handleAction = (action: 'download' | 'edit' | 'reparse' | 'cancel-parse' |
</template>
<style scoped lang="less">
@import '@/components/css/file-type-colors.less';
@keyframes doc-list-fade-in {
from {
opacity: 0;
@ -659,10 +658,6 @@ const handleAction = (action: 'download' | 'edit' | 'reparse' | 'cancel-parse' |
color: var(--td-text-color-secondary);
}
.row-file-icon-wrap[data-file-icon] {
.file-type-colors();
}
.row-file-text {
flex: 1;
min-width: 0;