feat(settings): add category icons

This commit is contained in:
mesalogo
2026-10-09 20:54:23 +08:00
parent 8f1b600798
commit 4205ad6317
4 changed files with 49 additions and 12 deletions
+1
View File
@@ -2181,6 +2181,7 @@ function SettingsPanelView({
tabIndex={activeTab === category.id ? 0 : -1}
type="button"
>
<category.icon aria-hidden="true" size={16} strokeWidth={1.8} />
<strong>
{t(`categories.${category.translationKey}.label`)}
</strong>
@@ -2,6 +2,12 @@ import { describe, expect, it } from 'vitest'
import { getSettingsCategoryList } from './settings-categories'
describe('getSettingsCategoryList', () => {
it('defines an icon for every settings category', () => {
expect(
getSettingsCategoryList(true).every(({ icon }) => icon != null)
).toBe(true)
})
it('hides SSH hosts while Remote Projects is disabled', () => {
expect(
getSettingsCategoryList(false).map(({ id }) => id)
+35 -11
View File
@@ -1,60 +1,84 @@
import i18n from './i18n'
import {
Bot,
FileText,
Gauge,
Info,
Palette,
Radio,
Server,
SlidersHorizontal,
Terminal,
Users,
Wrench
} from 'lucide-react'
export const settingsCategoryList = [
{
id: 'appearance',
group: 'general',
translationKey: 'appearance'
translationKey: 'appearance',
icon: Palette
},
{
id: 'platform-features',
group: 'general',
translationKey: 'platformFeatures'
translationKey: 'platformFeatures',
icon: SlidersHorizontal
},
{
id: 'model',
group: 'execution',
translationKey: 'model'
translationKey: 'model',
icon: Bot
},
{
id: 'context-control',
group: 'execution',
translationKey: 'contextControl'
translationKey: 'contextControl',
icon: Gauge
},
{
id: 'runtime',
group: 'execution',
translationKey: 'runtime'
translationKey: 'runtime',
icon: Terminal
},
{
id: 'ssh-hosts',
group: 'execution',
translationKey: 'sshHosts'
translationKey: 'sshHosts',
icon: Server
},
{
id: 'document-parsing',
group: 'extensions',
translationKey: 'documentParsing'
translationKey: 'documentParsing',
icon: FileText
},
{
id: 'channels',
group: 'extensions',
translationKey: 'channels'
translationKey: 'channels',
icon: Radio
},
{
id: 'roles',
group: 'extensions',
translationKey: 'roles'
translationKey: 'roles',
icon: Users
},
{
id: 'capabilities',
group: 'extensions',
translationKey: 'capabilities'
translationKey: 'capabilities',
icon: Wrench
},
{
id: 'about',
group: 'system',
translationKey: 'about'
translationKey: 'about',
icon: Info
}
] as const
+7 -1
View File
@@ -9361,6 +9361,10 @@ button > svg {
font-weight: 500;
}
.settings-tabs button > svg {
flex: 0 0 auto;
}
.settings-tabs button:hover {
background: var(--surface-muted);
color: var(--text-primary);
@@ -9680,8 +9684,10 @@ button > svg {
min-height: 40px;
padding: var(--space-2) var(--space-3);
align-items: flex-start;
justify-content: center;
justify-content: flex-start;
text-align: left;
flex-direction: row;
gap: var(--space-2);
}
.settings-page .settings-tabs button strong,