Skip to content

Commit 3db5a9a

Browse files
committed
Merge remote-tracking branch 'origin/main' into ljy/main
2 parents 6c24d30 + fa7db6b commit 3db5a9a

File tree

6 files changed

+364
-104
lines changed

6 files changed

+364
-104
lines changed

frontend/app/chat/layout/chatLeftSidebar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { ConversationListItem } from "@/types/chat"
1515
import { Input } from "@/components/ui/input"
1616
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog"
1717
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"
18-
import { ScrollArea } from "@/components/ui/scrollArea"
18+
import { StaticScrollArea } from "@/components/ui/scrollArea"
1919
import { useConfig } from "@/hooks/useConfig"
2020
import { useResponsiveTextSize } from "@/hooks/useResponsiveTextSize"
2121
import { extractColorsFromUri } from "@/lib/avatar"
@@ -373,7 +373,7 @@ export function ChatSidebar({
373373
</Button>
374374
</div>
375375

376-
<ScrollArea className="flex-1 m-2 h-fit">
376+
<StaticScrollArea className="flex-1 m-2 h-fit">
377377
<div className="space-y-4 pr-2">
378378
{conversationList.length > 0 ? (
379379
<>
@@ -391,7 +391,7 @@ export function ChatSidebar({
391391
</div>
392392
)}
393393
</div>
394-
</ScrollArea>
394+
</StaticScrollArea>
395395

396396
<div className="mt-auto p-3 border-t border-transparent flex justify-between items-center">
397397
<Button

frontend/app/chat/layout/chatRightPanel.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useState, useEffect, useRef, useCallback } from "react"
22
import { Button } from "@/components/ui/button"
33
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
4-
import { ScrollArea } from "@/components/ui/scrollArea"
4+
import { StaticScrollArea } from "@/components/ui/scrollArea"
55
import { ExternalLink, Database, X } from "lucide-react"
66
import { ChatMessageType } from "@/types/chat"
77
import { API_ENDPOINTS } from "@/services/api"
@@ -380,7 +380,7 @@ export function ChatRightPanel({
380380
</TabsTrigger>
381381
</TabsList>
382382

383-
<ScrollArea className="h-[calc(100vh-120px)]">
383+
<StaticScrollArea className="h-[calc(100vh-120px)]">
384384
<TabsContent value="sources" className="p-4">
385385
<div className="space-y-2">
386386
{searchResults.length > 0 ? (
@@ -445,7 +445,7 @@ export function ChatRightPanel({
445445
</div>
446446
)}
447447
</TabsContent>
448-
</ScrollArea>
448+
</StaticScrollArea>
449449
</Tabs>
450450
</div>
451451
)

frontend/app/setup/modelSetup/model/ModelListCard.tsx

Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,17 @@ const pulsingAnimation = `
2626

2727
const getStatusStyle = (status?: ModelConnectStatus): React.CSSProperties => {
2828
const baseStyle: React.CSSProperties = {
29-
width: '12px', // 扩大尺寸
30-
height: '12px', // 扩大尺寸
29+
width: 'clamp(8px, 1.5vw, 12px)', // 响应式尺寸,最小8px,最大12px
30+
height: 'clamp(8px, 1.5vw, 12px)', // 与宽度保持一致
31+
aspectRatio: '1/1', // 强制保持1:1比例
3132
borderRadius: '50%',
3233
display: 'inline-block',
3334
marginRight: '4px',
34-
cursor: 'pointer', // 添加指针样式表明可点击
35-
transition: 'all 0.2s ease', // 添加过渡效果
36-
position: 'relative', // 用于伪元素定位
35+
cursor: 'pointer',
36+
transition: 'all 0.2s ease',
37+
position: 'relative',
38+
flexShrink: 0, // 防止被压缩
39+
flexGrow: 0, // 防止被拉伸
3740
};
3841

3942
if (status === "检测中") {
@@ -307,45 +310,47 @@ export const ModelListCard = ({
307310
<Select.OptGroup label="自定义模型">
308311
{modelsBySource.custom.map((model) => (
309312
<Option key={`${type}-${model.displayName || model.name}-custom`} value={model.displayName || model.name}>
310-
<div className="flex items-center justify-between">
311-
<div className="font-medium truncate" title={model.displayName || model.name}>
313+
<div className="flex items-center justify-between" style={{ minWidth: 0 }}>
314+
<div className="font-medium truncate" style={{ flex: '1 1 auto', minWidth: 0 }} title={model.displayName || model.name}>
312315
{model.displayName || model.name}
313316
</div>
314-
<Tooltip title="点击可验证连通性">
315-
<span
316-
onClick={(e) => handleStatusClick(e, model.displayName || model.name)}
317-
onMouseDown={(e: React.MouseEvent) => {
318-
e.stopPropagation();
319-
e.preventDefault();
320-
if (onVerifyModel) {
321-
updateLocalModelStatus(model.displayName || model.name, "检测中");
322-
onVerifyModel(model.displayName || model.name, type);
323-
}
324-
return false;
325-
}}
326-
style={{
327-
...getStatusStyle(model.connect_status),
328-
backgroundColor: model.connect_status === "检测中"
329-
? "#2980b9"
330-
: getConnectStatusColor(model.connect_status),
331-
boxShadow: model.connect_status === "检测中"
332-
? "0 0 3px #2980b9"
333-
: `0 0 3px ${getConnectStatusColor(model.connect_status)}`
334-
}}
335-
className="status-indicator"
336-
onMouseEnter={(e) => {
337-
const target = e.currentTarget as HTMLElement;
338-
Object.assign(target.style, getHoverStyle);
339-
}}
340-
onMouseLeave={(e) => {
341-
const target = e.currentTarget as HTMLElement;
342-
target.style.transform = '';
343-
target.style.boxShadow = model.connect_status === "检测中"
344-
? "0 0 3px #2980b9"
345-
: `0 0 3px ${getConnectStatusColor(model.connect_status)}`;
346-
}}
347-
/>
348-
</Tooltip>
317+
<div style={{ flex: '0 0 auto', display: 'flex', alignItems: 'center', marginLeft: '8px' }}>
318+
<Tooltip title="点击可验证连通性">
319+
<span
320+
onClick={(e) => handleStatusClick(e, model.displayName || model.name)}
321+
onMouseDown={(e: React.MouseEvent) => {
322+
e.stopPropagation();
323+
e.preventDefault();
324+
if (onVerifyModel) {
325+
updateLocalModelStatus(model.displayName || model.name, "检测中");
326+
onVerifyModel(model.displayName || model.name, type);
327+
}
328+
return false;
329+
}}
330+
style={{
331+
...getStatusStyle(model.connect_status),
332+
backgroundColor: model.connect_status === "检测中"
333+
? "#2980b9"
334+
: getConnectStatusColor(model.connect_status),
335+
boxShadow: model.connect_status === "检测中"
336+
? "0 0 3px #2980b9"
337+
: `0 0 3px ${getConnectStatusColor(model.connect_status)}`
338+
}}
339+
className="status-indicator"
340+
onMouseEnter={(e) => {
341+
const target = e.currentTarget as HTMLElement;
342+
Object.assign(target.style, getHoverStyle);
343+
}}
344+
onMouseLeave={(e) => {
345+
const target = e.currentTarget as HTMLElement;
346+
target.style.transform = '';
347+
target.style.boxShadow = model.connect_status === "检测中"
348+
? "0 0 3px #2980b9"
349+
: `0 0 3px ${getConnectStatusColor(model.connect_status)}`;
350+
}}
351+
/>
352+
</Tooltip>
353+
</div>
349354
</div>
350355
</Option>
351356
))}

0 commit comments

Comments
 (0)