mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-15 12:53:31 +08:00
fix(desktop): refine Auto mode icon #978
This commit is contained in:
parent
74bdb3727d
commit
4f17693da3
@ -435,6 +435,21 @@ describe('PermissionModeSelector', () => {
|
||||
expect(screen.getByRole('menuitem', { name: /Auto mode/ })).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('uses the automatic-execution glyph for Auto mode', () => {
|
||||
const { rerender } = render(
|
||||
<PermissionModeSelector value="default" onChange={vi.fn()} />,
|
||||
)
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Ask permissions' }))
|
||||
const autoItem = screen.getByRole('menuitem', { name: /Auto mode/ })
|
||||
expect(autoItem.querySelector('.material-symbols-outlined')).toHaveTextContent('autoplay')
|
||||
expect(autoItem.querySelector('.material-symbols-outlined')).not.toHaveTextContent('auto_awesome')
|
||||
|
||||
rerender(<PermissionModeSelector value="auto" onChange={vi.fn()} />)
|
||||
expect(screen.getByRole('button', { name: 'Auto mode' }))
|
||||
.toHaveTextContent('autoplay')
|
||||
})
|
||||
|
||||
it('does not change mode when first-use Auto confirmation is cancelled', () => {
|
||||
const onChange = vi.fn()
|
||||
useSettingsStore.setState({ autoModeOptInAccepted: false } as never)
|
||||
|
||||
@ -16,7 +16,7 @@ import { AutoModeOptInDialog } from './AutoModeOptInDialog'
|
||||
const MODE_ICONS: Record<PermissionMode, string> = {
|
||||
default: 'verified_user',
|
||||
acceptEdits: 'bolt',
|
||||
auto: 'auto_awesome',
|
||||
auto: 'autoplay',
|
||||
plan: 'architecture',
|
||||
bypassPermissions: 'gavel',
|
||||
dontAsk: 'gavel',
|
||||
@ -83,8 +83,8 @@ export function PermissionModeSelector({ workDir: workDirProp, compact = false,
|
||||
value: 'auto',
|
||||
label: t('permMode.autoMode'),
|
||||
description: t('permMode.autoModeDesc'),
|
||||
icon: 'auto_awesome',
|
||||
color: 'text-[var(--color-warning)]',
|
||||
icon: 'autoplay',
|
||||
color: 'text-[var(--color-brand)]',
|
||||
},
|
||||
{
|
||||
value: 'plan',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user