chore: add info tooltip to share session button (#4038)

Signed-off-by: Parsa Rahimi <mail@parsuli.net>
This commit is contained in:
Parsa Rahimi
2025-08-14 11:53:24 -07:00
committed by GitHub
parent d7e761c529
commit 28b106a039
@@ -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 => {
@@ -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