From 6f98ff80c3185679cc16f834faf42fc662770e68 Mon Sep 17 00:00:00 2001 From: lyingbug Date: Tue, 15 Sep 2026 22:54:39 +0800 Subject: [PATCH] Revert "fix(ui): distinguish file types and enlarge chat resource chips" This reverts commit 42aceb17fba067aab7987a7a150f1da5024c4dfd. --- frontend/src/components/Input-field.vue | 40 +++++++------------ .../src/components/css/file-type-colors.less | 28 ------------- .../knowledge/components/DocumentCardView.vue | 19 +++------ .../knowledge/components/DocumentListView.vue | 7 +--- 4 files changed, 20 insertions(+), 74 deletions(-) delete mode 100644 frontend/src/components/css/file-type-colors.less diff --git a/frontend/src/components/Input-field.vue b/frontend/src/components/Input-field.vue index 628df7bd..32e8ff2e 100644 --- a/frontend/src/components/Input-field.vue +++ b/frontend/src/components/Input-field.vue @@ -2680,8 +2680,8 @@ defineExpose({ {{ item.name }} - + × @@ -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); diff --git a/frontend/src/components/css/file-type-colors.less b/frontend/src/components/css/file-type-colors.less deleted file mode 100644 index 5da9610b..00000000 --- a/frontend/src/components/css/file-type-colors.less +++ /dev/null @@ -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)); -} diff --git a/frontend/src/views/knowledge/components/DocumentCardView.vue b/frontend/src/views/knowledge/components/DocumentCardView.vue index 5dc5b6a9..92e98de8 100644 --- a/frontend/src/views/knowledge/components/DocumentCardView.vue +++ b/frontend/src/views/knowledge/components/DocumentCardView.vue @@ -1,7 +1,7 @@