-
{label}
-
- {value}
-
-
-
-
-
-
- {translate(
- 'auto.components.right.sidebar.AiVaultSessionDetails.copyDetailValue',
- 'Copy {{value0}}',
- { value0: copyLabel }
- )}
-
-
+
+
+ {label}
+
+ {children}
)
}
@@ -250,17 +179,6 @@ export function SessionTime({
)
}
-function formatDateTime(value: string | null): string {
- if (!value) {
- return translate('auto.components.right.sidebar.AiVaultSessionDetails.unknown', 'Unknown')
- }
- const timestamp = Date.parse(value)
- if (!Number.isFinite(timestamp)) {
- return translate('auto.components.right.sidebar.AiVaultSessionDetails.unknown', 'Unknown')
- }
- return new Date(timestamp).toLocaleString(undefined, { dateStyle: 'medium', timeStyle: 'short' })
-}
-
function formatTimeAgo(timestamp: number): string {
const diffMs = Date.now() - timestamp
if (diffMs < 60_000) {
@@ -305,12 +223,18 @@ function formatTimeAgo(timestamp: number): string {
)
}
-export function formatTokenCount(value: number): string {
- if (value >= 1_000_000) {
- return `${(value / 1_000_000).toFixed(1)}m`
+function conversationRoleLabel(role: AiVaultSession['previewMessages'][number]['role']): string {
+ if (role === 'user') {
+ return translate('auto.components.right.sidebar.AiVaultSessionDetails.userRole', 'You')
}
- if (value >= 1_000) {
- return `${(value / 1_000).toFixed(1)}k`
+ if (role === 'assistant') {
+ return translate('auto.components.right.sidebar.AiVaultSessionDetails.agentRole', 'Agent')
}
- return String(value)
+ if (role === 'tool') {
+ return translate('auto.components.right.sidebar.AiVaultSessionDetails.toolRole', 'Tool')
+ }
+ if (role === 'system') {
+ return translate('auto.components.right.sidebar.AiVaultSessionDetails.systemRole', 'System')
+ }
+ return translate('auto.components.right.sidebar.AiVaultSessionDetails.sessionRole', 'Session')
}
diff --git a/src/renderer/src/components/right-sidebar/AiVaultSessionRow.tsx b/src/renderer/src/components/right-sidebar/AiVaultSessionRow.tsx
index 85e68bdde..567a48895 100644
--- a/src/renderer/src/components/right-sidebar/AiVaultSessionRow.tsx
+++ b/src/renderer/src/components/right-sidebar/AiVaultSessionRow.tsx
@@ -1,5 +1,13 @@
import type React from 'react'
-import { ChevronDown, Copy, FileJson, FolderOpen, MoreHorizontal, Play } from 'lucide-react'
+import {
+ ChevronDown,
+ Copy,
+ FileJson,
+ FolderOpen,
+ GripVertical,
+ MoreHorizontal,
+ Play
+} from 'lucide-react'
import { Button } from '@/components/ui/button'
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
import {
@@ -27,6 +35,7 @@ import type { AiVaultSession } from '../../../../shared/ai-vault-types'
import { agentLabel } from './ai-vault-session-filters'
import { translate } from '@/i18n/i18n'
import { SessionInlineDetails, SessionTime } from './AiVaultSessionDetails'
+import { latestSessionConversationTurn } from './ai-vault-session-display'
export function VaultSessionRow({
session,
@@ -57,59 +66,102 @@ export function VaultSessionRow({
}): React.JSX.Element {
const updatedAt = session.updatedAt ?? session.modifiedAt
const detailsId = getSessionDetailsId(session.id)
+ const latestTurn = latestSessionConversationTurn(session)
const detailsTooltip = detailsExpanded
? translate('auto.components.right.sidebar.AiVaultSessionRow.hideDetails', 'Hide Details')
: translate('auto.components.right.sidebar.AiVaultSessionRow.showDetails', 'Show Details')
+ const startResumeDrag = (event: React.DragEvent
): void => {
+ event.stopPropagation()
+ if (resumeDisabled) {
+ event.preventDefault()
+ return
+ }
+ writeAiVaultSessionDragData(event.dataTransfer, {
+ agent: session.agent,
+ sessionId: session.sessionId,
+ title: session.title,
+ command: resumeCommand
+ })
+ window.dispatchEvent(new Event(AI_VAULT_SESSION_DRAG_START_EVENT))
+ }
return (
{
- if (resumeDisabled) {
- event.preventDefault()
- return
- }
- writeAiVaultSessionDragData(event.dataTransfer, {
- agent: session.agent,
- sessionId: session.sessionId,
- title: session.title,
- command: resumeCommand
- })
- window.dispatchEvent(new Event(AI_VAULT_SESSION_DRAG_START_EVENT))
- }}
- onDragEnd={() => {
- window.dispatchEvent(new Event(AI_VAULT_SESSION_DRAG_END_EVENT))
- }}
- onDoubleClick={() => {
- if (!resumeDisabled) {
- onResume()
- }
+ className="group relative flex min-h-[82px] w-full cursor-pointer flex-col border-b border-sidebar-border px-3 py-2 text-left transition-colors hover:bg-sidebar-accent/55"
+ onClick={() => {
+ onToggleDetails()
}}
>
-
-
-
+
+
-
+
+ {latestTurn ? (
+ <>
+
+ {conversationRoleLabel(latestTurn.role)}
+
+ : {latestTurn.text}
+ >
+ ) : (
+ translate(
+ 'auto.components.right.sidebar.AiVaultSessionRow.noPreviewAvailable',
+ 'No conversation preview available'
+ )
+ )}
+
+
event.stopPropagation()}
onDoubleClick={(event) => event.stopPropagation()}
- onDragStart={(event) => {
- event.preventDefault()
- event.stopPropagation()
- }}
>
+
+
+
+
+
+ {translate(
+ 'auto.components.right.sidebar.AiVaultSessionRow.dragToResume',
+ 'Drag to resume in a new tab'
+ )}
+
+