mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
fix(frontend): raise the mobile composer controls to 44px
This commit is contained in:
1 parent
a2ae98107d
commit
99cc8a7f24
6 files changed
+14
-14
No files matched your search
@@ -55,7 +55,7 @@ export function AgentQuickSelect({
|
||||
const buttonContent = (
|
||||
<button
|
||||
style={styleVars as React.CSSProperties}
|
||||
className="px-2 md:px-3.5 py-1 h-10 md:h-9 rounded-lg text-sm font-medium border min-w-[56px] max-w-[80px] md:max-w-[100px] flex-shrink-0 flex items-center justify-center transition-all duration-200 active:scale-95 hover:scale-105 shadow-md text-[var(--agent-color)] bg-[var(--agent-bg)] border-[var(--agent-border)] hover:bg-[var(--agent-bg-hover)] hover:border-[var(--agent-border-hover)] shadow-[var(--agent-shadow)] hover:shadow-[var(--agent-shadow-hover)]"
|
||||
className="px-2 md:px-3.5 py-1 h-11 md:h-9 rounded-lg text-sm font-medium border min-w-[56px] max-w-[80px] md:max-w-[100px] flex-shrink-0 flex items-center justify-center transition-all duration-200 active:scale-95 hover:scale-105 shadow-md text-[var(--agent-color)] bg-[var(--agent-bg)] border-[var(--agent-border)] hover:bg-[var(--agent-bg-hover)] hover:border-[var(--agent-border-hover)] shadow-[var(--agent-shadow)] hover:shadow-[var(--agent-shadow-hover)]"
|
||||
>
|
||||
<span className="truncate">{displayName}</span>
|
||||
</button>
|
||||
|
||||
@@ -249,12 +249,12 @@ describe('ComposerToolsMenu', () => {
|
||||
expect(props.onAttachFile).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
|
||||
it('uses the 40px control size for the trigger', () => {
|
||||
it('uses the 44px control size for the trigger', () => {
|
||||
mockPermissionMode()
|
||||
renderMenu()
|
||||
|
||||
const trigger = screen.getByRole('button', { name: 'Composer options' })
|
||||
expect(trigger).toHaveClass('size-10', 'p-0')
|
||||
expect(trigger).toHaveClass('size-11', 'p-0')
|
||||
expect(trigger).not.toHaveClass('p-2')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -56,7 +56,7 @@ export function ComposerToolsMenu({
|
||||
type="button"
|
||||
aria-label="Composer options"
|
||||
title="Composer options"
|
||||
className={cn(getIconToggleButtonClassName(permission.isAuto || sandbox.isSandboxed || goalArmed), 'flex items-center justify-center size-10 p-0')}
|
||||
className={cn(getIconToggleButtonClassName(permission.isAuto || sandbox.isSandboxed || goalArmed), 'flex items-center justify-center size-11 p-0')}
|
||||
>
|
||||
<Plus className="w-5 h-5" />
|
||||
</button>
|
||||
|
||||
@@ -291,7 +291,7 @@ describe('PromptInput composer layout', () => {
|
||||
renderComponent({ showScrollButton: true, onScrollToBottom })
|
||||
|
||||
const arrow = screen.getByRole('button', { name: 'Scroll to bottom' })
|
||||
expect(arrow).toHaveClass('size-10', 'p-0')
|
||||
expect(arrow).toHaveClass('size-11', 'p-0')
|
||||
|
||||
fireEvent.click(arrow)
|
||||
|
||||
@@ -359,18 +359,18 @@ describe('PromptInput composer layout', () => {
|
||||
})
|
||||
|
||||
describe('control sizing', () => {
|
||||
it('keeps the mic at 40px before and after the prompt gains focus on mobile', () => {
|
||||
it('keeps the mic at 44px before and after the prompt gains focus on mobile', () => {
|
||||
mocks.useMobile.mockReturnValue(true)
|
||||
renderComponent()
|
||||
|
||||
const micBeforeFocus = mobileVoiceButton() as HTMLElement
|
||||
expect(micBeforeFocus).toHaveClass('min-h-10', 'min-w-10')
|
||||
expect(micBeforeFocus).toHaveClass('min-h-11', 'min-w-11')
|
||||
expect(micBeforeFocus).not.toHaveClass('min-h-[44px]')
|
||||
|
||||
fireEvent.focus(promptInput())
|
||||
|
||||
const micAfterFocus = mobileVoiceButton() as HTMLElement
|
||||
expect(micAfterFocus).toHaveClass('min-h-10', 'min-w-10')
|
||||
expect(micAfterFocus).toHaveClass('min-h-11', 'min-w-11')
|
||||
expect(micAfterFocus).not.toHaveClass('min-h-[44px]')
|
||||
})
|
||||
|
||||
|
||||
@@ -1484,7 +1484,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'
|
||||
}`
|
||||
: `min-h-10 min-w-10 px-0 rounded-lg transition-all duration-150 flex items-center justify-center border touch-none select-none ${
|
||||
: `min-h-11 min-w-11 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'
|
||||
@@ -1674,7 +1674,7 @@ return (
|
||||
onClick={cancelVoiceInput}
|
||||
className={cn(
|
||||
getIconToggleButtonClassName(false),
|
||||
'flex items-center justify-center size-10 p-0 flex-shrink-0',
|
||||
'flex items-center justify-center size-11 p-0 flex-shrink-0',
|
||||
isVoiceCancelArmed && 'bg-destructive hover:bg-destructive/90 text-destructive-foreground border-destructive',
|
||||
)}
|
||||
>
|
||||
@@ -1711,7 +1711,7 @@ return (
|
||||
session={modelSelectionSession}
|
||||
>
|
||||
<button
|
||||
className="px-2.5 py-0.5 md:px-3 min-h-10 md:min-h-9 min-w-0 rounded-lg text-xs md:text-sm font-medium border bg-muted border-border text-muted-foreground hover:bg-muted-foreground/10 hover:border-foreground/30 transition-colors cursor-pointer flex-1 md:flex-initial md:w-auto md:max-w-[220px] dark:border-border/30 flex flex-col items-start justify-center overflow-hidden"
|
||||
className="px-2.5 py-0.5 md:px-3 min-h-11 md:min-h-9 min-w-0 rounded-lg text-xs md:text-sm font-medium border bg-muted border-border text-muted-foreground hover:bg-muted-foreground/10 hover:border-foreground/30 transition-colors cursor-pointer flex-1 md:flex-initial md:w-auto md:max-w-[220px] dark:border-border/30 flex flex-col items-start justify-center overflow-hidden"
|
||||
>
|
||||
<span className="truncate w-full text-left">{displayModelName || 'Select model'}</span>
|
||||
{hasVariants && currentVariant && (
|
||||
@@ -1769,7 +1769,7 @@ return (
|
||||
onClick={handleSendVoiceRecording}
|
||||
className={cn(
|
||||
getIconToggleButtonClassName(false),
|
||||
'flex items-center justify-center size-10 p-0 flex-shrink-0',
|
||||
'flex items-center justify-center size-11 p-0 flex-shrink-0',
|
||||
isVoiceSendArmed && 'bg-success hover:bg-success/90 text-success-foreground border-success',
|
||||
)}
|
||||
>
|
||||
@@ -1786,7 +1786,7 @@ return (
|
||||
title="Scroll to bottom"
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={onScrollToBottom}
|
||||
className={cn(getIconToggleButtonClassName(false), 'flex items-center justify-center size-10 p-0')}
|
||||
className={cn(getIconToggleButtonClassName(false), 'flex items-center justify-center size-11 p-0')}
|
||||
>
|
||||
<ArrowDown className="w-5 h-5" />
|
||||
</button>
|
||||
|
||||
@@ -67,7 +67,7 @@ export function VoiceRecorderStrip({ state, startedAt }: VoiceRecorderStripProps
|
||||
role="status"
|
||||
aria-live="polite"
|
||||
className={cn(
|
||||
'flex min-h-10 min-w-0 flex-1 items-center gap-2 rounded-lg border px-2.5 text-xs font-medium',
|
||||
'flex min-h-11 min-w-0 flex-1 items-center gap-2 rounded-lg border px-2.5 text-xs font-medium',
|
||||
STRIP_TONES[state],
|
||||
)}
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user