feat: Update the context menu style to enhance visibility and interactivity

This commit is contained in:
bincxz committed 2025-12-07 20:30:32 +08:00
1 parent 8683d3745e
commit d7dac0455e
2 files changed
+19 -14

No files matched your search

+16 -12
View File
@@ -1794,23 +1794,27 @@ function App() {
}
: { left: 0, top: 0, width: '100%', height: '100%' };
const style: React.CSSProperties = isFocused
? {
...layoutStyle,
outline: '2px solid hsl(var(--primary))',
outlineOffset: -4,
boxShadow: 'inset 0 0 0 1px rgba(255,255,255,0.12)',
}
: { ...layoutStyle };
if (!isVisible) {
style.display = 'none';
}
return (
<div
key={session.id}
className={cn(
"absolute bg-background transition-opacity border border-border/60",
isVisible ? "z-10" : "opacity-0 pointer-events-none"
"absolute bg-background border border-border/60",
isVisible && "z-10"
)}
style={
isFocused
? {
...layoutStyle,
outline: '2px solid hsl(var(--primary))',
outlineOffset: -4,
boxShadow: 'inset 0 0 0 1px rgba(255,255,255,0.12)',
}
: layoutStyle
}
style={style}
onClick={() => setFocusedSessionId(session.id)}
>
<Terminal
+3 -2
View File
@@ -44,7 +44,7 @@ const ContextMenuSubContent = React.forwardRef<
<ContextMenuPrimitive.SubContent
ref={ref}
className={cn(
"z-[100000] min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
"z-[200000] min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg app-no-drag pointer-events-auto data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
className
)}
{...props}
@@ -59,8 +59,9 @@ const ContextMenuContent = React.forwardRef<
<ContextMenuPrimitive.Portal>
<ContextMenuPrimitive.Content
ref={ref}
collisionPadding={12}
className={cn(
"z-[9999] min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
"z-[200000] min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 app-no-drag pointer-events-auto data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
className
)}
{...props}