diff --git a/frontend/src/components/agent/AgentQuickSelect.tsx b/frontend/src/components/agent/AgentQuickSelect.tsx index 73a9a8aa..f61d2767 100644 --- a/frontend/src/components/agent/AgentQuickSelect.tsx +++ b/frontend/src/components/agent/AgentQuickSelect.tsx @@ -55,7 +55,7 @@ export function AgentQuickSelect({ const buttonContent = ( diff --git a/frontend/src/components/message/ComposerActivityBar.test.tsx b/frontend/src/components/message/ComposerActivityBar.test.tsx index fa907fb0..8b43a2ef 100644 --- a/frontend/src/components/message/ComposerActivityBar.test.tsx +++ b/frontend/src/components/message/ComposerActivityBar.test.tsx @@ -1,35 +1,10 @@ -import { act, render, screen } from '@testing-library/react' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import { render, screen } from '@testing-library/react' +import { afterEach, beforeEach, describe, expect, it } from 'vitest' import { ComposerActivityBar } from './ComposerActivityBar' import { useSessionStatus } from '@/stores/sessionStatusStore' import { stubMatchMedia } from '@/test/test-utils' const originalMatchMedia = window.matchMedia -const originalResizeObserver = global.ResizeObserver - -class MockResizeObserver { - static instances: MockResizeObserver[] = [] - - readonly callback: ResizeObserverCallback - - constructor(callback: ResizeObserverCallback) { - this.callback = callback - MockResizeObserver.instances.push(this) - } - - observe() {} - - unobserve() {} - - disconnect() {} - - trigger(width: number) { - this.callback( - [{ contentRect: { width } } as ResizeObserverEntry], - this as unknown as ResizeObserver, - ) - } -} const resetStore = () => { useSessionStatus.setState({ @@ -45,25 +20,14 @@ const resetStore = () => { }) } -const segmentsOf = (bar: HTMLElement) => - Array.from(bar.firstElementChild?.children ?? []) as HTMLElement[] - -const measureWidth = (width: number) => { - act(() => { - MockResizeObserver.instances.forEach((instance) => instance.trigger(width)) - }) -} +const trackOf = (bar: HTMLElement) => bar.firstElementChild as HTMLElement describe('ComposerActivityBar', () => { beforeEach(() => { resetStore() - MockResizeObserver.instances = [] - global.ResizeObserver = MockResizeObserver as unknown as typeof ResizeObserver }) afterEach(() => { - vi.useRealTimers() - global.ResizeObserver = originalResizeObserver Object.defineProperty(window, 'matchMedia', { configurable: true, writable: true, @@ -77,83 +41,49 @@ describe('ComposerActivityBar', () => { expect(container).toBeEmptyDOMElement() }) - it('anchors a pointer-transparent progressbar in the gap below the composer', () => { + it('pins a pointer-transparent progressbar across the screen bottom on mobile and below the composer on desktop', () => { useSessionStatus.getState().setStatus('session-a', { type: 'busy' }) render() const bar = screen.getByRole('progressbar', { name: 'Session working' }) - expect(bar).toHaveClass('pointer-events-none') - expect(bar).toHaveClass('absolute') - expect(bar).toHaveClass('inset-x-3') - expect(bar).toHaveClass('-bottom-[13px]') - expect(bar).toHaveClass('md:-bottom-[11px]') - expect(bar).toHaveClass('flex') + expect(bar).toHaveClass('pointer-events-none', 'flex') + expect(bar).toHaveClass('fixed', 'inset-x-0', 'bottom-0') + expect(bar).toHaveClass('md:absolute', 'md:inset-x-3', 'md:-bottom-[11px]') }) - it('fills the measured width with 4x8 segments', () => { + it('renders a masked segment track with only the sweeping window', () => { useSessionStatus.getState().setStatus('session-a', { type: 'busy' }) render() - const bar = screen.getByRole('progressbar', { name: 'Session working' }) - expect(bar.firstElementChild).toHaveClass('gap-0.5') + const track = trackOf(screen.getByRole('progressbar', { name: 'Session working' })) + expect(track).toHaveClass('scanner-track', 'relative', 'h-2', 'w-full') - measureWidth(602) - - const segments = segmentsOf(bar) - expect(segments).toHaveLength(100) - expect(segments[0]).toHaveClass('w-1') - expect(segments[0]).toHaveClass('h-2') - expect(segments[0]).toHaveClass('rounded-[1px]') - expect(segments[0]).toHaveClass('transition-colors') - expect(segments[0]).toHaveClass('duration-75') - expect(segments[0]).not.toHaveClass('flex-1') + const children = Array.from(track.children) as HTMLElement[] + expect(children).toHaveLength(1) + expect(children[0]).toHaveClass('scanner-sweep') }) - it('keeps the minimum segment count for narrow containers', () => { + it('tints the track with the info tone while the session is busy', () => { useSessionStatus.getState().setStatus('session-a', { type: 'busy' }) render() - const bar = screen.getByRole('progressbar', { name: 'Session working' }) - measureWidth(20) - - expect(segmentsOf(bar)).toHaveLength(12) + const track = trackOf(screen.getByRole('progressbar', { name: 'Session working' })) + expect(track).toHaveClass('text-info') }) - it('lights the info tiers around the scanner window', () => { - useSessionStatus.getState().setStatus('session-a', { type: 'busy' }) - - render() - - measureWidth(602) - - const segments = segmentsOf(screen.getByRole('progressbar', { name: 'Session working' })) - expect(segments[3]).toHaveClass('bg-info') - expect(segments[4]).toHaveClass('bg-info/70') - expect(segments[6]).toHaveClass('bg-info/40') - expect(segments[7]).toHaveClass('bg-info/20') - expect(segments[8]).toHaveClass('bg-muted/20') - expect(segments[99]).toHaveClass('bg-muted/20') - }) - - it('renders the compacting state with primary colors', () => { + it('tints the track with the primary tone while compacting', () => { useSessionStatus.getState().setStatus('session-a', { type: 'compact' }) render() - measureWidth(602) - - const segments = segmentsOf(screen.getByRole('progressbar', { name: 'Compacting' })) - expect(segments[3]).toHaveClass('bg-primary') - expect(segments[4]).toHaveClass('bg-primary/70') - expect(segments[6]).toHaveClass('bg-primary/40') - expect(segments[7]).toHaveClass('bg-primary/20') - expect(segments[8]).toHaveClass('bg-muted/20') + const track = trackOf(screen.getByRole('progressbar', { name: 'Compacting' })) + expect(track).toHaveClass('text-primary') }) - it('reports the retry attempt in the label with warning colors', () => { + it('reports the retry attempt in the label with the warning tone', () => { useSessionStatus.getState().setStatus('session-a', { type: 'retry', attempt: 2, @@ -163,66 +93,26 @@ describe('ComposerActivityBar', () => { render() - measureWidth(602) - - const segments = segmentsOf(screen.getByRole('progressbar', { name: 'Retrying (Retry #2)' })) - expect(segments[3]).toHaveClass('bg-warning') - expect(segments[4]).toHaveClass('bg-warning/70') - expect(segments[6]).toHaveClass('bg-warning/40') - expect(segments[7]).toHaveClass('bg-warning/20') - expect(segments[8]).toHaveClass('bg-muted/20') + const track = trackOf(screen.getByRole('progressbar', { name: 'Retrying (Retry #2)' })) + expect(track).toHaveClass('text-warning') }) - it('renders the muted background activity state when idle with a running shell', () => { + it('tints the track with the muted foreground tone for background activity', () => { useSessionStatus.getState().setShellRunning('shell-1', 'session-a', '/repo') render() - measureWidth(602) - - const segments = segmentsOf(screen.getByRole('progressbar', { name: 'Background tasks running' })) - expect(segments[3]).toHaveClass('bg-muted-foreground') - expect(segments[4]).toHaveClass('bg-muted-foreground/70') - expect(segments[6]).toHaveClass('bg-muted-foreground/40') - expect(segments[7]).toHaveClass('bg-muted-foreground/20') - expect(segments[8]).toHaveClass('bg-muted/20') + const track = trackOf(screen.getByRole('progressbar', { name: 'Background tasks running' })) + expect(track).toHaveClass('text-muted-foreground') }) - it('sweeps the lit window on the step interval', () => { - vi.useFakeTimers() - useSessionStatus.getState().setStatus('session-a', { type: 'busy' }) - - render() - - const bar = screen.getByRole('progressbar', { name: 'Session working' }) - measureWidth(602) - expect(segmentsOf(bar)[3]).toHaveClass('bg-info') - - act(() => { - vi.advanceTimersByTime(120) - }) - - const segments = segmentsOf(bar) - expect(segments[7]).toHaveClass('bg-info') - expect(segments[4]).toHaveClass('bg-info/40') - }) - - it('renders every segment statically when reduced motion is requested', () => { - vi.useFakeTimers() + it('keeps sweeping when reduced motion is requested', () => { stubMatchMedia(true) useSessionStatus.getState().setStatus('session-a', { type: 'busy' }) render() - const bar = screen.getByRole('progressbar', { name: 'Session working' }) - measureWidth(602) - act(() => { - vi.advanceTimersByTime(600) - }) - - const segments = segmentsOf(bar) - expect(segments).toHaveLength(100) - expect(segments.every((segment) => segment.classList.contains('bg-info/60'))).toBe(true) - expect(segments.some((segment) => segment.classList.contains('bg-muted/20'))).toBe(false) + const track = trackOf(screen.getByRole('progressbar', { name: 'Session working' })) + expect(track.querySelector('.scanner-sweep')).not.toBeNull() }) }) diff --git a/frontend/src/components/message/ComposerActivityBar.tsx b/frontend/src/components/message/ComposerActivityBar.tsx index 7b7b05a9..27710fb8 100644 --- a/frontend/src/components/message/ComposerActivityBar.tsx +++ b/frontend/src/components/message/ComposerActivityBar.tsx @@ -5,9 +5,6 @@ interface ComposerActivityBarProps { sessionID: string } -const LIT_WIDTH = 6 -const STEP_INTERVAL_MS = 30 - const ACTIVITY_PRESENTATION = { background: { label: 'Background tasks running', @@ -28,10 +25,11 @@ const ACTIVITY_PRESENTATION = { } as const satisfies Record /** - * Session activity scanner anchored in the gap below the composer frame. The strip uses the same - * 4x8px segments as the session status scanner and fills the composer width with as many segments - * as fit. Renders nothing while the session is idle and has no background activity; otherwise - * announces the current activity through an indeterminate progressbar. + * Session activity scanner. On mobile it spans the full width of the bottom screen edge; from the + * `md` breakpoint it is anchored in the gap below the composer frame. A fading lit window of 4x8px + * segments sweeps across the strip. Renders nothing while the + * session is idle and has no background activity; otherwise announces the current activity through + * an indeterminate progressbar. */ export function ComposerActivityBar({ sessionID }: ComposerActivityBarProps) { const status = useSessionStatusForSession(sessionID) @@ -54,9 +52,9 @@ export function ComposerActivityBar({ sessionID }: ComposerActivityBarProps) { aria-label={label} aria-valuemin={0} aria-valuemax={100} - className="pointer-events-none absolute inset-x-3 -bottom-[13px] md:-bottom-[11px] flex" + className="pointer-events-none fixed inset-x-0 bottom-0 flex md:absolute md:inset-x-3 md:-bottom-[11px]" > - + ) } diff --git a/frontend/src/components/message/ComposerToolsMenu.test.tsx b/frontend/src/components/message/ComposerToolsMenu.test.tsx index 870c2d63..af613dc0 100644 --- a/frontend/src/components/message/ComposerToolsMenu.test.tsx +++ b/frontend/src/components/message/ComposerToolsMenu.test.tsx @@ -249,22 +249,13 @@ describe('ComposerToolsMenu', () => { expect(props.onAttachFile).toHaveBeenCalledTimes(1) }) - it('uses the default control size for the trigger', () => { + it('uses the 36px control size for the trigger', () => { mockPermissionMode() renderMenu() const trigger = screen.getByRole('button', { name: 'Composer options' }) - expect(trigger).toHaveClass('min-h-[44px]', 'min-w-[44px]') - expect(trigger).not.toHaveClass('min-h-9') - }) - - it('uses the compact control size for the trigger while the composer is focused', () => { - mockPermissionMode() - renderMenu({ compact: true }) - - const trigger = screen.getByRole('button', { name: 'Composer options' }) - expect(trigger).toHaveClass('min-h-9', 'min-w-9') - expect(trigger).not.toHaveClass('min-h-[44px]') + expect(trigger).toHaveClass('size-9', 'p-0') + expect(trigger).not.toHaveClass('p-2') }) }) diff --git a/frontend/src/components/message/ComposerToolsMenu.tsx b/frontend/src/components/message/ComposerToolsMenu.tsx index ccd742b4..13702fcc 100644 --- a/frontend/src/components/message/ComposerToolsMenu.tsx +++ b/frontend/src/components/message/ComposerToolsMenu.tsx @@ -13,6 +13,7 @@ import { isLocalOpenCodeServer, useOpenCodeServerId } from '@/contexts/OpenCodeS import { usePermissionModeToggle } from '@/hooks/usePermissionModeToggle' import { useSandboxToggle } from '@/hooks/useSandboxToggle' import { shouldShowSandboxResources } from '@/lib/sandboxResources' +import { cn } from '@/lib/utils' import { SandboxMenuItems } from './SandboxMenuItems' import { ToolMenuItemContent } from './ToolMenuItemContent' import { SessionSandboxResourcesDialog } from './SessionSandboxResourcesDialog' @@ -25,16 +26,13 @@ interface ComposerToolsMenuProps { goalLabel: string onToggleGoal: () => void onAttachFile: () => void - /** Uses the 36px control size for the trigger while the prompt is focused. */ - compact?: boolean } /** * Renders the mobile composer tools trigger: a dropdown for permission mode, * sandboxing, goal mode, and file attachment. * - * @param props Session context, goal state, the attach handler, and whether the - * trigger uses the compact 36px control size while the prompt is focused. + * @param props Session context, goal state, and the attach handler. */ export function ComposerToolsMenu({ sessionID, @@ -44,7 +42,6 @@ export function ComposerToolsMenu({ goalLabel, onToggleGoal, onAttachFile, - compact = false, }: ComposerToolsMenuProps) { const isLocalServer = isLocalOpenCodeServer(useOpenCodeServerId()) const permission = usePermissionModeToggle(sessionID, directory) @@ -59,7 +56,7 @@ export function ComposerToolsMenu({ type="button" aria-label="Composer options" title="Composer options" - className={`${getIconToggleButtonClassName(permission.isAuto || sandbox.isSandboxed || goalArmed)} flex items-center justify-center ${compact ? 'min-h-9 min-w-9' : 'min-h-[44px] min-w-[44px]'}`} + className={cn(getIconToggleButtonClassName(permission.isAuto || sandbox.isSandboxed || goalArmed), 'flex items-center justify-center size-9 p-0')} > diff --git a/frontend/src/components/message/PromptInput.composer.test.tsx b/frontend/src/components/message/PromptInput.composer.test.tsx index ab5a7a17..de81a0ae 100644 --- a/frontend/src/components/message/PromptInput.composer.test.tsx +++ b/frontend/src/components/message/PromptInput.composer.test.tsx @@ -1,5 +1,5 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { render, screen, fireEvent, waitFor } from '@testing-library/react' +import { render, screen, fireEvent, waitFor, within } from '@testing-library/react' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import { PromptInput } from './PromptInput' import { createCommandActionsMock } from '@/test/test-utils' @@ -71,9 +71,7 @@ vi.mock('@/components/model/ModelQuickSelect', () => ({ vi.mock('@/components/session/PermissionModeToggle', () => ({ PermissionModeToggle: () => null })) vi.mock('@/components/session/SessionSandboxMenu', () => ({ SessionSandboxMenu: () => null })) vi.mock('./ComposerToolsMenu', () => ({ - ComposerToolsMenu: ({ compact }: { compact?: boolean }) => ( -
- ), + ComposerToolsMenu: () =>
, })) vi.mock('./PromptSuggestions', () => ({ PromptSuggestions: () => null })) vi.mock('@/hooks/useSessionGoals', () => ({ @@ -256,15 +254,55 @@ describe('PromptInput composer layout', () => { expect(screen.getByTestId('model-quick-select')).toBeInTheDocument() }) - it('replaces the mobile Latest button with keys while focused', () => { + it('swaps the composer tools button for a scroll-to-bottom arrow while scrolled up', () => { renderComponent({ showScrollButton: true }) - expect(screen.getByText('Latest')).toBeInTheDocument() + const actions = controlsRow().lastElementChild as HTMLElement + expect(within(actions).getByRole('button', { name: 'Scroll to bottom' })).toBeInTheDocument() + expect(screen.queryByTestId('composer-tools-menu')).not.toBeInTheDocument() + expect(within(controlsRow().firstElementChild as HTMLElement).getByTestId('agent-quick-select')).toBeInTheDocument() + expect(within(controlsRow().firstElementChild as HTMLElement).getByTestId('model-quick-select')).toBeInTheDocument() + expect(screen.queryByText('Latest')).not.toBeInTheDocument() + }) + + it('keeps the scroll-to-bottom arrow on the right while the prompt is focused', () => { + renderComponent({ showScrollButton: true }) fireEvent.focus(promptInput()) - expect(screen.queryByText('Latest')).not.toBeInTheDocument() - expect(screen.getByRole('button', { name: 'cmd /' })).toBeInTheDocument() + const keys = screen.getByRole('toolbar', { name: 'Insert' }) + expect(within(keys).getByRole('button', { name: 'bash !' })).toBeInTheDocument() + + const actions = controlsRow().lastElementChild as HTMLElement + expect(within(actions).getByRole('button', { name: 'Scroll to bottom' })).toBeInTheDocument() + expect(screen.queryByTestId('composer-tools-menu')).not.toBeInTheDocument() + }) + + it('keeps the scroll-to-bottom arrow while the prompt has text', () => { + renderComponent({ showScrollButton: true }) + + fireEvent.change(promptInput(), { target: { value: 'hello' } }) + + expect(screen.getByRole('button', { name: 'Scroll to bottom' })).toBeInTheDocument() + }) + + it('scrolls to the bottom from the swapped arrow and keeps the composer tools box size', () => { + const onScrollToBottom = vi.fn() + renderComponent({ showScrollButton: true, onScrollToBottom }) + + const arrow = screen.getByRole('button', { name: 'Scroll to bottom' }) + expect(arrow).toHaveClass('size-9', 'p-0') + + fireEvent.click(arrow) + + expect(onScrollToBottom).toHaveBeenCalledTimes(1) + }) + + it('keeps the composer tools button while at the bottom of the transcript', () => { + renderComponent({ showScrollButton: false }) + + expect(screen.getByTestId('composer-tools-menu')).toBeInTheDocument() + expect(screen.queryByRole('button', { name: 'Scroll to bottom' })).not.toBeInTheDocument() }) it('keeps the voice button and composer tools on the right side of the controls row', () => { @@ -278,6 +316,24 @@ describe('PromptInput composer layout', () => { }) }) + describe('desktop scroll button visibility', () => { + const desktopScrollButton = () => screen.getByTitle('Scroll to bottom') + + it('hides the desktop scroll arrow once the prompt has text', () => { + renderComponent({ showScrollButton: true }) + + fireEvent.change(promptInput(), { target: { value: 'hello' } }) + + expect(desktopScrollButton()).toHaveClass('invisible') + }) + + it('shows the desktop scroll arrow while the prompt is empty', () => { + renderComponent({ showScrollButton: true }) + + expect(desktopScrollButton()).toHaveClass('visible') + }) + }) + describe('mobile voice button', () => { beforeEach(() => { mocks.useMobile.mockReturnValue(true) @@ -302,8 +358,23 @@ describe('PromptInput composer layout', () => { }) }) - describe('compact controls', () => { - it('uses compact sizing for the key buttons and mic while focused on mobile', () => { + describe('control sizing', () => { + it('keeps the mic at 36px before and after the prompt gains focus on mobile', () => { + mocks.useMobile.mockReturnValue(true) + renderComponent() + + const micBeforeFocus = mobileVoiceButton() as HTMLElement + expect(micBeforeFocus).toHaveClass('min-h-9', 'min-w-9') + expect(micBeforeFocus).not.toHaveClass('min-h-[44px]') + + fireEvent.focus(promptInput()) + + const micAfterFocus = mobileVoiceButton() as HTMLElement + expect(micAfterFocus).toHaveClass('min-h-9', 'min-w-9') + expect(micAfterFocus).not.toHaveClass('min-h-[44px]') + }) + + it('keeps the key buttons at 36px after the prompt gains focus on mobile', () => { mocks.useMobile.mockReturnValue(true) renderComponent() @@ -312,20 +383,17 @@ describe('PromptInput composer layout', () => { const commandKey = screen.getByRole('button', { name: 'cmd /' }) expect(commandKey).toHaveClass('min-h-9') expect(commandKey).not.toHaveClass('min-h-[44px]') - - const mic = mobileVoiceButton() as HTMLElement - expect(mic).toHaveClass('min-h-9', 'min-w-9') - expect(mic).not.toHaveClass('min-h-[44px]') - expect(screen.getByTestId('composer-tools-menu')).toHaveAttribute('data-compact', 'true') }) - it('uses the default sizing while the prompt is not focused', () => { + it('sizes the submit button at 36px on mobile', () => { mocks.useMobile.mockReturnValue(true) renderComponent() - const mic = mobileVoiceButton() as HTMLElement - expect(mic).toHaveClass('min-h-[44px]', 'min-w-[44px]') - expect(screen.getByTestId('composer-tools-menu')).toHaveAttribute('data-compact', 'false') + fireEvent.change(promptInput(), { target: { value: 'hello' } }) + + const send = submitButton() as HTMLElement + expect(send).toHaveClass('h-9') + expect(send).not.toHaveClass('min-h-[44px]') }) }) }) diff --git a/frontend/src/components/message/PromptInput.stt.test.tsx b/frontend/src/components/message/PromptInput.stt.test.tsx index 20c33ff4..ce6fbcd4 100644 --- a/frontend/src/components/message/PromptInput.stt.test.tsx +++ b/frontend/src/components/message/PromptInput.stt.test.tsx @@ -541,7 +541,7 @@ describe('PromptInput STT Gesture Tests', () => { expect(voiceButtons.length).toBeGreaterThan(0) }) - it('renders mobile in-row Latest button when showScrollButton is true', async () => { + it('renders the mobile scroll-to-bottom button when showScrollButton is true', async () => { mocks.useMobile.mockReturnValue(true) render( @@ -550,8 +550,8 @@ describe('PromptInput STT Gesture Tests', () => { ) - expect(screen.getByTitle('Scroll to bottom')).toBeInTheDocument() - expect(screen.getByText('Latest')).toBeInTheDocument() + expect(screen.getByRole('button', { name: 'Scroll to bottom' })).toBeInTheDocument() + expect(screen.queryByText('Latest')).not.toBeInTheDocument() }) }) diff --git a/frontend/src/components/message/PromptInput.tsx b/frontend/src/components/message/PromptInput.tsx index b8da4c2b..3938f06f 100644 --- a/frontend/src/components/message/PromptInput.tsx +++ b/frontend/src/components/message/PromptInput.tsx @@ -22,7 +22,7 @@ import { isLocalOpenCodeServer, useOpenCodeServerId } from '@/contexts/OpenCodeS import { ArrowDown, Upload, X, Mic, MicOff, Target } from 'lucide-react' import { SquareFill } from '@/components/ui/square-fill' -import { IconToggleButton } from '@/components/ui/icon-toggle-button' +import { IconToggleButton, getIconToggleButtonClassName } from '@/components/ui/icon-toggle-button' import { PromptSuggestions, type PromptSuggestion } from './PromptSuggestions' import { ComposerActivityBar } from './ComposerActivityBar' @@ -38,7 +38,7 @@ import { detectMentionTrigger, parsePromptToInput, getFilename, getDirectory, ty import { matchText, rankByMatch, type MatchRange } from '@/lib/fuzzyMatch' import { getNextPrimaryAgentId } from '@/lib/primaryAgents' import { getNextFavoriteModel } from '@/lib/favoriteModels' -import { randomId } from '@/lib/utils' +import { cn, randomId } from '@/lib/utils' import { showToast } from '@/lib/toast' import { findModelInfo, isSameModelSelection } from '@opencode-manager/shared/opencode' import { isOpenSessionGoal } from '@opencode-manager/shared/schemas' @@ -1370,7 +1370,6 @@ if (isIOS && isSecureContext && navigator.clipboard && navigator.clipboard.read) const showVoiceFeedback = voiceFeedbackState !== null const hasPromptContent = prompt.trim().length > 0 || imageAttachments.length > 0 const canUseMobileVoice = isMobile && sttEnabled && sttSupported && !hasPendingPermissionForSession - const compactControls = isMobile && isPromptFocused const showMobileKeys = isMobile && isPromptFocused && !hasPendingPermissionForSession const voiceFeedbackLabel = voiceFeedbackState === 'starting' ? 'Starting microphone...' @@ -1414,7 +1413,7 @@ if (isIOS && isSecureContext && navigator.clipboard && navigator.clipboard.read) ? 'bg-destructive hover:bg-destructive/90 text-destructive-foreground border-destructive/60 animate-pulse' : 'bg-muted hover:bg-muted-foreground/20 text-muted-foreground hover:text-foreground border-border' }` - : `${compactControls ? 'min-h-9 min-w-9 px-0' : 'min-h-[44px] min-w-[44px] px-0'} rounded-lg transition-all duration-150 flex items-center justify-center border touch-none select-none ${ + : `min-h-9 min-w-9 px-0 rounded-lg transition-all duration-150 flex items-center justify-center border touch-none select-none ${ isBusy ? 'bg-success text-success-foreground border-success/70 shadow-lg shadow-success/40' : 'bg-muted hover:bg-muted-foreground/20 text-muted-foreground hover:text-foreground border-border active:bg-muted-foreground/30 active:scale-95' @@ -1475,9 +1474,7 @@ if (isIOS && isSecureContext && navigator.clipboard && navigator.clipboard.read) onTouchMove={keybarTouch.onTouchMove} onTouchEnd={(e) => keybarTouch.onTouchEnd(e, key.id)} onClick={() => keybarTouch.onClick(key.id)} - className={`flex items-center gap-1 min-w-0 rounded-lg border font-mono text-base font-bold transition-colors disabled:opacity-30 ${ - compactControls ? 'min-h-9 px-2' : 'min-h-[44px] px-3' - } ${ + className={`flex items-center gap-1 min-w-0 rounded-lg border font-mono text-base font-bold transition-colors disabled:opacity-30 min-h-9 px-2 ${ isActive ? COMPOSER_MODE_STYLES[key.id].key : 'bg-muted border-border text-foreground active:bg-muted-foreground/20' }`} > @@ -1536,7 +1533,7 @@ return ( {composerModeStyle.label} )} -
+