Skip to content
Closed
Show file tree
Hide file tree
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
24 changes: 20 additions & 4 deletions apps/desktop/src/session/components/floating/options-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { commands as listener2Commands } from "@hypr/plugin-listener2";
import type { TranscriptStorage } from "@hypr/store";
import { Button } from "@hypr/ui/components/ui/button";
import {
PopoverAnchor,
Popover,
PopoverContent,
PopoverTrigger,
} from "@hypr/ui/components/ui/popover";
import {
Tooltip,
Expand Down Expand Up @@ -323,6 +323,19 @@ export function OptionsMenu({
updateSessionTabState,
]);

const handleContextMenu = useCallback(
(e: React.MouseEvent<HTMLDivElement>) => {
if (disabled) {
return;
}

e.preventDefault();
e.stopPropagation();
setOpen(true);
},
[disabled],
);

const moreButton = (
<button
className="absolute top-1/2 right-2 z-10 -translate-y-1/2 cursor-pointer text-white/70 transition-colors hover:text-white disabled:opacity-50"
Expand Down Expand Up @@ -374,12 +387,15 @@ export function OptionsMenu({

return (
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger asChild>
<div className="relative flex items-center">
<PopoverAnchor asChild>
<div
className="relative flex items-center"
onContextMenu={handleContextMenu}
>
{children}
{moreButton}
</div>
</PopoverTrigger>
</PopoverAnchor>
<PopoverContent
side="top"
align="center"
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/session/components/floating/shared.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function FloatingButton({
<Button
size="lg"
className={cn([
"rounded-full border-2 transition-[border-color,opacity] duration-200 focus-visible:ring-0",
"rounded-full border-2 transition-[border-color,opacity] duration-200 select-none focus-visible:ring-0",
error && "border-red-500",
!error && "border-neutral-200",
subtle && "opacity-40 hover:opacity-100",
Expand Down
Loading