feat(agent): add tooltip for model selection and improve i18n (#11738)

* refactor(settings): rename actions prop to contentAfter for clarity

The prop name 'actions' was misleading as it could imply functionality rather than layout. 'contentAfter' better describes its purpose of displaying content after the title.

* feat(agent): add tooltip for model selection in agent settings

Add tooltip to explain that only Anthropic endpoint models are supported for agents

* feat(i18n): add model tooltip and translate upload strings

Add tooltip message about Anthropic endpoint model requirement for Agent feature
Translate previously untranslated upload-related strings in multiple languages
This commit is contained in:
Phantom 2025-12-08 10:58:56 +08:00 committed by GitHub
parent 516b8479d6
commit bba7ecae6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 70 additions and 33 deletions

View File

@ -1,5 +1,6 @@
import { loggerService } from '@logger'
import { ErrorBoundary } from '@renderer/components/ErrorBoundary'
import { HelpTooltip } from '@renderer/components/TooltipIcons'
import { TopView } from '@renderer/components/TopView'
import { permissionModeCards } from '@renderer/config/agent'
import { useAgents } from '@renderer/hooks/agents/useAgents'
@ -340,9 +341,12 @@ const PopupContainer: React.FC<Props> = ({ agent, afterSubmit, resolve }) => {
</FormRow>
<FormItem>
<Label>
{t('common.model')} <RequiredMark>*</RequiredMark>
</Label>
<div className="flex items-center gap-2">
<Label>
{t('common.model')} <RequiredMark>*</RequiredMark>
</Label>
<HelpTooltip title={t('agent.add.model.tooltip')} />
</div>
<SelectAgentBaseModelButton
agentBase={tempAgentBase}
onSelect={handleModelSelect}

View File

@ -6,6 +6,9 @@
"failed": "Failed to add a agent",
"invalid_agent": "Invalid Agent"
},
"model": {
"tooltip": "Currently, only models that support Anthropic endpoints are available for the Agent feature."
},
"title": "Add Agent",
"type": {
"placeholder": "Select an agent type"

View File

@ -6,6 +6,9 @@
"failed": "添加 Agent 失败",
"invalid_agent": "无效的 Agent"
},
"model": {
"tooltip": "目前,只有支持 Anthropic 端点的模型可用于 Agent 功能。"
},
"title": "添加 Agent",
"type": {
"placeholder": "选择 Agent 类型"

View File

@ -6,6 +6,9 @@
"failed": "無法新增代理人",
"invalid_agent": "無效的 Agent"
},
"model": {
"tooltip": "目前,僅支援 Anthropic 端點的模型可供代理功能使用。"
},
"title": "新增代理",
"type": {
"placeholder": "選擇 Agent 類型"
@ -2220,8 +2223,8 @@
"untitled_folder": "新資料夾",
"untitled_note": "無標題筆記",
"upload_failed": "筆記上傳失敗",
"upload_files": "[to be translated]:Upload Files",
"upload_folder": "[to be translated]:Upload Folder",
"upload_files": "上傳檔案",
"upload_folder": "上傳資料夾",
"upload_success": "筆記上傳成功",
"uploading_files": "正在上傳 {{count}} 個檔案..."
},

View File

@ -6,6 +6,9 @@
"failed": "Agent hinzufügen fehlgeschlagen",
"invalid_agent": "Ungültiger Agent"
},
"model": {
"tooltip": "Derzeit sind für die Agent-Funktion nur Modelle verfügbar, die Anthropic-Endpunkte unterstützen."
},
"title": "Agent hinzufügen",
"type": {
"placeholder": "Agent-Typ auswählen"
@ -2220,10 +2223,10 @@
"untitled_folder": "Neuer Ordner",
"untitled_note": "Unbenannte Notiz",
"upload_failed": "Notizen-Upload fehlgeschlagen",
"upload_files": "[to be translated]:Upload Files",
"upload_folder": "[to be translated]:Upload Folder",
"upload_files": "Dateien hochladen",
"upload_folder": "Ordner hochladen",
"upload_success": "Notizen erfolgreich hochgeladen",
"uploading_files": "[to be translated]:Uploading {{count}} files..."
"uploading_files": "Lade {{count}} Dateien hoch..."
},
"notification": {
"assistant": "Assistenten-Antwort",

View File

@ -6,6 +6,9 @@
"failed": "Αποτυχία προσθήκης πράκτορα",
"invalid_agent": "Μη έγκυρος Agent"
},
"model": {
"tooltip": "Προς το παρόν, μόνο μοντέλα που υποστηρίζουν τελικά σημεία Anthropic είναι διαθέσιμα για τη λειτουργία Agent."
},
"title": "Προσθήκη Agent",
"type": {
"placeholder": "Επιλέξτε τύπο Agent"
@ -2220,10 +2223,10 @@
"untitled_folder": "Νέος φάκελος",
"untitled_note": "σημείωση χωρίς τίτλο",
"upload_failed": "Η σημείωση δεν ανέβηκε",
"upload_files": "[to be translated]:Upload Files",
"upload_folder": "[to be translated]:Upload Folder",
"upload_files": "Ανέβασμα Αρχείων",
"upload_folder": "Ανέβασμα Φακέλου",
"upload_success": "Οι σημειώσεις μεταφορτώθηκαν με επιτυχία",
"uploading_files": "[to be translated]:Uploading {{count}} files..."
"uploading_files": "Ανεβάζονται {{count}} αρχεία..."
},
"notification": {
"assistant": "Απάντηση Βοηθού",

View File

@ -6,6 +6,9 @@
"failed": "Error al añadir agente",
"invalid_agent": "Agent inválido"
},
"model": {
"tooltip": "Actualmente, solo los modelos que admiten puntos finales de Anthropic están disponibles para la función Agente."
},
"title": "Agregar Agente",
"type": {
"placeholder": "Seleccionar tipo de Agente"
@ -2220,10 +2223,10 @@
"untitled_folder": "Nueva carpeta",
"untitled_note": "Nota sin título",
"upload_failed": "Error al cargar la nota",
"upload_files": "[to be translated]:Upload Files",
"upload_folder": "[to be translated]:Upload Folder",
"upload_files": "Subir archivos",
"upload_folder": "Carpeta de subida",
"upload_success": "Nota cargada con éxito",
"uploading_files": "[to be translated]:Uploading {{count}} files..."
"uploading_files": "Subiendo {{count}} archivos..."
},
"notification": {
"assistant": "Respuesta del asistente",

View File

@ -6,6 +6,9 @@
"failed": "Échec de l'ajout de l'agent",
"invalid_agent": "Agent invalide"
},
"model": {
"tooltip": "Actuellement, seuls les modèles qui prennent en charge les points de terminaison Anthropic sont disponibles pour la fonctionnalité Agent."
},
"title": "Ajouter un agent",
"type": {
"placeholder": "Sélectionner le type d'Agent"
@ -2220,10 +2223,10 @@
"untitled_folder": "nouveau dossier",
"untitled_note": "Note sans titre",
"upload_failed": "Échec du téléchargement de la note",
"upload_files": "[to be translated]:Upload Files",
"upload_folder": "[to be translated]:Upload Folder",
"upload_files": "Télécharger des fichiers",
"upload_folder": "Puis dossier de téléchargement",
"upload_success": "Note téléchargée avec succès",
"uploading_files": "[to be translated]:Uploading {{count}} files..."
"uploading_files": "Téléchargement de {{count}} fichiers..."
},
"notification": {
"assistant": "Réponse de l'assistant",

View File

@ -6,6 +6,9 @@
"failed": "エージェントの追加に失敗しました",
"invalid_agent": "無効なエージェント"
},
"model": {
"tooltip": "現在、エージェント機能では、Anthropicエンドポイントをサポートするモデルのみが利用可能です。"
},
"title": "エージェントを追加",
"type": {
"placeholder": "エージェントタイプを選択"
@ -2220,10 +2223,10 @@
"untitled_folder": "新ファイル夹",
"untitled_note": "無題のメモ",
"upload_failed": "ノートのアップロードに失敗しました",
"upload_files": "[to be translated]:Upload Files",
"upload_folder": "[to be translated]:Upload Folder",
"upload_files": "ファイルをアップロード",
"upload_folder": "アップロードフォルダ",
"upload_success": "ノートのアップロードが成功しました",
"uploading_files": "[to be translated]:Uploading {{count}} files..."
"uploading_files": "{{count}} 個のファイルをアップロード中..."
},
"notification": {
"assistant": "助手回應",

View File

@ -6,6 +6,9 @@
"failed": "Falha ao adicionar agente",
"invalid_agent": "Agent inválido"
},
"model": {
"tooltip": "Atualmente, apenas modelos que suportam endpoints da Anthropic estão disponíveis para o recurso Agente."
},
"title": "Adicionar Agente",
"type": {
"placeholder": "Selecionar tipo de Agente"
@ -2220,10 +2223,10 @@
"untitled_folder": "Nova pasta",
"untitled_note": "Nota sem título",
"upload_failed": "Falha ao carregar a nota",
"upload_files": "[to be translated]:Upload Files",
"upload_folder": "[to be translated]:Upload Folder",
"upload_files": "Carregar Ficheiros",
"upload_folder": "Carregar Pasta",
"upload_success": "Nota carregada com sucesso",
"uploading_files": "[to be translated]:Uploading {{count}} files..."
"uploading_files": "A enviar {{count}} ficheiros..."
},
"notification": {
"assistant": "Resposta do assistente",

View File

@ -6,6 +6,9 @@
"failed": "Не удалось добавить агента",
"invalid_agent": "Недействительный агент"
},
"model": {
"tooltip": "В настоящее время для функции агента доступны только модели, поддерживающие конечные точки Anthropic."
},
"title": "Добавить агента",
"type": {
"placeholder": "Выбор типа агента"
@ -2220,10 +2223,10 @@
"untitled_folder": "Новая папка",
"untitled_note": "Незаглавленная заметка",
"upload_failed": "Не удалось загрузить заметку",
"upload_files": "[to be translated]:Upload Files",
"upload_folder": "[to be translated]:Upload Folder",
"upload_files": "Загрузить файлы",
"upload_folder": "Загрузить папку",
"upload_success": "Заметка успешно загружена",
"uploading_files": "[to be translated]:Uploading {{count}} files..."
"uploading_files": "Загрузка {{count}} файлов..."
},
"notification": {
"assistant": "Ответ ассистента",

View File

@ -64,7 +64,7 @@ export const AccessibleDirsSetting = ({ base, update }: AccessibleDirsSettingPro
return (
<SettingsItem>
<SettingsTitle
actions={
contentAfter={
<Tooltip title={t('agent.session.accessible_paths.add')}>
<Button type="text" icon={<Plus size={16} />} shape="circle" onClick={addAccessiblePath} />
</Tooltip>

View File

@ -69,7 +69,7 @@ export const AdvancedSettings: React.FC<AdvancedSettingsProps> = ({ agentBase, u
<SettingsContainer>
<SettingsItem divider={false}>
<SettingsTitle
actions={
contentAfter={
<Tooltip title={t('agent.settings.advance.maxTurns.description')} placement="left">
<Info size={16} className="text-foreground-400" />
</Tooltip>

View File

@ -1,3 +1,4 @@
import { HelpTooltip } from '@renderer/components/TooltipIcons'
import SelectAgentBaseModelButton from '@renderer/pages/home/components/SelectAgentBaseModelButton'
import type { AgentBaseWithId, ApiModel, UpdateAgentFunctionUnion } from '@renderer/types'
import { useTranslation } from 'react-i18next'
@ -22,7 +23,9 @@ export const ModelSetting = ({ base, update, isDisabled }: ModelSettingProps) =>
return (
<SettingsItem inline>
<SettingsTitle id="model">{t('common.model')}</SettingsTitle>
<SettingsTitle id="model" contentAfter={<HelpTooltip title={t('agent.add.model.tooltip')} />}>
{t('common.model')}
</SettingsTitle>
<SelectAgentBaseModelButton
agentBase={base}
onSelect={async (model) => {

View File

@ -10,14 +10,14 @@ import styled from 'styled-components'
import { SettingDivider } from '..'
export interface SettingsTitleProps extends React.ComponentPropsWithRef<'div'> {
actions?: ReactNode
contentAfter?: ReactNode
}
export const SettingsTitle: React.FC<SettingsTitleProps> = ({ children, actions }) => {
export const SettingsTitle: React.FC<SettingsTitleProps> = ({ children, contentAfter }) => {
return (
<div className={cn(actions ? 'justify-between' : undefined, 'mb-1 flex items-center gap-2')}>
<div className={cn(contentAfter ? 'justify-between' : undefined, 'mb-1 flex items-center gap-2')}>
<span className="flex items-center gap-1 font-bold">{children}</span>
{actions !== undefined && actions}
{contentAfter !== undefined && contentAfter}
</div>
)
}