fix(desktop): refine Auto icon

This commit is contained in:
程序员阿江(Relakkes) 2026-07-14 01:41:42 +08:00
parent 5178d7ceec
commit 465fbafb3d
2 changed files with 22 additions and 2 deletions

View File

@ -455,6 +455,24 @@ describe('PermissionModeSelector', () => {
.toHaveTextContent('autoplay')
})
it('renders the visually larger Auto glyph at a reduced size', () => {
const { rerender } = render(
<PermissionModeSelector value="default" onChange={vi.fn()} />,
)
fireEvent.click(screen.getByRole('button', { name: 'Ask permissions' }))
const autoIcon = screen
.getByRole('menuitem', { name: /Auto mode/ })
.querySelector('.material-symbols-outlined')
expect(autoIcon).toHaveClass('text-[18px]')
rerender(<PermissionModeSelector value="auto" onChange={vi.fn()} />)
const triggerIcon = screen
.getByRole('button', { name: 'Auto mode' })
.querySelector('.material-symbols-outlined')
expect(triggerIcon).toHaveClass('text-[12px]')
})
it('does not change mode when first-use Auto confirmation is cancelled', () => {
const onChange = vi.fn()
useSettingsStore.setState({ autoModeOptInAccepted: false } as never)

View File

@ -214,7 +214,7 @@ export function PermissionModeSelector({ workDir: workDirProp, compact = false,
${item.value === currentMode ? 'bg-[var(--color-surface-selected)]' : ''}
`}
>
<span className={`material-symbols-outlined mt-0.5 text-[20px] ${item.color || 'text-[var(--color-text-secondary)]'}`}>
<span className={`material-symbols-outlined mt-0.5 ${item.value === 'auto' ? 'text-[18px]' : 'text-[20px]'} ${item.color || 'text-[var(--color-text-secondary)]'}`}>
{item.icon}
</span>
<div className="min-w-0 flex-1">
@ -264,7 +264,9 @@ export function PermissionModeSelector({ workDir: workDirProp, compact = false,
isTurnActive ? 'opacity-50 cursor-not-allowed' : 'hover:bg-[var(--color-surface-hover)]'
} ${compactButtonClass}`}
>
<span className="material-symbols-outlined text-[14px]">{MODE_ICONS[currentMode]}</span>
<span className={`material-symbols-outlined ${currentMode === 'auto' ? 'text-[12px]' : 'text-[14px]'}`}>
{MODE_ICONS[currentMode]}
</span>
{!compact && (
<>
<span>{MODE_LABELS[currentMode]}</span>