Mark preview tab as opened in double click

This commit is contained in:
Hakan Shehu
2025-04-24 17:44:27 +02:00
parent a0df904981
commit c10ec7e856
4 changed files with 12 additions and 1 deletions

View File

@@ -20,12 +20,14 @@ import { MessageContainerTab } from '@/renderer/components/messages/message-cont
interface ContainerTabTriggerProps {
tab: ContainerTab;
onClose: () => void;
onOpen: () => void;
onMove: (before: string | null) => void;
}
export const ContainerTabTrigger = ({
tab,
onClose,
onOpen,
onMove,
}: ContainerTabTriggerProps) => {
const [, dragRef] = useDrag<string>({
@@ -76,6 +78,11 @@ export const ContainerTabTrigger = ({
onClose();
}
}}
onDoubleClick={() => {
if (tab.preview) {
onOpen();
}
}}
ref={dragDropRef as React.LegacyRef<HTMLButtonElement>}
>
<div className="overflow-hidden truncate">

View File

@@ -13,6 +13,7 @@ interface ContainerTabsProps {
onTabChange: (value: string) => void;
onFocus: () => void;
onClose: (value: string) => void;
onOpen: (value: string) => void;
onMove: (tab: string, before: string | null) => void;
}
@@ -21,6 +22,7 @@ export const ContainerTabs = ({
onTabChange,
onFocus,
onClose,
onOpen,
onMove,
}: ContainerTabsProps) => {
const activeTab = tabs.find((t) => t.active)?.path;
@@ -54,6 +56,7 @@ export const ContainerTabs = ({
key={tab.path}
tab={tab}
onClose={() => onClose(tab.path)}
onOpen={() => onOpen(tab.path)}
onMove={(before) => onMove(tab.path, before)}
/>
))}

View File

@@ -101,6 +101,7 @@ export const Layout = () => {
onFocus={() => {
handleFocus('left');
}}
onOpen={handleOpenLeft}
onClose={handleCloseLeft}
onTabChange={handleActivateLeft}
onMove={handleMoveLeft}
@@ -142,6 +143,7 @@ export const Layout = () => {
onFocus={() => {
handleFocus('right');
}}
onOpen={handleOpenRight}
onTabChange={handleActivateRight}
onClose={handleCloseRight}
onMove={handleMoveRight}

View File

@@ -97,7 +97,6 @@ export type EmailPasswordResetInitInput = {
export type EmailPasswordResetCompleteInput = {
id: string;
otp: string;
email: string;
password: string;
platform: string;
version: string;