From 2c71a37ad11475f4d564faede56a94dd93481389 Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Thu, 30 Jul 2026 03:16:41 -0500 Subject: [PATCH] fix(desktop): clear double-click heart lint errors --- .../assistant-ui/thread/double-click-reaction.test.tsx | 10 ++++++---- .../assistant-ui/thread/use-message-reactions.ts | 1 + .../components/assistant-ui/thread/user-message.tsx | 1 - 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/desktop/src/components/assistant-ui/thread/double-click-reaction.test.tsx b/apps/desktop/src/components/assistant-ui/thread/double-click-reaction.test.tsx index 5bca43fd494..20ee08f1c61 100644 --- a/apps/desktop/src/components/assistant-ui/thread/double-click-reaction.test.tsx +++ b/apps/desktop/src/components/assistant-ui/thread/double-click-reaction.test.tsx @@ -4,11 +4,13 @@ import { AssistantRuntimeProvider, type ThreadMessage, useExternalStoreRuntime } import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { Thread } from '.' +import type * as ReactionsStore from '@/store/reactions' +import { $reactionsEnabled } from '@/store/reactions-enabled' +import { $localReactions } from '@/store/reactions-local' + import { isTapbackDoubleClick } from './use-message-reactions' -import { $localReactions } from '@/store/reactions-local' -import { $reactionsEnabled } from '@/store/reactions-enabled' +import { Thread } from '.' const createdAt = new Date('2026-05-01T00:00:00.000Z') @@ -29,7 +31,7 @@ Element.prototype.scrollTo = function scrollTo() {} // The gesture persists through the gateway; this suite is about the local // paint, which is what the user actually sees on the click. vi.mock('@/store/reactions', async importOriginal => ({ - ...(await importOriginal()), + ...(await importOriginal()), toggleMessageReaction: vi.fn(async () => {}) })) diff --git a/apps/desktop/src/components/assistant-ui/thread/use-message-reactions.ts b/apps/desktop/src/components/assistant-ui/thread/use-message-reactions.ts index cb6002348aa..75b011c5555 100644 --- a/apps/desktop/src/components/assistant-ui/thread/use-message-reactions.ts +++ b/apps/desktop/src/components/assistant-ui/thread/use-message-reactions.ts @@ -123,6 +123,7 @@ export function useTapbackDoubleClick( reactions?: MessageReaction[] rowId?: number } + const reactions = custom.reactions ?? EMPTY_REACTIONS // Same toggle semantics as the picker: a second double-click retracts. diff --git a/apps/desktop/src/components/assistant-ui/thread/user-message.tsx b/apps/desktop/src/components/assistant-ui/thread/user-message.tsx index 627a150fb19..16c6963e248 100644 --- a/apps/desktop/src/components/assistant-ui/thread/user-message.tsx +++ b/apps/desktop/src/components/assistant-ui/thread/user-message.tsx @@ -1,5 +1,4 @@ import { ActionBarPrimitive, BranchPickerPrimitive, MessagePrimitive, useAuiState } from '@assistant-ui/react' -import { useStore } from '@nanostores/react' import { type FC, type ReactNode, useCallback, useRef, useState } from 'react' import { DirectiveContent } from '@/components/assistant-ui/directive-text'