From f7aaccec76ddaefb53a38151bf919ecc16aa740c Mon Sep 17 00:00:00 2001 From: AI Christianson Date: Fri, 14 Mar 2025 17:28:21 -0400 Subject: [PATCH] ux --- .../src/components/DefaultAgentScreen.tsx | 20 ++++++++----- .../common/src/components/SessionDrawer.tsx | 6 ++-- .../common/src/components/SessionList.tsx | 30 ++++++++++--------- .../common/src/components/TimelineFeed.tsx | 2 +- .../common/src/components/TimelineStep.tsx | 16 +++++----- frontend/common/src/components/ui/layout.tsx | 4 +-- frontend/common/src/components/ui/sheet.tsx | 2 +- 7 files changed, 44 insertions(+), 36 deletions(-) diff --git a/frontend/common/src/components/DefaultAgentScreen.tsx b/frontend/common/src/components/DefaultAgentScreen.tsx index baab6f4..3a1e15e 100644 --- a/frontend/common/src/components/DefaultAgentScreen.tsx +++ b/frontend/common/src/components/DefaultAgentScreen.tsx @@ -6,7 +6,7 @@ import { Layout } from './ui'; import { SessionDrawer } from './SessionDrawer'; -import { SessionSidebar } from './SessionSidebar'; +import { SessionList } from './SessionList'; import { TimelineFeed } from './TimelineFeed'; import { getSampleAgentSessions, getSampleAgentSteps } from '../utils/sample-data'; @@ -146,13 +146,19 @@ export const DefaultAgentScreen: React.FC = () => { ); - // Render sidebar content + // Sidebar content with sessions list const sidebarContent = ( - +
+
+

Sessions

+
+ +
); // Render drawer diff --git a/frontend/common/src/components/SessionDrawer.tsx b/frontend/common/src/components/SessionDrawer.tsx index 6043aef..5bc7396 100644 --- a/frontend/common/src/components/SessionDrawer.tsx +++ b/frontend/common/src/components/SessionDrawer.tsx @@ -29,16 +29,16 @@ export const SessionDrawer: React.FC = ({ - + Sessions diff --git a/frontend/common/src/components/SessionList.tsx b/frontend/common/src/components/SessionList.tsx index fd2eab6..871e482 100644 --- a/frontend/common/src/components/SessionList.tsx +++ b/frontend/common/src/components/SessionList.tsx @@ -45,18 +45,18 @@ export const SessionList: React.FC = ({ }; return ( - -
+ +
{sessions.map((session) => { const buttonContent = ( <> -
-
-
{session.name}
-
+
+
+
{session.name}
+
{session.steps.length} steps • {formatDate(session.updated)}
-
+
{session.status}
@@ -68,19 +68,21 @@ export const SessionList: React.FC = ({ { key: session.id, onClick: () => onSelectSession?.(session.id), - className: `w-full flex items-start px-2 py-2 text-left rounded-md transition-colors hover:bg-accent/50 ${ + className: `w-full flex items-start px-3 py-2.5 text-left rounded-md transition-colors hover:bg-accent/50 ${ currentSessionId === session.id ? 'bg-accent' : '' }` }, closeAction ? ( <> {buttonContent} - {React.cloneElement(closeAction as React.ReactElement, { - onClick: (e: React.MouseEvent) => { - e.stopPropagation(); - onSelectSession?.(session.id); - } - })} +
+ {React.cloneElement(closeAction as React.ReactElement, { + onClick: (e: React.MouseEvent) => { + e.stopPropagation(); + onSelectSession?.(session.id); + } + })} +
) : buttonContent ); diff --git a/frontend/common/src/components/TimelineFeed.tsx b/frontend/common/src/components/TimelineFeed.tsx index 9ed22fb..3c4853c 100644 --- a/frontend/common/src/components/TimelineFeed.tsx +++ b/frontend/common/src/components/TimelineFeed.tsx @@ -24,7 +24,7 @@ export const TimelineFeed: React.FC = ({ return (
{sortedSteps.length > 0 ? ( diff --git a/frontend/common/src/components/TimelineStep.tsx b/frontend/common/src/components/TimelineStep.tsx index d4a4754..b325914 100644 --- a/frontend/common/src/components/TimelineStep.tsx +++ b/frontend/common/src/components/TimelineStep.tsx @@ -49,18 +49,18 @@ export const TimelineStep: React.FC = ({ step }) => { return ( -
-
-
{getTypeIcon(step.type)}
-
-
{step.title}
-
+
+
+
{getTypeIcon(step.type)}
+
+
{step.title}
+
{step.type === 'tool-execution' ? 'Run tool' : step.content.substring(0, 60)} {step.content.length > 60 ? '...' : ''}
-
+
{formatTime(step.timestamp)} {step.duration && ( @@ -71,7 +71,7 @@ export const TimelineStep: React.FC = ({ step }) => {
-
+
{step.content}
{step.duration && ( diff --git a/frontend/common/src/components/ui/layout.tsx b/frontend/common/src/components/ui/layout.tsx index 97fee7b..e61e68e 100644 --- a/frontend/common/src/components/ui/layout.tsx +++ b/frontend/common/src/components/ui/layout.tsx @@ -24,7 +24,7 @@ export const Layout: React.FC = ({ floatingAction }) => { return ( -
+
{/* Header - always visible, spans full width */}
{header} @@ -32,7 +32,7 @@ export const Layout: React.FC = ({ {/* Sidebar - hidden on mobile, visible on tablet/desktop */} {sidebar && ( -