diff --git a/docs/assets/knowledge-tag-popover.png b/docs/assets/knowledge-tag-popover.png new file mode 100644 index 00000000..12b3bcb9 Binary files /dev/null and b/docs/assets/knowledge-tag-popover.png differ diff --git a/frontend/src/assets/dropdown-menu.less b/frontend/src/assets/dropdown-menu.less index 970f65a6..846a96eb 100644 --- a/frontend/src/assets/dropdown-menu.less +++ b/frontend/src/assets/dropdown-menu.less @@ -48,10 +48,7 @@ border-radius: var(--app-radius-lg) !important; background: var(--td-bg-color-container) !important; border: 0.5px solid var(--td-component-stroke) !important; - box-shadow: - 0 0 0 0.5px rgba(0, 0, 0, 0.03), - 0 2px 4px rgba(0, 0, 0, 0.04), - 0 8px 24px rgba(0, 0, 0, 0.1) !important; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.08) !important; backdrop-filter: blur(20px) saturate(180%) !important; -webkit-backdrop-filter: blur(20px) saturate(180%) !important; animation: dropdownSlideIn 0.18s cubic-bezier(0.2, 0, 0, 1) both; @@ -71,22 +68,23 @@ .popup-menu-item { display: flex; align-items: center; - gap: 10px; - padding: 8px 12px; + gap: 8px; + padding: 6px 10px; cursor: pointer; - transition: all var(--app-motion-fast) cubic-bezier(0.2, 0, 0, 1); + transition: background-color var(--app-motion-fast) ease, color var(--app-motion-fast) ease; color: var(--td-text-color-primary); + font-family: var(--app-font-family); font-size: var(--app-text-base); font-weight: 400; line-height: 20px; - border-radius: var(--app-radius-sm); + border-radius: var(--app-radius-xs); position: relative; .menu-icon { - font-size: var(--app-text-xl); + font-size: var(--app-text-2xl); flex-shrink: 0; color: var(--td-text-color-secondary); - transition: all var(--app-motion-fast) cubic-bezier(0.2, 0, 0, 1); + transition: background-color var(--app-motion-fast) ease, color var(--app-motion-fast) ease; } &:hover { @@ -100,7 +98,6 @@ &:active { background: var(--td-bg-color-container-active); - transform: scale(0.98); } &.delete, @@ -152,10 +149,7 @@ border-radius: var(--app-radius-lg) !important; background: var(--td-bg-color-container) !important; border: 0.5px solid var(--td-component-stroke) !important; - box-shadow: - 0 0 0 0.5px rgba(0, 0, 0, 0.03), - 0 2px 4px rgba(0, 0, 0, 0.04), - 0 8px 24px rgba(0, 0, 0, 0.1) !important; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.08) !important; backdrop-filter: blur(20px) saturate(180%) !important; -webkit-backdrop-filter: blur(20px) saturate(180%) !important; color: var(--td-text-color-primary); @@ -182,13 +176,15 @@ .card-menu-item { display: flex; align-items: center; - gap: 10px; - padding: 8px 12px; + gap: 8px; + padding: 6px 10px; cursor: pointer; color: var(--td-text-color-primary); - transition: all var(--app-motion-fast) cubic-bezier(0.2, 0, 0, 1); - border-radius: var(--app-radius-sm); + transition: background-color var(--app-motion-fast) ease, color var(--app-motion-fast) ease; + border-radius: var(--app-radius-xs); + font-family: var(--app-font-family); font-size: var(--app-text-base); + font-weight: 400; line-height: 20px; &:hover { @@ -197,13 +193,12 @@ &:active { background: var(--td-bg-color-container-active); - transform: scale(0.98); } .icon { - font-size: var(--app-text-xl); + font-size: var(--app-text-2xl); color: var(--td-text-color-secondary); - transition: all var(--app-motion-fast) cubic-bezier(0.2, 0, 0, 1); + transition: background-color var(--app-motion-fast) ease, color var(--app-motion-fast) ease; } &:hover .icon { @@ -351,16 +346,18 @@ 四、TDesign Dropdown 统一样式 适用于 组件(挂载到 body 上) ============================================ */ +.t-popup__content.t-dropdown { + border: 1px solid var(--td-component-stroke); + border-radius: var(--app-radius-md); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.08); +} + .t-popup__content { .t-dropdown__menu { background: var(--td-bg-color-container); - border: 0.5px solid var(--td-component-stroke); - box-shadow: - 0 0 0 0.5px rgba(0, 0, 0, 0.03), - 0 2px 4px rgba(0, 0, 0, 0.04), - 0 8px 24px rgba(0, 0, 0, 0.1); - backdrop-filter: blur(20px) saturate(180%); - -webkit-backdrop-filter: blur(20px) saturate(180%); + border: 0; + box-shadow: none; + gap: 2px; padding: 4px; min-width: 148px; animation: dropdownSlideIn 0.18s cubic-bezier(0.2, 0, 0, 1) both; @@ -399,11 +396,14 @@ } .t-dropdown__item { - padding: 8px 12px; - border-radius: var(--app-radius-sm); - margin: 1px 0; - transition: all var(--app-motion-fast) cubic-bezier(0.2, 0, 0, 1); + padding: 6px 10px; + border-radius: var(--app-radius-xs); + margin: 0; + transition: background-color var(--app-motion-fast) ease, color var(--app-motion-fast) ease; + font-family: var(--app-font-family); font-size: var(--app-text-base); + font-weight: 400; + line-height: 20px; color: var(--td-text-color-primary); cursor: pointer; min-width: auto !important; @@ -420,7 +420,6 @@ &:active { background: var(--td-bg-color-container-active); - transform: scale(0.98); } .t-dropdown__item-icon { @@ -429,10 +428,12 @@ color: var(--td-text-color-secondary); display: flex; align-items: center; - transition: all var(--app-motion-fast) cubic-bezier(0.2, 0, 0, 1); + transition: background-color var(--app-motion-fast) ease, color var(--app-motion-fast) ease; .t-icon { - font-size: var(--app-text-xl); + font-size: var(--app-text-2xl); + width: var(--app-text-2xl); + height: var(--app-text-2xl); } } @@ -452,6 +453,12 @@ display: block; } + // Match sidebar text: normal/hover stays primary, current selection is branded. + &.t-dropdown__item--theme-default:not(.t-dropdown__item--disabled) { + &:hover { color: var(--td-text-color-primary); } + &.t-dropdown__item--active { color: var(--td-brand-color); } + } + /* TDesign error 主题项(删除操作) */ &.t-dropdown__item--theme-error { color: var(--td-error-color-6) !important; @@ -488,126 +495,9 @@ } } -/* tag 更多弹窗 */ -.tag-more-popup { - z-index: 99 !important; - .t-popup__content { - padding: 4px !important; - margin-top: 4px !important; - min-width: 120px; - border-radius: var(--app-radius-lg) !important; - background: var(--td-bg-color-container) !important; - border: 0.5px solid var(--td-component-stroke) !important; - box-shadow: - 0 0 0 0.5px rgba(0, 0, 0, 0.03), - 0 2px 4px rgba(0, 0, 0, 0.04), - 0 8px 24px rgba(0, 0, 0, 0.1) !important; - backdrop-filter: blur(20px) saturate(180%) !important; - -webkit-backdrop-filter: blur(20px) saturate(180%) !important; - animation: dropdownSlideIn 0.18s cubic-bezier(0.2, 0, 0, 1) both; - overflow: hidden; - } -} -/* 文档卡片标签选择弹窗 */ -.card-tag-popup { - z-index: 99 !important; - .t-popup__content { - padding: 4px !important; - margin-top: 4px !important; - border-radius: var(--app-radius-lg) !important; - background: var(--td-bg-color-container) !important; - border: 0.5px solid var(--td-component-stroke) !important; - box-shadow: - 0 0 0 0.5px rgba(0, 0, 0, 0.03), - 0 2px 4px rgba(0, 0, 0, 0.04), - 0 8px 24px rgba(0, 0, 0, 0.1) !important; - backdrop-filter: blur(20px) saturate(180%) !important; - -webkit-backdrop-filter: blur(20px) saturate(180%) !important; - animation: dropdownSlideIn 0.18s cubic-bezier(0.2, 0, 0, 1) both; - overflow: hidden; - } - - .tag-popup-list { - min-width: 160px; - max-width: 240px; - max-height: 280px; - overflow-y: auto; - display: flex; - flex-direction: column; - gap: 2px; - } - - .tag-popup-item { - display: flex; - align-items: center; - gap: 6px; - padding: 6px 8px; - border-radius: var(--app-radius-sm); - font-size: var(--app-text-md); - color: var(--td-text-color-primary); - cursor: pointer; - line-height: 1.2; - transition: background-color var(--app-motion-fast) ease; - - &:hover { - background: var(--td-bg-color-container-hover); - } - - &.is-selected { - color: var(--td-brand-color); - background: var(--td-bg-color-secondarycontainer); - } - } - - .tag-popup-check { - font-size: var(--app-text-base); - color: var(--td-brand-color); - visibility: hidden; - flex-shrink: 0; - - &.visible { - visibility: visible; - } - } - - .tag-popup-name { - flex: 1; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - - &.muted { - color: var(--td-text-color-secondary); - } - } - - .tag-popup-item.is-action { - color: var(--td-text-color-secondary); - - .tag-popup-check { - visibility: visible; - color: var(--td-text-color-secondary); - } - - &:hover { - color: var(--td-error-color); - background: var(--td-error-color-1); - - .tag-popup-check { - color: var(--td-error-color); - } - } - } - - .tag-popup-divider { - height: 1px; - margin: 4px 4px; - background: var(--td-component-stroke); - } -} /* ============================================ 五、锚定表单/确认弹层(成员邀请、Wiki 移动/删除等) @@ -680,8 +570,6 @@ :root[theme-mode="dark"] { .card-more-popup .t-popup__content, .card-more .t-popup__content, - .tag-more-popup .t-popup__content, - .card-tag-popup .t-popup__content, .anchored-form-popup-overlay .t-popup__content { background: rgba(36, 36, 36, 0.92) !important; border-color: rgba(255, 255, 255, 0.08) !important; @@ -700,13 +588,14 @@ 0 8px 32px rgba(0, 0, 0, 0.28); } + .t-popup__content.t-dropdown { + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 6px 20px rgba(0, 0, 0, 0.24); + } + .t-popup__content .t-dropdown__menu { - background: rgba(36, 36, 36, 0.85); - border-color: rgba(255, 255, 255, 0.08); - box-shadow: - 0 0 0 0.5px rgba(255, 255, 255, 0.05), - 0 2px 4px rgba(0, 0, 0, 0.12), - 0 8px 32px rgba(0, 0, 0, 0.28); + background: var(--td-bg-color-container); + border: 0; + box-shadow: none; &:hover { scrollbar-color: rgba(255, 255, 255, 0.22) transparent; diff --git a/frontend/src/assets/theme/tdesign-overrides.less b/frontend/src/assets/theme/tdesign-overrides.less index 59367bc3..e48294a2 100644 --- a/frontend/src/assets/theme/tdesign-overrides.less +++ b/frontend/src/assets/theme/tdesign-overrides.less @@ -20,3 +20,28 @@ background: rgba(36, 36, 36, 0.92); border-color: rgba(255, 255, 255, 0.08); } + +// A quiet option surface, with the brand accent reserved for the small check. +.t-select-option.t-is-selected:not(.t-is-disabled), +.t-select-option.t-is-selected:not(.t-is-disabled):hover { + background-color: var(--app-selection-bg); + color: var(--td-text-color-primary); + font-weight: 500; +} + +// A check keeps single-selection menus distinct from hover without using color alone. +.t-select-option.t-is-selected:not(.t-is-disabled):not(:has(.t-checkbox))::after { + content: ''; + flex: 0 0 auto; + width: 5px; + height: 9px; + margin-left: auto; + margin-right: 2px; + color: var(--td-brand-color); + border: solid currentColor; + border-width: 0 1.5px 1.5px 0; + transform: translateY(-1px) rotate(45deg); +} +.t-select-option.t-is-selected:not(.t-is-disabled):not(:has(.t-checkbox)) { + gap: 8px; +} diff --git a/frontend/src/assets/theme/theme.css b/frontend/src/assets/theme/theme.css index e6123386..51aa6541 100644 --- a/frontend/src/assets/theme/theme.css +++ b/frontend/src/assets/theme/theme.css @@ -201,6 +201,14 @@ select:-webkit-autofill { box-shadow: none; } +/* Keep selection surfaces quiet; small indicators retain the brand accent. */ +:root { + --app-selection-bg: color-mix(in srgb, var(--td-text-color-primary) 4%, var(--td-bg-color-container)); + --app-selection-text: var(--td-text-color-primary); + --app-selection-border: color-mix(in srgb, var(--td-brand-color) 30%, var(--td-component-stroke)); + --app-focus-border: var(--td-brand-color); +} + /* 应用级强调色:智能体 / 图谱等「非品牌但反复出现」的语义色,透明叠加请用 color-mix */ :root { --app-accent-purple: #7c4dff; @@ -223,6 +231,9 @@ select:-webkit-autofill { * 新代码请引用令牌,样式守卫会统计残留字面量。 * ============================================================ */ :root { + /* 对话标题与右侧面板共用同一条头部分割线。 */ + --app-chat-header-height: 40px; + /* 圆角 */ --app-radius-xs: 4px; --app-radius-sm: 6px; diff --git a/frontend/src/components/ChatAttachmentPreviewDrawer.vue b/frontend/src/components/ChatAttachmentPreviewDrawer.vue index dec2b0f8..67f03aa6 100644 --- a/frontend/src/components/ChatAttachmentPreviewDrawer.vue +++ b/frontend/src/components/ChatAttachmentPreviewDrawer.vue @@ -163,15 +163,15 @@ onUnmounted(() => { .chat-attachment-drawer-header-icon { flex-shrink: 0; - width: 32px; - height: 32px; - border-radius: 9px; + width: 24px; + height: 24px; + border-radius: var(--app-radius-sm); display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--td-brand-color) 10%, transparent); color: var(--td-brand-color); - font-size: var(--app-text-xl); + font-size: var(--app-text-lg); } .chat-attachment-drawer-header-text { @@ -180,9 +180,9 @@ onUnmounted(() => { } .chat-attachment-drawer-header-title { - font-size: var(--app-text-lg); - font-weight: 600; - line-height: 1.4; + font-size: var(--app-text-base); + font-weight: 500; + line-height: 20px; color: var(--td-text-color-primary); overflow: hidden; text-overflow: ellipsis; @@ -240,11 +240,19 @@ onUnmounted(() => { } .t-drawer__header { - padding: 14px 18px; + height: var(--app-chat-header-height); + min-height: var(--app-chat-header-height); + padding: 0 12px; border-bottom: 1px solid var(--td-component-stroke); flex-shrink: 0; } + .t-drawer__close-btn { + top: calc((var(--app-chat-header-height) - 28px) / 2); + width: 28px; + height: 28px; + } + .t-drawer__body { flex: 1; min-height: 0; diff --git a/frontend/src/components/ChatHeader.vue b/frontend/src/components/ChatHeader.vue index 9b574f17..d987c9d2 100644 --- a/frontend/src/components/ChatHeader.vue +++ b/frontend/src/components/ChatHeader.vue @@ -1,5 +1,5 @@