From c2fb651c5e0073ac749b90cfe44ab5ec4add884f Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Tue, 30 Jun 2026 01:56:57 -0500 Subject: [PATCH 1/2] refactor(desktop): formalize row-as-button primitive (RowButton) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Finding 2 of the desktop UI-consistency pass. Several surfaces intentionally make an entire row/cell the click target while hosting nested layout inside a raw + ) } diff --git a/apps/desktop/src/app/chat/sidebar/chrome.tsx b/apps/desktop/src/app/chat/sidebar/chrome.tsx index 3963aaf3dbd..7815d1fafcf 100644 --- a/apps/desktop/src/app/chat/sidebar/chrome.tsx +++ b/apps/desktop/src/app/chat/sidebar/chrome.tsx @@ -1,6 +1,7 @@ import type * as React from 'react' import { Codicon } from '@/components/ui/codicon' +import { RowButton } from '@/components/ui/row-button' import { cn } from '@/lib/utils' // Shared, content-agnostic sidebar chrome — used by both the flat session @@ -64,7 +65,7 @@ export function SidebarRowCluster({ className, ...props }: React.ComponentProps< /** Session row main tap target. */ export function SidebarRowBody({ className, ...props }: React.ComponentProps<'button'>) { - return + ) } diff --git a/apps/desktop/src/app/overlays/panel.tsx b/apps/desktop/src/app/overlays/panel.tsx index d03ed675d60..ae4ee5fde93 100644 --- a/apps/desktop/src/app/overlays/panel.tsx +++ b/apps/desktop/src/app/overlays/panel.tsx @@ -3,6 +3,7 @@ import type { ReactNode } from 'react' import { Button } from '@/components/ui/button' import { Codicon } from '@/components/ui/codicon' import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/dropdown-menu' +import { RowButton } from '@/components/ui/row-button' import { SearchField } from '@/components/ui/search-field' import { translateNow } from '@/i18n' import { cn } from '@/lib/utils' @@ -162,10 +163,9 @@ export function PanelListRow({ )} data-panel-row={rowKey} > - + {meta ? {meta} : null} {menu ?
{menu}
: null} diff --git a/apps/desktop/src/app/settings/providers-settings.tsx b/apps/desktop/src/app/settings/providers-settings.tsx index febe47cb0c9..d06280902bc 100644 --- a/apps/desktop/src/app/settings/providers-settings.tsx +++ b/apps/desktop/src/app/settings/providers-settings.tsx @@ -12,6 +12,7 @@ import { sortProviders } from '@/components/desktop-onboarding-overlay' import { Button } from '@/components/ui/button' +import { RowButton } from '@/components/ui/row-button' import { SearchField } from '@/components/ui/search-field' import { disconnectOAuthProvider, listOAuthProviders } from '@/hermes' import { useI18n } from '@/i18n' @@ -237,7 +238,7 @@ function ConnectedProviderRow({ return (
- +
{canDisconnect && ( diff --git a/apps/desktop/src/components/desktop-onboarding-overlay.tsx b/apps/desktop/src/components/desktop-onboarding-overlay.tsx index 7ea1c11ffb4..b884e6f7a9f 100644 --- a/apps/desktop/src/components/desktop-onboarding-overlay.tsx +++ b/apps/desktop/src/components/desktop-onboarding-overlay.tsx @@ -8,6 +8,7 @@ import { Codicon } from '@/components/ui/codicon' import { ErrorIcon } from '@/components/ui/error-state' import { Input } from '@/components/ui/input' import { Loader } from '@/components/ui/loader' +import { RowButton } from '@/components/ui/row-button' import { getGlobalModelOptions } from '@/hermes' import { useI18n } from '@/i18n' import { Check, ChevronDown, ChevronLeft, ChevronRight, ExternalLink, KeyRound, Loader2, Terminal } from '@/lib/icons' @@ -575,13 +576,13 @@ export function KeyProviderRow({ onClick }: { onClick: () => void }) { const { t } = useI18n() return ( - + ) } @@ -597,7 +598,7 @@ export function ProviderRow({ const Trail = provider.flow === 'external' ? Terminal : ChevronRight return ( - + ) } diff --git a/apps/desktop/src/components/ui/row-button.test.tsx b/apps/desktop/src/components/ui/row-button.test.tsx new file mode 100644 index 00000000000..ad9c8cf7855 --- /dev/null +++ b/apps/desktop/src/components/ui/row-button.test.tsx @@ -0,0 +1,39 @@ +import { cleanup, render } from '@testing-library/react' +import { afterEach, describe, expect, it, vi } from 'vitest' + +import { RowButton } from './row-button' + +afterEach(cleanup) + +describe('RowButton', () => { + it('renders a real