Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 32 additions & 19 deletions ui/desktop/src/components/sessions/SessionHistoryView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { SearchView } from '../conversation/SearchView';
import { ChatContextManagerProvider } from '../context_management/ChatContextManager';
import { Message } from '../../types/message';
import BackButton from '../ui/BackButton';
import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/Tooltip';

// Helper function to determine if a message is a user message (same as useChatEngine)
const isUserMessage = (message: Message): boolean => {
Expand Down Expand Up @@ -249,25 +250,37 @@ const SessionHistoryView: React.FC<SessionHistoryViewProps> = ({
// Define action buttons
const actionButtons = showActionButtons ? (
<>
<Button
onClick={handleShare}
disabled={!canShare || isSharing}
size="sm"
variant="outline"
className={canShare ? '' : 'cursor-not-allowed opacity-50'}
>
{isSharing ? (
<>
<LoaderCircle className="w-4 h-4 mr-2 animate-spin" />
Sharing...
</>
) : (
<>
<Share2 className="w-4 h-4" />
Share
</>
)}
</Button>
<Tooltip>
<TooltipTrigger>
<Button
onClick={handleShare}
disabled={!canShare || isSharing}
size="sm"
variant="outline"
className={canShare ? '' : 'cursor-not-allowed opacity-50'}
>
{isSharing ? (
<>
<LoaderCircle className="w-4 h-4 mr-2 animate-spin" />
Sharing...
</>
) : (
<>
<Share2 className="w-4 h-4" />
Share
</>
)}
</Button>
</TooltipTrigger>
{!canShare ? (
<TooltipContent>
<p>
To enable session sharing, go to <b>Settings</b> {'>'} <b>Session</b> {'>'}{' '}
<b>Session Sharing</b>.
</p>
</TooltipContent>
) : null}
</Tooltip>
<Button onClick={handleLaunchInNewWindow} size="sm" variant="outline">
<Sparkles className="w-4 h-4" />
Resume
Expand Down
Loading