Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix: disable hover cards on mobile for mentions and user info (#3456)

Peter Chinmand6f0e94a54ca
diff --git a/js/app/packages/core/component/HoverCard.tsx b/js/app/packages/core/component/HoverCard.tsx
index 1b55808c1a..bed44d0bfa 100644
--- a/js/app/packages/core/component/HoverCard.tsx
+++ b/js/app/packages/core/component/HoverCard.tsx
@@ -1,3 +1,4 @@
+import { isTouchDevice } from '@core/mobile/isTouchDevice';
import {
type HoverCardRootProps,
HoverCard as KobalteHoverCard,
@@ -121,6 +122,8 @@ export function HoverCard(props: HoverCardComponentProps) {
if (isTopLevel) openTopLevelHoverCards.delete(closeSelf);
});
+ const isDisabled = () => props.disabled || isTouchDevice();
+
const shouldForceMount = () => nestedOpenCount() > 0;
// Dismiss on scroll outside the card content. Kobalte only listens for
@@ -164,7 +167,7 @@ export function HoverCard(props: HoverCardComponentProps) {
<KobalteHoverCard.Trigger
as={props.triggerAs ?? 'span'}
class={props.triggerClass}
- disabled={props.disabled}
+ disabled={isDisabled()}
>
{props.trigger}
</KobalteHoverCard.Trigger>
diff --git a/js/app/packages/core/component/UserIcon.tsx b/js/app/packages/core/component/UserIcon.tsx
index a6850bd9e9..0262e1b9af 100644
--- a/js/app/packages/core/component/UserIcon.tsx
+++ b/js/app/packages/core/component/UserIcon.tsx
@@ -8,7 +8,6 @@ import {
useDisplayName,
useDisplayNameParts,
} from '@core/user';
-
import Trash from '@phosphor-icons/core/regular/trash.svg?component-solid';
import { commsServiceClient } from '@service-comms/client';
import { Avatar, type AvatarSize } from '@ui';