fix: HtmlArtifacts title overflow (#9434)

* fix: HtmlArtifacts title overflow

* style: fix lint errors
This commit is contained in:
one 2025-08-23 17:31:10 +08:00 committed by GitHub
parent 375f966e9a
commit 3be7c2e1a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 11 deletions

View File

@ -157,6 +157,7 @@ const IconWrapper = styled.div<{ $isStreaming: boolean }>`
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-shrink: 0;
width: 44px; width: 44px;
height: 44px; height: 44px;
background: ${(props) => background: ${(props) =>
@ -177,13 +178,16 @@ const TitleSection = styled.div`
gap: 6px; gap: 6px;
` `
const Title = styled.h3` const Title = styled.span`
margin: 0 !important; font-size: 14px;
font-size: 14px !important; font-weight: bold;
font-weight: 600; color: var(--color-text-1);
color: var(--color-text);
line-height: 1.4; line-height: 1.4;
font-family: 'Ubuntu'; font-family: 'Ubuntu';
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
` `
const TypeBadge = styled.div` const TypeBadge = styled.div`

View File

@ -1,7 +1,7 @@
import CodeEditor, { CodeEditorHandles } from '@renderer/components/CodeEditor' import CodeEditor, { CodeEditorHandles } from '@renderer/components/CodeEditor'
import { isLinux, isMac, isWin } from '@renderer/config/constant' import { isLinux, isMac, isWin } from '@renderer/config/constant'
import { classNames } from '@renderer/utils' import { classNames } from '@renderer/utils'
import { Button, Modal, Splitter, Tooltip } from 'antd' import { Button, Modal, Splitter, Tooltip, Typography } from 'antd'
import { Code, Eye, Maximize2, Minimize2, SaveIcon, SquareSplitHorizontal, X } from 'lucide-react' import { Code, Eye, Maximize2, Minimize2, SaveIcon, SquareSplitHorizontal, X } from 'lucide-react'
import { useEffect, useRef, useState } from 'react' import { useEffect, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
@ -43,7 +43,7 @@ const HtmlArtifactsPopup: React.FC<HtmlArtifactsPopupProps> = ({ open, title, ht
const renderHeader = () => ( const renderHeader = () => (
<ModalHeader onDoubleClick={() => setIsFullscreen(!isFullscreen)} className={classNames({ drag: isFullscreen })}> <ModalHeader onDoubleClick={() => setIsFullscreen(!isFullscreen)} className={classNames({ drag: isFullscreen })}>
<HeaderLeft $isFullscreen={isFullscreen}> <HeaderLeft $isFullscreen={isFullscreen}>
<TitleText>{title}</TitleText> <TitleText ellipsis={{ tooltip: true }}>{title}</TitleText>
</HeaderLeft> </HeaderLeft>
<HeaderCenter> <HeaderCenter>
@ -266,13 +266,13 @@ const HeaderRight = styled.div<{ $isFullscreen?: boolean }>`
padding-right: ${({ $isFullscreen }) => ($isFullscreen ? (isWin ? '136px' : isLinux ? '120px' : '12px') : '12px')}; padding-right: ${({ $isFullscreen }) => ($isFullscreen ? (isWin ? '136px' : isLinux ? '120px' : '12px') : '12px')};
` `
const TitleText = styled.span` const TitleText = styled(Typography.Text)`
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: bold;
color: var(--color-text); color: var(--color-text);
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; width: 50%;
` `
const ViewControls = styled.div` const ViewControls = styled.div`

View File

@ -209,7 +209,7 @@ const TabsBar = styled.div<{ $isFullscreen: boolean }>`
height: var(--navbar-height); height: var(--navbar-height);
position: relative; position: relative;
-webkit-app-region: drag; -webkit-app-region: drag;
/* 确保交互元素在拖拽区域之上 */ /* 确保交互元素在拖拽区域之上 */
> * { > * {
position: relative; position: relative;