From 88a0201afe73137666520d43e778ea3cd1fdab21 Mon Sep 17 00:00:00 2001 From: wizardchen Date: Thu, 16 Jul 2026 19:13:11 +0800 Subject: [PATCH] style(chat): simplify suggestion copy and align hover with chat UI Shorten follow-up and refresh labels across locales, and replace flashy suggestion card hovers with the same border, neutral background, and shadow treatment used elsewhere in the chat page. --- .../components/chat/FollowUpSuggestions.vue | 9 +-- .../components/css/suggested-questions.less | 70 ++----------------- frontend/src/i18n/embed.ts | 34 ++++----- frontend/src/i18n/locales/en-US.ts | 8 +-- frontend/src/i18n/locales/ko-KR.ts | 8 +-- frontend/src/i18n/locales/ru-RU.ts | 8 +-- frontend/src/i18n/locales/zh-CN.ts | 8 +-- 7 files changed, 46 insertions(+), 99 deletions(-) diff --git a/frontend/src/components/chat/FollowUpSuggestions.vue b/frontend/src/components/chat/FollowUpSuggestions.vue index 707f1a6e..b2945d49 100644 --- a/frontend/src/components/chat/FollowUpSuggestions.vue +++ b/frontend/src/components/chat/FollowUpSuggestions.vue @@ -120,18 +120,19 @@ const dismiss = () => { gap: 12px; width: 100%; padding: 9px 11px; - border: 1px solid transparent; + border: 1px solid var(--td-component-stroke); border-radius: 8px; background: var(--td-bg-color-container); color: var(--td-text-color-primary); text-align: left; cursor: pointer; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); + transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; } -.follow-ups__item { transition: border-color .2s, box-shadow .2s, transform .2s; } .follow-ups__item:hover { border-color: var(--td-brand-color); - box-shadow: 0 4px 14px rgba(0, 0, 0, .12); - transform: translateY(-1px); + background: var(--td-bg-color-container-hover); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); } .follow-ups__item:hover .t-icon { color: var(--td-brand-color); } .is-spinning { animation: spin 1s linear infinite; } diff --git a/frontend/src/components/css/suggested-questions.less b/frontend/src/components/css/suggested-questions.less index 8f58021a..0288f11b 100644 --- a/frontend/src/components/css/suggested-questions.less +++ b/frontend/src/components/css/suggested-questions.less @@ -68,7 +68,7 @@ } &:active:not(:disabled) { - transform: scale(0.92); + background: var(--td-bg-color-secondarycontainer); } &:disabled { @@ -114,63 +114,17 @@ background: var(--td-bg-color-container); cursor: pointer; overflow: hidden; - transition: - background 0.25s @suggested-ease, - border-color 0.25s @suggested-ease, - box-shadow 0.25s @suggested-ease, - transform 0.2s @suggested-ease; - - // 左侧主题色渐隐高光,hover 时淡入,营造柔和的呼吸感 - &::before { - content: ""; - position: absolute; - inset: 0; - border-radius: inherit; - background: linear-gradient( - 105deg, - var(--td-brand-color-light) 0%, - transparent 55% - ); - opacity: 0; - transition: opacity 0.25s @suggested-ease; - pointer-events: none; - } + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); + transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease; &:not(.sq-card-skeleton):hover { - border-color: var(--td-brand-color-light-active, var(--td-brand-color)); - background: var(--td-bg-color-container); - box-shadow: 0 3px 10px -8px rgba(0, 0, 0, 0.14); - transform: translateY(-1px); - - &::before { - opacity: 0.45; - } - } - - // 右侧引导箭头:默认隐藏并向左收起,hover 时滑入 - &::after { - content: "›"; - position: relative; - flex-shrink: 0; - margin-left: -2px; - font-size: 17px; - line-height: 1; - color: var(--td-brand-color); - opacity: 0; - transform: translateX(-6px); - transition: - opacity 0.25s @suggested-ease, - transform 0.25s @suggested-ease; + border-color: var(--td-brand-color); + background: var(--td-bg-color-container-hover); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); } &:not(.sq-card-skeleton):active { - transform: translateY(0) scale(0.99); - box-shadow: 0 2px 8px -6px rgba(0, 0, 0, 0.2); - } - - &:not(.sq-card-skeleton):hover::after { - opacity: 1; - transform: translateX(0); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); } &.sq-card-skeleton { @@ -196,11 +150,6 @@ width: 210px; } - &::before, - &::after { - display: none; - } - :deep(.t-skeleton) { width: 100%; } @@ -226,11 +175,6 @@ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - transition: color 0.2s @suggested-ease; -} - -.suggested-question-card:not(.sq-card-skeleton):hover .suggested-question-text { - color: var(--td-brand-color); } .suggested-question-badge { diff --git a/frontend/src/i18n/embed.ts b/frontend/src/i18n/embed.ts index 20778e78..d644d743 100644 --- a/frontend/src/i18n/embed.ts +++ b/frontend/src/i18n/embed.ts @@ -76,10 +76,10 @@ const messages = { "title": "对话", "newChat": "新对话", "suggestedQuestions": "你可以这样问我", - "suggestedQuestionsLoading": "正在加载推荐问题...", - "followUpQuestions": "接下来可以继续问", - "followUpQuestionsLoading": "整理后续问题", - "refreshSuggestedQuestions": "换一批推荐问题", + "suggestedQuestionsLoading": "加载中...", + "followUpQuestions": "继续问", + "followUpQuestionsLoading": "加载推荐问题", + "refreshSuggestedQuestions": "换一批", "inputPlaceholder": "请输入您的消息...", "send": "发送", "thinking": "思考中...", @@ -567,10 +567,10 @@ const messages = { "title": "Chat", "newChat": "New Chat", "suggestedQuestions": "You can ask me", - "suggestedQuestionsLoading": "Loading suggestions...", - "followUpQuestions": "Continue with a follow-up", - "followUpQuestionsLoading": "Preparing follow-ups", - "refreshSuggestedQuestions": "Refresh suggestions", + "suggestedQuestionsLoading": "Loading...", + "followUpQuestions": "Keep asking", + "followUpQuestionsLoading": "Loading suggested questions", + "refreshSuggestedQuestions": "More", "inputPlaceholder": "Enter your message...", "send": "Send", "thinking": "Thinking...", @@ -1044,10 +1044,11 @@ const koEmbedPublish = { }, chat: { suggestedQuestions: '이렇게 물어보세요', - suggestedQuestionsLoading: '추천 질문 로딩 중...', - followUpQuestions: '이어서 질문해 보세요', - followUpQuestionsLoading: '후속 질문 준비 중', - refreshSuggestedQuestions: '추천 질문 새로고침', + suggestedQuestionsLoading: '로딩 중...', + followUpQuestions: '이어서 질문', + followUpQuestionsLoading: '추천 질문 로딩 중', + thinkingAlt: '생각 중', + refreshSuggestedQuestions: '다른 질문', imageTooMany: '이미지는 최대 5장까지 업로드할 수 있습니다', imageTypeSizeError: 'JPG/PNG/GIF/WEBP만 지원하며, 각 파일은 10MB 이하여야 합니다', imageReadFailed: '이미지를 읽지 못했습니다', @@ -1131,10 +1132,11 @@ const ruEmbedPublish = { }, chat: { suggestedQuestions: 'Вы можете спросить так', - suggestedQuestionsLoading: 'Загрузка предложений...', - followUpQuestions: 'Продолжите уточняющим вопросом', - followUpQuestionsLoading: 'Подготовка уточнений', - refreshSuggestedQuestions: 'Обновить предложения', + suggestedQuestionsLoading: 'Загрузка...', + followUpQuestions: 'Спрашивайте дальше', + followUpQuestionsLoading: 'Загрузка рекомендуемых вопросов', + thinkingAlt: 'Обдумывание...', + refreshSuggestedQuestions: 'Ещё', imageTooMany: 'Можно загрузить не более 5 изображений', imageTypeSizeError: 'Поддерживаются только JPG/PNG/GIF/WEBP, каждый файл до 10 МБ', imageReadFailed: 'Не удалось прочитать изображение', diff --git a/frontend/src/i18n/locales/en-US.ts b/frontend/src/i18n/locales/en-US.ts index 76c19ac7..43767bdc 100755 --- a/frontend/src/i18n/locales/en-US.ts +++ b/frontend/src/i18n/locales/en-US.ts @@ -3132,10 +3132,10 @@ export default { title: 'Chat', newChat: 'New Chat', suggestedQuestions: 'You can ask me', - followUpQuestions: 'Continue with a follow-up', - followUpQuestionsLoading: 'Preparing follow-ups', - suggestedQuestionsLoading: 'Loading suggestions...', - refreshSuggestedQuestions: 'Refresh suggestions', + followUpQuestions: 'Keep asking', + followUpQuestionsLoading: 'Loading suggested questions', + suggestedQuestionsLoading: 'Loading...', + refreshSuggestedQuestions: 'More', inputPlaceholder: 'Enter your message...', send: 'Send', thinking: 'Thinking...', diff --git a/frontend/src/i18n/locales/ko-KR.ts b/frontend/src/i18n/locales/ko-KR.ts index 2fe9ce49..5b3f56f4 100755 --- a/frontend/src/i18n/locales/ko-KR.ts +++ b/frontend/src/i18n/locales/ko-KR.ts @@ -900,10 +900,10 @@ export default { title: "대화", newChat: "새 대화", suggestedQuestions: "이렇게 물어보세요", - followUpQuestions: "이어서 질문해 보세요", - followUpQuestionsLoading: "후속 질문 준비 중", - suggestedQuestionsLoading: "추천 질문 로딩 중...", - refreshSuggestedQuestions: "추천 질문 새로고침", + followUpQuestions: "이어서 질문", + followUpQuestionsLoading: "추천 질문 로딩 중", + suggestedQuestionsLoading: "로딩 중...", + refreshSuggestedQuestions: "다른 질문", inputPlaceholder: "메시지를 입력하세요...", send: "전송", thinking: "생각 중...", diff --git a/frontend/src/i18n/locales/ru-RU.ts b/frontend/src/i18n/locales/ru-RU.ts index 3fe5bd02..db81516b 100755 --- a/frontend/src/i18n/locales/ru-RU.ts +++ b/frontend/src/i18n/locales/ru-RU.ts @@ -3817,10 +3817,10 @@ export default { title: 'Диалог', newChat: 'Новый чат', suggestedQuestions: 'Вы можете спросить меня', - followUpQuestions: 'Продолжите уточняющим вопросом', - followUpQuestionsLoading: 'Подготовка уточнений', - suggestedQuestionsLoading: 'Загрузка предложений...', - refreshSuggestedQuestions: 'Обновить предложения', + followUpQuestions: 'Спрашивайте дальше', + followUpQuestionsLoading: 'Загрузка рекомендуемых вопросов', + suggestedQuestionsLoading: 'Загрузка...', + refreshSuggestedQuestions: 'Ещё', inputPlaceholder: 'Введите ваше сообщение...', send: 'Отправить', thinking: 'Думаю...', diff --git a/frontend/src/i18n/locales/zh-CN.ts b/frontend/src/i18n/locales/zh-CN.ts index 9984d37e..243a4e95 100755 --- a/frontend/src/i18n/locales/zh-CN.ts +++ b/frontend/src/i18n/locales/zh-CN.ts @@ -898,10 +898,10 @@ export default { title: "对话", newChat: "新对话", suggestedQuestions: "你可以这样问我", - followUpQuestions: "接下来可以继续问", - followUpQuestionsLoading: "整理后续问题", - suggestedQuestionsLoading: "正在加载推荐问题...", - refreshSuggestedQuestions: "换一批推荐问题", + followUpQuestions: "继续问", + followUpQuestionsLoading: "加载推荐问题", + suggestedQuestionsLoading: "加载中...", + refreshSuggestedQuestions: "换一批", inputPlaceholder: "请输入您的消息...", send: "发送", thinking: "思考中...",