mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-29 16:03:34 +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()
|
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', () => {
|
it('does not change mode when first-use Auto confirmation is cancelled', () => {
|
||||||
const onChange = vi.fn()
|
const onChange = vi.fn()
|
||||||
useSettingsStore.setState({ autoModeOptInAccepted: false } as never)
|
useSettingsStore.setState({ autoModeOptInAccepted: false } as never)
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import { AutoModeOptInDialog } from './AutoModeOptInDialog'
|
|||||||
const MODE_ICONS: Record<PermissionMode, string> = {
|
const MODE_ICONS: Record<PermissionMode, string> = {
|
||||||
default: 'verified_user',
|
default: 'verified_user',
|
||||||
acceptEdits: 'bolt',
|
acceptEdits: 'bolt',
|
||||||
auto: 'auto_awesome',
|
auto: 'autoplay',
|
||||||
plan: 'architecture',
|
plan: 'architecture',
|
||||||
bypassPermissions: 'gavel',
|
bypassPermissions: 'gavel',
|
||||||
dontAsk: 'gavel',
|
dontAsk: 'gavel',
|
||||||
@ -83,8 +83,8 @@ export function PermissionModeSelector({ workDir: workDirProp, compact = false,
|
|||||||
value: 'auto',
|
value: 'auto',
|
||||||
label: t('permMode.autoMode'),
|
label: t('permMode.autoMode'),
|
||||||
description: t('permMode.autoModeDesc'),
|
description: t('permMode.autoModeDesc'),
|
||||||
icon: 'auto_awesome',
|
icon: 'autoplay',
|
||||||
color: 'text-[var(--color-warning)]',
|
color: 'text-[var(--color-brand)]',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'plan',
|
value: 'plan',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user