Skip to content

Commit cdf3f68

Browse files
committed
Revert "feat(desktop): replace the session tab strip with a session header (#1513)"
This reverts commit 1443e22.
1 parent bbd8193 commit cdf3f68

69 files changed

Lines changed: 5551 additions & 4399 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎desktop/src/App.tsx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { RemoteAccessGate } from './pages/RemoteAccess'
66
import { isPublicAccessRuntime } from './lib/publicAccessRuntime'
77
import { useChatStore } from './stores/chatStore'
88
import { installHiddenSessionRelease } from './stores/hiddenSessionRelease'
9-
import { installEmptySessionCleanup } from './stores/emptySessionCleanup'
109
import { useMobileShellLayout } from './components/mobile/mobileShellLayout'
1110
import { isDesktopRuntime } from './lib/desktopRuntime'
1211

@@ -25,7 +24,6 @@ function ConnectedApp() {
2524
}),
2625
[shellLayout],
2726
)
28-
useEffect(() => installEmptySessionCleanup(useChatStore), [])
2927
useEffect(() => {
3028
let cleanup: (() => void) | undefined
3129
let cancelled = false

‎desktop/src/components/agentTeams/AgentTeamsWorkbenchTab.test.tsx‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ describe('AgentTeamsWorkbenchTab', () => {
8989
it('opens the 400px communication feed from a collapsed 56px rail', () => {
9090
installTimeline()
9191

92-
render(<AgentTeamsWorkbenchTab leadSessionId="lead-session" />)
92+
render(<AgentTeamsWorkbenchTab tabId="__team__lead-session" leadSessionId="lead-session" />)
9393

9494
expect(screen.getByTestId('agent-teams-canvas')).toBeTruthy()
9595
expect(screen.queryByTestId('agent-teams-communication')).toBeNull()
@@ -105,8 +105,7 @@ describe('AgentTeamsWorkbenchTab', () => {
105105
expect(screen.getByTestId('agent-teams-communication').className).toContain('h-full')
106106
expect(screen.getByText('Review is in progress.')).toBeTruthy()
107107
expect(screen.queryByRole('button', { name: /Open the workbench full screen/i })).toBeNull()
108-
// The window header's breadcrumb leads back to the session.
109-
expect(screen.queryByRole('button', { name: 'Back to session' })).toBeNull()
108+
expect(screen.getByRole('button', { name: 'Back to session' })).toBeTruthy()
110109
})
111110

112111
it('opens a member inspector before routing to execution and restores the Canvas on return', async () => {
@@ -128,7 +127,7 @@ describe('AgentTeamsWorkbenchTab', () => {
128127
</button>
129128
)
130129
}
131-
return <AgentTeamsWorkbenchTab leadSessionId="lead-session" />
130+
return <AgentTeamsWorkbenchTab tabId={teamTabId} leadSessionId="lead-session" />
132131
}
133132

134133
render(<RoutedWorkbench />)

‎desktop/src/components/agentTeams/AgentTeamsWorkbenchTab.tsx‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
import { useEffect } from 'react'
2+
import { ArrowLeft } from 'lucide-react'
3+
import { Button } from '@/components/ui/Button'
4+
import { useTranslation } from '../../i18n'
5+
import { useTabStore } from '../../stores/tabStore'
26
import { useTeamStore } from '../../stores/teamStore'
37
import { AgentTeamsWorkbench } from './AgentTeamsWorkbench'
48

59
/**
610
* The detached, full-window form of the workbench. It reads the same
711
* per-session timeline the docked panel does, so switching between the two
8-
* keeps history position and the selected member. The way back to the
9-
* session is the window header's breadcrumb.
12+
* keeps history position and the selected member.
1013
*/
1114
export function AgentTeamsWorkbenchTab({
15+
tabId,
1216
leadSessionId,
1317
}: {
18+
tabId: string
1419
leadSessionId: string
1520
}) {
21+
const t = useTranslation()
1622
const hasTimeline = useTeamStore((state) =>
1723
Boolean(state.workbenchesBySession[leadSessionId]?.snapshots.length),
1824
)
@@ -27,6 +33,16 @@ export function AgentTeamsWorkbenchTab({
2733

2834
return (
2935
<div className="flex min-h-0 flex-1 flex-col bg-[var(--color-surface)]">
36+
<div className="flex shrink-0 items-center gap-2 border-b border-[var(--color-border)] px-3 py-1.5">
37+
<Button
38+
variant="ghost"
39+
size="sm"
40+
icon={<ArrowLeft size={14} strokeWidth={2} aria-hidden="true" />}
41+
onClick={() => useTabStore.getState().returnFromTeamWorkbench(tabId)}
42+
>
43+
{t('agentTeams.backToSession')}
44+
</Button>
45+
</div>
3046
<AgentTeamsWorkbench sessionId={leadSessionId} />
3147
</div>
3248
)

‎desktop/src/components/chat/SessionChatSurface.tsx‎

Lines changed: 24 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ export type SessionHeaderMetaItem = {
55
content: ReactNode
66
}
77

8-
/**
9-
* The bar above a conversation. On the desktop the window header already names
10-
* the session (and its trail, for a run page), so callers there pass no
11-
* `title`: the bar is then a single line of what the title used to sit on —
12-
* badges first, then the metadata — and the actions centred beside it. Only
13-
* the phone, whose top bar has no room for metadata, still passes one.
14-
*/
158
export function SessionChatHeader({
169
title,
1710
compact = false,
@@ -21,64 +14,53 @@ export function SessionChatHeader({
2114
metadata = [],
2215
children,
2316
}: {
24-
title?: string
17+
title: string
2518
compact?: boolean
2619
leading?: ReactNode
2720
titleAddon?: ReactNode
2821
actions?: ReactNode
2922
metadata?: SessionHeaderMetaItem[]
3023
children?: ReactNode
3124
}) {
32-
const metadataRow = metadata.length > 0 || (!title && titleAddon) ? (
33-
<div
34-
data-testid="session-header-meta"
35-
className={`flex min-w-0 items-center gap-2 overflow-hidden whitespace-nowrap text-xs text-[var(--color-text-tertiary)] [&_svg]:shrink-0 ${title ? 'mt-[3px]' : 'min-h-7'}`}
36-
>
37-
{!title ? titleAddon : null}
38-
{metadata.map((item, index) => (
39-
<Fragment key={item.key}>
40-
{index > 0 ? (
41-
<span aria-hidden="true" className="h-[3px] w-[3px] shrink-0 rounded-full bg-[var(--color-text-tertiary)]" />
42-
) : null}
43-
{item.content}
44-
</Fragment>
45-
))}
46-
</div>
47-
) : null
48-
4925
return (
5026
<div
5127
data-testid="session-header"
5228
className={[
5329
'w-full border-b border-[var(--color-border)]',
54-
title
55-
? compact ? 'px-4 py-2.5' : 'px-7 py-3.5'
56-
: compact ? 'px-4 py-1.5' : 'px-7 py-2',
30+
compact ? 'px-4 py-2.5' : 'px-7 py-3.5',
5731
].join(' ')}
5832
>
5933
<div className="mx-auto w-full min-w-0 max-w-[var(--chat-content-max-width)]">
6034
{/* Top-aligned so a goal / team strip below the meta line does not drag
61-
the actions down; with a title they are offset to centre on title +
62-
meta, without one the meta line and the actions share a 28px row. */}
35+
the actions down; they are offset to centre on title + meta. */}
6336
<div className="flex min-w-0 items-start gap-4">
6437
{leading}
6538
<div className="min-w-0 flex-1">
66-
{title ? (
67-
<div className="flex min-w-0 items-center gap-2">
68-
<h1
69-
className="min-w-0 truncate text-[15px] font-semibold leading-[1.35] tracking-[-0.01em] text-[var(--color-text-primary)]"
70-
style={{ fontFamily: 'var(--font-headline)' }}
71-
title={title}
72-
>
73-
{title}
74-
</h1>
75-
{titleAddon}
39+
<div className="flex min-w-0 items-center gap-2">
40+
<h1
41+
className="min-w-0 truncate text-[15px] font-semibold leading-[1.35] tracking-[-0.01em] text-[var(--color-text-primary)]"
42+
style={{ fontFamily: 'var(--font-headline)' }}
43+
title={title}
44+
>
45+
{title}
46+
</h1>
47+
{titleAddon}
48+
</div>
49+
{metadata.length > 0 ? (
50+
<div className="mt-[3px] flex min-w-0 items-center gap-2 overflow-hidden whitespace-nowrap text-xs text-[var(--color-text-tertiary)] [&_svg]:shrink-0">
51+
{metadata.map((item, index) => (
52+
<Fragment key={item.key}>
53+
{index > 0 ? (
54+
<span aria-hidden="true" className="h-[3px] w-[3px] shrink-0 rounded-full bg-[var(--color-text-tertiary)]" />
55+
) : null}
56+
{item.content}
57+
</Fragment>
58+
))}
7659
</div>
7760
) : null}
78-
{metadataRow}
7961
{children}
8062
</div>
81-
{actions ? <div className={`flex shrink-0 items-center gap-2 ${title ? 'pt-1' : 'min-h-7'}`}>{actions}</div> : null}
63+
{actions ? <div className="flex shrink-0 items-center gap-2 pt-1">{actions}</div> : null}
8264
</div>
8365
</div>
8466
</div>

0 commit comments

Comments
 (0)