Skip to content

Commit ec3e526

Browse files
fix(agent): simplify tab running indicator (#932)
Co-authored-by: Erlich <ErlichGutu@gmail.com>
1 parent 6eaa090 commit ec3e526

3 files changed

Lines changed: 6 additions & 45 deletions

File tree

apps/electron/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@proma/electron",
3-
"version": "0.13.14",
3+
"version": "0.13.15",
44
"description": "Proma next gen ai software with general agents - Electron App",
55
"main": "dist/main.cjs",
66
"author": {

apps/electron/src/renderer/components/tabs/TabBarItem.tsx

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import type { TabType, TabMinimapItem } from '@/atoms/tab-atoms'
1515
import type { SessionIndicatorStatus } from '@/atoms/agent-atoms'
1616
import { tabMinimapCacheAtom } from '@/atoms/tab-atoms'
1717
import { interfaceVariantAtom } from '@/atoms/theme'
18+
import { Spinner } from '@/components/ui/spinner'
1819
import { TabPreviewPanel } from './TabPreviewPanel'
1920

2021
export interface TabBarItemProps {
@@ -101,15 +102,7 @@ export function TabBarItem({
101102
}
102103

103104
const isScratch = type === 'scratch'
104-
const indicatorColor = isScratch
105-
? undefined
106-
: isStreaming !== 'idle'
107-
? isStreaming === 'completed'
108-
? 'border-green-500'
109-
: isStreaming === 'blocked'
110-
? 'border-orange-500'
111-
: 'border-blue-500'
112-
: undefined
105+
const showAgentSpinner = type === 'agent' && isStreaming === 'running'
113106
const previewItems = minimapCache.get(id) ?? []
114107
// 当前 active Tab 不显示预览面板
115108
const showPreview = isHovered && !isActive
@@ -151,7 +144,7 @@ export function TabBarItem({
151144

152145
return (
153146
<div
154-
className="relative min-w-[120px] max-w-[200px] flex-[1_0_120px] titlebar-no-drag"
147+
className="relative min-w-[132px] max-w-[240px] flex-[1_0_132px] titlebar-no-drag"
155148
onMouseEnter={onHoverEnter}
156149
onMouseLeave={onHoverLeave}
157150
>
@@ -185,9 +178,10 @@ export function TabBarItem({
185178
<span className="flex-1" />
186179
) : (
187180
<span className="flex-1 min-w-0 truncate text-left flex items-center gap-1">
181+
{showAgentSpinner && <Spinner size="sm" className="mr-2 shrink-0 text-primary/70" />}
188182
{isAutomation && <Clock className="size-3 shrink-0 text-foreground/40" />}
189183
{isDelegation && !isAutomation && <GitBranch className="size-3 shrink-0 text-foreground/40" />}
190-
{title}
184+
<span className="min-w-0 truncate">{title}</span>
191185
</span>
192186
)}
193187

@@ -216,17 +210,6 @@ export function TabBarItem({
216210
</span>
217211
)}
218212

219-
{/* 状态包边 */}
220-
{indicatorColor && (
221-
<span
222-
className={cn(
223-
'absolute inset-0 border-t-2 border-l-2 border-r-2 border-b-0 pointer-events-none tab-stream-indicator',
224-
isClassic ? 'rounded-t-lg' : 'rounded-none',
225-
indicatorColor,
226-
)}
227-
aria-hidden="true"
228-
/>
229-
)}
230213
</button>
231214

232215
{/* 悬浮预览面板(Portal 渲染到 body) */}

apps/electron/src/renderer/styles/globals.css

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,28 +1016,6 @@
10161016
background-color: hsl(var(--sidebar-control-surface-hover)) !important;
10171017
}
10181018

1019-
/* CRT 终端:Tab 流式指示器 — 保留原色,叠加 CRT 磷光质感 */
1020-
.theme-terminal-dark .tab-stream-indicator.border-blue-500 {
1021-
border-color: hsl(217 91% 60%) !important;
1022-
box-shadow:
1023-
0 0 6px hsl(217 85% 55% / 0.38),
1024-
0 0 14px hsl(217 80% 52% / 0.20),
1025-
inset 0 0 5px hsl(217 85% 58% / 0.12) !important;
1026-
}
1027-
.theme-terminal-dark .tab-stream-indicator.border-green-500 {
1028-
border-color: hsl(145 80% 45%) !important;
1029-
box-shadow:
1030-
0 0 6px hsl(145 75% 42% / 0.38),
1031-
0 0 14px hsl(145 70% 40% / 0.20),
1032-
inset 0 0 5px hsl(145 78% 44% / 0.12) !important;
1033-
}
1034-
.theme-terminal-dark .tab-stream-indicator.border-orange-500 {
1035-
border-color: hsl(25 95% 53%) !important;
1036-
box-shadow:
1037-
0 0 6px hsl(25 90% 50% / 0.38),
1038-
0 0 14px hsl(25 85% 48% / 0.20),
1039-
inset 0 0 5px hsl(25 92% 52% / 0.12) !important;
1040-
}
10411019

10421020
/* ===== 输入框段落紧凑行距(仅作用于输入框内的 tiptap 编辑器) ===== */
10431021
.rich-text-input .tiptap p {

0 commit comments

Comments
 (0)