refactor(settings): regroup sidebar nav and pin header on scroll
Sidebar UX polish for the Settings modal: - Regroup nav into 5 cleaner buckets: Account / Workspace / Models / Data & Extensions / Platform. Personal preferences (general) and credentials (api) move to Account; chathistory follows its scope into Workspace; integrations and engines merge to avoid two narrow groups. - Pin the sidebar header (title) so it stays visible while the nav list scrolls; move overflow from the sidebar wrapper to the nav list itself. - Tighten paddings/font sizes a notch for higher information density without sacrificing hit targets. - Sync the four locale files (zh-CN as source of truth, plus en-US, ko-KR, ru-RU): drop workspaceAccount / integrations / knowledgeInfra; introduce account / workspace / dataExtensions.
This commit is contained in:
@@ -692,10 +692,10 @@ export default {
|
|||||||
tenantInfo: 'Tenant Info',
|
tenantInfo: 'Tenant Info',
|
||||||
apiInfo: 'API Info',
|
apiInfo: 'API Info',
|
||||||
navGroups: {
|
navGroups: {
|
||||||
workspaceAccount: 'Workspace',
|
account: 'Account',
|
||||||
|
workspace: 'Workspace',
|
||||||
modelsRuntime: 'Models',
|
modelsRuntime: 'Models',
|
||||||
integrations: 'Extensions',
|
dataExtensions: 'Data & Extensions',
|
||||||
knowledgeInfra: 'Engines',
|
|
||||||
platform: 'Platform',
|
platform: 'Platform',
|
||||||
},
|
},
|
||||||
roleDenied: {
|
roleDenied: {
|
||||||
|
|||||||
@@ -555,10 +555,10 @@ export default {
|
|||||||
tenantInfo: "테넌트 정보",
|
tenantInfo: "테넌트 정보",
|
||||||
apiInfo: "API 정보",
|
apiInfo: "API 정보",
|
||||||
navGroups: {
|
navGroups: {
|
||||||
workspaceAccount: "공간 및 계정",
|
account: "계정",
|
||||||
|
workspace: "공간",
|
||||||
modelsRuntime: "모델",
|
modelsRuntime: "모델",
|
||||||
integrations: "확장",
|
dataExtensions: "데이터 및 확장",
|
||||||
knowledgeInfra: "엔진",
|
|
||||||
platform: "플랫폼",
|
platform: "플랫폼",
|
||||||
},
|
},
|
||||||
roleDenied: {
|
roleDenied: {
|
||||||
|
|||||||
@@ -657,10 +657,10 @@ export default {
|
|||||||
tenantInfo: 'Информация о арендаторе',
|
tenantInfo: 'Информация о арендаторе',
|
||||||
apiInfo: 'Информация API',
|
apiInfo: 'Информация API',
|
||||||
navGroups: {
|
navGroups: {
|
||||||
workspaceAccount: 'Пространство и аккаунт',
|
account: 'Аккаунт',
|
||||||
|
workspace: 'Пространство',
|
||||||
modelsRuntime: 'Модели',
|
modelsRuntime: 'Модели',
|
||||||
integrations: 'Расширения',
|
dataExtensions: 'Данные и расширения',
|
||||||
knowledgeInfra: 'Движки',
|
|
||||||
platform: 'Платформа',
|
platform: 'Платформа',
|
||||||
},
|
},
|
||||||
roleDenied: {
|
roleDenied: {
|
||||||
|
|||||||
@@ -552,10 +552,10 @@ export default {
|
|||||||
tenantInfo: "空间信息",
|
tenantInfo: "空间信息",
|
||||||
apiInfo: "API信息",
|
apiInfo: "API信息",
|
||||||
navGroups: {
|
navGroups: {
|
||||||
workspaceAccount: "空间与账户",
|
account: "账户",
|
||||||
|
workspace: "空间",
|
||||||
modelsRuntime: "模型",
|
modelsRuntime: "模型",
|
||||||
integrations: "扩展",
|
dataExtensions: "数据与扩展",
|
||||||
knowledgeInfra: "引擎",
|
|
||||||
platform: "平台",
|
platform: "平台",
|
||||||
},
|
},
|
||||||
roleDenied: {
|
roleDenied: {
|
||||||
|
|||||||
@@ -303,12 +303,20 @@ const navItems = computed(() => {
|
|||||||
const navGroups = computed<NavGroup[]>(() => {
|
const navGroups = computed<NavGroup[]>(() => {
|
||||||
const itemMap = new Map(navItems.value.map((item) => [item.key, item]))
|
const itemMap = new Map(navItems.value.map((item) => [item.key, item]))
|
||||||
const pickItems = (keys: string[]) => keys.map((key) => itemMap.get(key)).filter(Boolean) as NavItem[]
|
const pickItems = (keys: string[]) => keys.map((key) => itemMap.get(key)).filter(Boolean) as NavItem[]
|
||||||
// 分组:空间与账户 → 模型 → 扩展 → 引擎 → 平台(文案见 i18n settings.navGroups)
|
// 分组:账户 → 空间 → 模型 → 数据与扩展 → 平台(文案见 i18n settings.navGroups)
|
||||||
|
// 关键调整:把个人偏好(general)和个人凭证(api)收进「账户」;
|
||||||
|
// 把空间内功能开关(chathistory)从「平台」挪到「空间」;
|
||||||
|
// 把检索引擎和外部集成合并为「数据与扩展」,避免两个 2~3 项的窄分组。
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
key: 'workspace_account',
|
key: 'account',
|
||||||
label: t('settings.navGroups.workspaceAccount'),
|
label: t('settings.navGroups.account'),
|
||||||
items: pickItems(['general', 'userprofile', 'tenant', 'members']),
|
items: pickItems(['general', 'userprofile', 'api']),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'workspace',
|
||||||
|
label: t('settings.navGroups.workspace'),
|
||||||
|
items: pickItems(['tenant', 'members', 'chathistory']),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'models_runtime',
|
key: 'models_runtime',
|
||||||
@@ -316,19 +324,14 @@ const navGroups = computed<NavGroup[]>(() => {
|
|||||||
items: pickItems(['models', 'ollama', 'weknoracloud']),
|
items: pickItems(['models', 'ollama', 'weknoracloud']),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'integrations',
|
key: 'data_extensions',
|
||||||
label: t('settings.navGroups.integrations'),
|
label: t('settings.navGroups.dataExtensions'),
|
||||||
items: pickItems(['websearch', 'mcp']),
|
items: pickItems(['vectorstore', 'parser', 'storage', 'websearch', 'mcp']),
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'knowledge_infra',
|
|
||||||
label: t('settings.navGroups.knowledgeInfra'),
|
|
||||||
items: pickItems(['vectorstore', 'parser', 'storage']),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'platform',
|
key: 'platform',
|
||||||
label: t('settings.navGroups.platform'),
|
label: t('settings.navGroups.platform'),
|
||||||
items: pickItems(['chathistory', 'system-global', 'system', 'api']),
|
items: pickItems(['system-global', 'system']),
|
||||||
},
|
},
|
||||||
].filter((group) => group.items.length > 0)
|
].filter((group) => group.items.length > 0)
|
||||||
})
|
})
|
||||||
@@ -533,30 +536,33 @@ onUnmounted(() => {
|
|||||||
background-color: var(--td-bg-color-settings-modal);
|
background-color: var(--td-bg-color-settings-modal);
|
||||||
border-right: 1px solid var(--td-component-stroke);
|
border-right: 1px solid var(--td-component-stroke);
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
overflow-y: auto;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-header {
|
.sidebar-header {
|
||||||
padding: 18px 14px 14px;
|
padding: 16px 14px 12px;
|
||||||
border-bottom: 1px solid var(--td-component-stroke);
|
border-bottom: 1px solid var(--td-component-stroke);
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-title {
|
.sidebar-title {
|
||||||
font-size: 17px;
|
font-size: 16px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--td-text-color-primary);
|
color: var(--td-text-color-primary);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-nav {
|
.settings-nav {
|
||||||
padding: 10px 8px 14px;
|
padding: 8px 8px 12px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
overflow-y: auto;
|
||||||
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-group-title {
|
.nav-group-title {
|
||||||
padding: 10px 14px 5px;
|
padding: 9px 14px 4px;
|
||||||
color: var(--td-text-color-placeholder);
|
color: var(--td-text-color-placeholder);
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
@@ -566,7 +572,7 @@ onUnmounted(() => {
|
|||||||
.nav-item {
|
.nav-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 7px 12px;
|
padding: 6px 12px;
|
||||||
margin-bottom: 2px;
|
margin-bottom: 2px;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -588,8 +594,8 @@ onUnmounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.nav-icon {
|
.nav-icon {
|
||||||
margin-right: 10px;
|
margin-right: 9px;
|
||||||
font-size: 17px;
|
font-size: 16px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@@ -615,7 +621,7 @@ onUnmounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.submenu-item {
|
.submenu-item {
|
||||||
padding: 6px 12px;
|
padding: 5px 12px;
|
||||||
margin-bottom: 2px;
|
margin-bottom: 2px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -738,21 +744,21 @@ onUnmounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 滚动条样式 */
|
/* 滚动条样式 */
|
||||||
.settings-sidebar::-webkit-scrollbar,
|
.settings-nav::-webkit-scrollbar,
|
||||||
.settings-content::-webkit-scrollbar {
|
.settings-content::-webkit-scrollbar {
|
||||||
width: 6px;
|
width: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-sidebar::-webkit-scrollbar-track {
|
.settings-nav::-webkit-scrollbar-track {
|
||||||
background: var(--td-bg-color-secondarycontainer);
|
background: var(--td-bg-color-secondarycontainer);
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-sidebar::-webkit-scrollbar-thumb {
|
.settings-nav::-webkit-scrollbar-thumb {
|
||||||
background: var(--td-gray-color-5);
|
background: var(--td-gray-color-5);
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-sidebar::-webkit-scrollbar-thumb:hover {
|
.settings-nav::-webkit-scrollbar-thumb:hover {
|
||||||
background: var(--td-gray-color-6);
|
background: var(--td-gray-color-6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user