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 { ChatContextManagerProvider } from '../context_management/ChatContextManager';
import { Message } from '../../types/message'; import { Message } from '../../types/message';
import BackButton from '../ui/BackButton'; 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) // Helper function to determine if a message is a user message (same as useChatEngine)
const isUserMessage = (message: Message): boolean => { const isUserMessage = (message: Message): boolean => {
@@ -249,25 +250,37 @@ const SessionHistoryView: React.FC<SessionHistoryViewProps> = ({
// Define action buttons // Define action buttons
const actionButtons = showActionButtons ? ( const actionButtons = showActionButtons ? (
<> <>
<Button <Tooltip>
onClick={handleShare} <TooltipTrigger>
disabled={!canShare || isSharing} <Button
size="sm" onClick={handleShare}
variant="outline" disabled={!canShare || isSharing}
className={canShare ? '' : 'cursor-not-allowed opacity-50'} size="sm"
> variant="outline"
{isSharing ? ( className={canShare ? '' : 'cursor-not-allowed opacity-50'}
<> >
<LoaderCircle className="w-4 h-4 mr-2 animate-spin" /> {isSharing ? (
Sharing... <>
</> <LoaderCircle className="w-4 h-4 mr-2 animate-spin" />
) : ( Sharing...
<> </>
<Share2 className="w-4 h-4" /> ) : (
Share <>
</> <Share2 className="w-4 h-4" />
)} Share
</Button> </>
)}
</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"> <Button onClick={handleLaunchInNewWindow} size="sm" variant="outline">
<Sparkles className="w-4 h-4" /> <Sparkles className="w-4 h-4" />
Resume Resume