mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-06-29 07:55:29 +08:00
fix(sidebar): make sessions list hyperlinks
This commit is contained in:
@@ -2,7 +2,7 @@ import { useEffect, useRef } from 'react';
|
|||||||
import { Check, Edit2, Loader2, Trash2, X } from 'lucide-react';
|
import { Check, Edit2, Loader2, Trash2, X } from 'lucide-react';
|
||||||
import type { TFunction } from 'i18next';
|
import type { TFunction } from 'i18next';
|
||||||
|
|
||||||
import { Badge, Button, Tooltip } from '../../../../shared/view/ui';
|
import { Badge, Tooltip, buttonVariants } from '../../../../shared/view/ui';
|
||||||
import { cn } from '../../../../lib/utils';
|
import { cn } from '../../../../lib/utils';
|
||||||
import type { Project, ProjectSession, LLMProvider } from '../../../../types/app';
|
import type { Project, ProjectSession, LLMProvider } from '../../../../types/app';
|
||||||
import type { SessionWithProvider } from '../../types/types';
|
import type { SessionWithProvider } from '../../types/types';
|
||||||
@@ -195,9 +195,10 @@ export default function SidebarSessionItem({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="hidden md:block">
|
<div className="hidden md:block">
|
||||||
<Button
|
<a
|
||||||
variant="ghost"
|
href={`/session/${session.id}`}
|
||||||
className={cn(
|
className={cn(
|
||||||
|
buttonVariants({ variant: 'ghost' }),
|
||||||
'h-auto w-full justify-start rounded-md border bg-card p-2 text-left font-normal transition-all duration-150',
|
'h-auto w-full justify-start rounded-md border bg-card p-2 text-left font-normal transition-all duration-150',
|
||||||
isSelected ? 'border-primary/20 bg-primary/5' : 'border-border/30',
|
isSelected ? 'border-primary/20 bg-primary/5' : 'border-border/30',
|
||||||
!isSelected && isProcessing
|
!isSelected && isProcessing
|
||||||
@@ -206,7 +207,13 @@ export default function SidebarSessionItem({
|
|||||||
? 'border-green-500/30 bg-green-50/5 hover:bg-green-50/10 dark:bg-green-900/5 dark:hover:bg-green-900/10'
|
? 'border-green-500/30 bg-green-50/5 hover:bg-green-50/10 dark:bg-green-900/5 dark:hover:bg-green-900/10'
|
||||||
: 'hover:bg-accent/50',
|
: 'hover:bg-accent/50',
|
||||||
)}
|
)}
|
||||||
onClick={() => onSessionSelect(session, project.projectId)}
|
// Left-click keeps in-app navigation; Ctrl/Cmd/middle-click and the
|
||||||
|
// native right-click menu use the href to open a new tab/window.
|
||||||
|
onClick={(event) => {
|
||||||
|
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
|
||||||
|
event.preventDefault();
|
||||||
|
onSessionSelect(session, project.projectId);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<div className="flex w-full min-w-0 items-center gap-2">
|
<div className="flex w-full min-w-0 items-center gap-2">
|
||||||
<div
|
<div
|
||||||
@@ -249,7 +256,7 @@ export default function SidebarSessionItem({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Button>
|
</a>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
ref={editingContainerRef}
|
ref={editingContainerRef}
|
||||||
|
|||||||
Reference in New Issue
Block a user