feat: add navbar poptip

This commit is contained in:
Pleasurecruise 2025-03-05 20:39:18 +08:00 committed by kangfenmao
parent fa32cd13cf
commit e656db779e
6 changed files with 59 additions and 18 deletions

View File

@ -481,6 +481,11 @@
"websearch": "WebSearch", "websearch": "WebSearch",
"edit": "Edit Model" "edit": "Edit Model"
}, },
"navbar": {
"expand": "Expand Dialog",
"show_sidebar": "Show Sidebar",
"hide_sidebar": "Hide Sidebar"
},
"ollama": { "ollama": {
"keep_alive_time.description": "The time in minutes to keep the connection alive, default is 5 minutes.", "keep_alive_time.description": "The time in minutes to keep the connection alive, default is 5 minutes.",
"keep_alive_time.placeholder": "Minutes", "keep_alive_time.placeholder": "Minutes",

View File

@ -481,6 +481,11 @@
"websearch": "ウェブ検索", "websearch": "ウェブ検索",
"edit": "モデルを編集" "edit": "モデルを編集"
}, },
"navbar": {
"expand": "ダイアログを展開",
"show_sidebar": "サイドバーを表示",
"hide_sidebar": "サイドバーを非表示"
},
"ollama": { "ollama": {
"keep_alive_time.description": "モデルがメモリに保持される時間デフォルト5分", "keep_alive_time.description": "モデルがメモリに保持される時間デフォルト5分",
"keep_alive_time.placeholder": "分", "keep_alive_time.placeholder": "分",

View File

@ -481,6 +481,11 @@
"websearch": "Веб-поисковые", "websearch": "Веб-поисковые",
"edit": "Редактировать модель" "edit": "Редактировать модель"
}, },
"navbar": {
"expand": "Развернуть диалоговое окно",
"show_sidebar": "Показать боковую панель",
"hide_sidebar": "Скрыть боковую панель"
},
"ollama": { "ollama": {
"keep_alive_time.description": "Время в минутах, в течение которого модель остается активной, по умолчанию 5 минут.", "keep_alive_time.description": "Время в минутах, в течение которого модель остается активной, по умолчанию 5 минут.",
"keep_alive_time.placeholder": "Минуты", "keep_alive_time.placeholder": "Минуты",

View File

@ -481,6 +481,11 @@
"websearch": "联网", "websearch": "联网",
"edit": "编辑模型" "edit": "编辑模型"
}, },
"navbar": {
"expand": "伸缩对话框",
"show_sidebar": "显示侧边栏",
"hide_sidebar": "隐藏侧边栏"
},
"ollama": { "ollama": {
"keep_alive_time.description": "对话后模型在内存中保持的时间默认5分钟", "keep_alive_time.description": "对话后模型在内存中保持的时间默认5分钟",
"keep_alive_time.placeholder": "分钟", "keep_alive_time.placeholder": "分钟",

View File

@ -481,6 +481,11 @@
"websearch": "網路搜索", "websearch": "網路搜索",
"edit": "編輯模型" "edit": "編輯模型"
}, },
"navbar": {
"expand": "伸縮對話框",
"show_sidebar": "顯示側邊欄",
"hide_sidebar": "隱藏側邊欄"
},
"ollama": { "ollama": {
"keep_alive_time.description": "對話後模型在記憶體中保持的時間(預設為 5 分鐘)。", "keep_alive_time.description": "對話後模型在記憶體中保持的時間(預設為 5 分鐘)。",
"keep_alive_time.placeholder": "分鐘", "keep_alive_time.placeholder": "分鐘",

View File

@ -14,6 +14,8 @@ import { EVENT_NAMES, EventEmitter } from '@renderer/services/EventService'
import { useAppDispatch } from '@renderer/store' import { useAppDispatch } from '@renderer/store'
import { setNarrowMode } from '@renderer/store/settings' import { setNarrowMode } from '@renderer/store/settings'
import { Assistant, Topic } from '@renderer/types' import { Assistant, Topic } from '@renderer/types'
import { Tooltip } from 'antd'
import { t } from 'i18next'
import { FC } from 'react' import { FC } from 'react'
import styled from 'styled-components' import styled from 'styled-components'
@ -58,12 +60,16 @@ const HeaderNavbar: FC<Props> = ({ activeAssistant }) => {
<Navbar className="home-navbar"> <Navbar className="home-navbar">
{showAssistants && ( {showAssistants && (
<NavbarLeft style={{ justifyContent: 'space-between', borderRight: 'none', padding: 0 }}> <NavbarLeft style={{ justifyContent: 'space-between', borderRight: 'none', padding: 0 }}>
<Tooltip title={t('navbar.hide_sidebar')} mouseEnterDelay={0.8}>
<NavbarIcon onClick={toggleShowAssistants} style={{ marginLeft: isMac ? 16 : 0 }}> <NavbarIcon onClick={toggleShowAssistants} style={{ marginLeft: isMac ? 16 : 0 }}>
<i className="iconfont icon-hide-sidebar" /> <i className="iconfont icon-hide-sidebar" />
</NavbarIcon> </NavbarIcon>
</Tooltip>
<Tooltip title={t('settings.shortcuts.new_topic')} mouseEnterDelay={0.8}>
<NavbarIcon onClick={() => EventEmitter.emit(EVENT_NAMES.ADD_NEW_TOPIC)}> <NavbarIcon onClick={() => EventEmitter.emit(EVENT_NAMES.ADD_NEW_TOPIC)}>
<FormOutlined /> <FormOutlined />
</NavbarIcon> </NavbarIcon>
</Tooltip>
</NavbarLeft> </NavbarLeft>
)} )}
<NavbarRight <NavbarRight
@ -71,9 +77,13 @@ const HeaderNavbar: FC<Props> = ({ activeAssistant }) => {
className="home-navbar-right"> className="home-navbar-right">
<HStack alignItems="center"> <HStack alignItems="center">
{!showAssistants && ( {!showAssistants && (
<NavbarIcon onClick={() => toggleShowAssistants()} style={{ marginRight: 8, marginLeft: isMac ? 4 : -12 }}> <Tooltip title={t('navbar.show_sidebar')} mouseEnterDelay={0.8}>
<NavbarIcon
onClick={() => toggleShowAssistants()}
style={{ marginRight: 8, marginLeft: isMac ? 4 : -12 }}>
<i className="iconfont icon-show-sidebar" /> <i className="iconfont icon-show-sidebar" />
</NavbarIcon> </NavbarIcon>
</Tooltip>
)} )}
<TitleText <TitleText
style={{ marginRight: 10, cursor: 'pointer' }} style={{ marginRight: 10, cursor: 'pointer' }}
@ -85,17 +95,23 @@ const HeaderNavbar: FC<Props> = ({ activeAssistant }) => {
</HStack> </HStack>
<HStack alignItems="center" gap={8}> <HStack alignItems="center" gap={8}>
<UpdateAppButton /> <UpdateAppButton />
<Tooltip title={t('chat.assistant.search.placeholder')} mouseEnterDelay={0.8}>
<NarrowIcon onClick={() => SearchPopup.show()}> <NarrowIcon onClick={() => SearchPopup.show()}>
<SearchOutlined /> <SearchOutlined />
</NarrowIcon> </NarrowIcon>
</Tooltip>
<Tooltip title={t('navbar.expand')} mouseEnterDelay={0.8}>
<NarrowIcon onClick={handleNarrowModeToggle}> <NarrowIcon onClick={handleNarrowModeToggle}>
<i className="iconfont icon-icon-adaptive-width"></i> <i className="iconfont icon-icon-adaptive-width"></i>
</NarrowIcon> </NarrowIcon>
</Tooltip>
{sidebarIcons.visible.includes('minapp') && ( {sidebarIcons.visible.includes('minapp') && (
<MinAppsPopover> <MinAppsPopover>
<Tooltip title={t('minapp.title')} mouseEnterDelay={0.8}>
<NarrowIcon> <NarrowIcon>
<i className="iconfont icon-appstore" /> <i className="iconfont icon-appstore" />
</NarrowIcon> </NarrowIcon>
</Tooltip>
</MinAppsPopover> </MinAppsPopover>
)} )}
{topicPosition === 'right' && ( {topicPosition === 'right' && (