diff --git a/src/renderer/src/assets/fonts/icon-fonts/iconfont.css b/src/renderer/src/assets/fonts/icon-fonts/iconfont.css index f5f32a31..eddc69d7 100644 --- a/src/renderer/src/assets/fonts/icon-fonts/iconfont.css +++ b/src/renderer/src/assets/fonts/icon-fonts/iconfont.css @@ -1,6 +1,6 @@ @font-face { font-family: 'iconfont'; /* Project id 4563475 */ - src: url('iconfont.woff2?t=1725587595482') format('woff2'); + src: url('iconfont.woff2?t=1725606177995') format('woff2'); } .iconfont { @@ -11,6 +11,10 @@ -moz-osx-font-smoothing: grayscale; } +.icon-a-darkmode:before { + content: '\e6cd'; +} + .icon-ai-model:before { content: '\e827'; } diff --git a/src/renderer/src/assets/fonts/icon-fonts/iconfont.woff2 b/src/renderer/src/assets/fonts/icon-fonts/iconfont.woff2 index d9327f93..067b1a9d 100644 Binary files a/src/renderer/src/assets/fonts/icon-fonts/iconfont.woff2 and b/src/renderer/src/assets/fonts/icon-fonts/iconfont.woff2 differ diff --git a/src/renderer/src/assets/styles/markdown.scss b/src/renderer/src/assets/styles/markdown.scss index bc414168..81c313fa 100644 --- a/src/renderer/src/assets/styles/markdown.scss +++ b/src/renderer/src/assets/styles/markdown.scss @@ -72,6 +72,9 @@ li { margin-bottom: 0.5em; + pre { + margin: 1.5em 0; + } &::marker { color: var(--color-text-3); } @@ -106,7 +109,6 @@ pre { white-space: pre-wrap !important; - padding: 1em 0; border-radius: 5px; overflow-x: auto; font-family: 'Fira Code', 'Courier New', Courier, monospace; diff --git a/src/renderer/src/pages/home/Inputbar/Inputbar.tsx b/src/renderer/src/pages/home/Inputbar/Inputbar.tsx index 4c4c2080..f44a9ef4 100644 --- a/src/renderer/src/pages/home/Inputbar/Inputbar.tsx +++ b/src/renderer/src/pages/home/Inputbar/Inputbar.tsx @@ -8,6 +8,7 @@ import { PauseCircleOutlined, QuestionCircleOutlined } from '@ant-design/icons' +import { isWindows } from '@renderer/config/constant' import { useAssistant } from '@renderer/hooks/useAssistant' import { useSettings } from '@renderer/hooks/useSettings' import { useShowTopics } from '@renderer/hooks/useStore' @@ -263,7 +264,8 @@ const Inputbar: FC = ({ assistant, setActiveTopic }) => { - ⊙ {contextCount} + + {contextCount} ↑{inputTokenCount} / {estimateTokenCount} @@ -379,6 +381,9 @@ const StyledTag = styled(Tag)` padding: 2px 8px; border-width: 0.5; margin: 0; + height: 25px; + font-size: 12px; + line-height: 16px; ` export default Inputbar diff --git a/src/renderer/src/pages/home/Markdown/CodeBlock.tsx b/src/renderer/src/pages/home/Markdown/CodeBlock.tsx index ecf4d698..48103ac4 100644 --- a/src/renderer/src/pages/home/Markdown/CodeBlock.tsx +++ b/src/renderer/src/pages/home/Markdown/CodeBlock.tsx @@ -37,7 +37,7 @@ const CodeBlock: React.FC = ({ children, className, ...rest }) = } return match ? ( -
+ <> {'<' + match[1].toUpperCase() + '>'} {!copied && } @@ -51,11 +51,15 @@ const CodeBlock: React.FC = ({ children, className, ...rest }) = customStyle={{ borderTopLeftRadius: 0, borderTopRightRadius: 0, marginTop: 0 }}> {String(children).replace(/\n$/, '')} -
+ ) : ( - - {children} - + + {String(children).replace(/\n$/, '')} + ) } diff --git a/src/renderer/src/pages/home/Messages/Message.tsx b/src/renderer/src/pages/home/Messages/Message.tsx index b506faf5..bb2a7bff 100644 --- a/src/renderer/src/pages/home/Messages/Message.tsx +++ b/src/renderer/src/pages/home/Messages/Message.tsx @@ -132,7 +132,7 @@ const MessageItem: FC = ({ message, index, showMenu, onDeleteMessage }) = if (message.type === 'clear') { return ( - + {t('chat.message.new.context')} ) diff --git a/src/renderer/src/pages/home/Navbar.tsx b/src/renderer/src/pages/home/Navbar.tsx index 24f62ef5..19d48d91 100644 --- a/src/renderer/src/pages/home/Navbar.tsx +++ b/src/renderer/src/pages/home/Navbar.tsx @@ -10,7 +10,6 @@ import { useSettings } from '@renderer/hooks/useSettings' import { useShowAssistants, useShowTopics } from '@renderer/hooks/useStore' import { getDefaultTopic } from '@renderer/services/assistant' import { Assistant, Topic } from '@renderer/types' -import { Switch } from 'antd' import { FC, useCallback } from 'react' import { useTranslation } from 'react-i18next' import styled from 'styled-components' @@ -80,7 +79,7 @@ const HeaderNavbar: FC = ({ activeAssistant, setActiveAssistant, setActiv )} - + {!showAssistants && (topicPosition === 'left' ? !showTopics : true) && ( = ({ activeAssistant, setActiveAssistant, setActiv - } - unCheckedChildren={} - checked={theme === 'dark'} - onChange={toggleTheme} - /> + + {theme === 'dark' ? ( + + ) : ( + + )} + {topicPosition === 'right' && ( @@ -119,7 +119,7 @@ export const NewButton = styled.div` -webkit-app-region: none; border-radius: 4px; height: 30px; - padding: 0 8px; + padding: 0 7px; display: flex; flex-direction: row; justify-content: center; @@ -129,9 +129,12 @@ export const NewButton = styled.div` .iconfont { font-size: 19px; color: var(--color-icon); - } - .icon-a-addchat { - font-size: 20px; + &.icon-a-addchat { + font-size: 20px; + } + &.icon-a-darkmode { + font-size: 20px; + } } .anticon { color: var(--color-icon); @@ -150,12 +153,4 @@ const TitleText = styled.span` font-weight: 500; ` -const ThemeSwitch = styled(Switch)` - -webkit-app-region: no-drag; - margin-right: 10px; - .icon-theme { - font-size: 14px; - } -` - export default HeaderNavbar