refactor: system settings UI for consistent, compact layouts

Redesign the system settings interface to align with the rest of the console experience by using fixed header actions, removing redundant subtitles, respecting global content width, and standardizing responsive form layouts.

Introduce reusable settings layout primitives for forms, switch rows, grouped controls, nested control sections, title status indicators, and page action portals. Replace duplicated card-style switch markup with explicit compact components, improve nested switch readability, and reduce visual noise across authentication, billing, content, integrations, maintenance, models, and request-limit settings.

Also complete missing i18n translations, remove obsolete subtitle translation keys, refine i18n sync reporting, fix sidebar truncation for long labels, and verify the frontend with type checking and lint diagnostics.
This commit is contained in:
t0ng7u
2026-05-25 00:34:26 +08:00
parent 92a0959448
commit b08febaa3c
97 changed files with 2420 additions and 3032 deletions
@@ -231,9 +231,9 @@ export function ChatPresetsItem({ item }: { item: NavChatPresets }) {
<DropdownMenuTrigger
render={<SidebarMenuButton tooltip={item.title} />}
>
{item.icon && <item.icon className='h-4 w-4' />}
<span>{item.title}</span>
<ChevronRight className='ms-auto h-4 w-4 opacity-70' />
{item.icon && <item.icon className='h-4 w-4 shrink-0' />}
<span className='min-w-0 flex-1 truncate'>{item.title}</span>
<ChevronRight className='ms-auto h-4 w-4 shrink-0 opacity-70' />
</DropdownMenuTrigger>
<DropdownMenuContent align='start'>
{visiblePresets.map((preset) => (
@@ -261,9 +261,9 @@ export function ChatPresetsItem({ item }: { item: NavChatPresets }) {
className='group/collapsible-trigger'
render={<SidebarMenuButton />}
>
{item.icon && <item.icon />}
<span>{item.title}</span>
<ChevronRight className='ms-auto transition-transform duration-200 group-data-[panel-open]/collapsible-trigger:rotate-90' />
{item.icon && <item.icon className='shrink-0' />}
<span className='min-w-0 flex-1 truncate'>{item.title}</span>
<ChevronRight className='ms-auto size-4 shrink-0 transition-transform duration-200 group-data-[panel-open]/collapsible-trigger:rotate-90' />
</CollapsibleTrigger>
<CollapsibleContent className='CollapsibleContent'>
<SidebarMenuSub>
+11 -11
View File
@@ -112,7 +112,7 @@ export function NavGroup({ title, items }: NavGroupProps) {
* Navigation badge component
*/
function NavBadge({ children }: { children: ReactNode }) {
return <Badge className='px-1 py-0 text-xs'>{children}</Badge>
return <Badge className='shrink-0 px-1 py-0 text-xs'>{children}</Badge>
}
/**
@@ -127,8 +127,8 @@ function SidebarMenuLink({ item, href }: { item: NavLink; href: string }) {
tooltip={item.title}
render={<Link to={item.url} onClick={() => setOpenMobile(false)} />}
>
{item.icon && <item.icon />}
<span>{item.title}</span>
{item.icon && <item.icon className='shrink-0' />}
<span className='min-w-0 flex-1 truncate'>{item.title}</span>
{item.badge && <NavBadge>{item.badge}</NavBadge>}
</SidebarMenuButton>
</SidebarMenuItem>
@@ -170,10 +170,10 @@ function SidebarMenuCollapsible({
className='group/collapsible-trigger'
render={<SidebarMenuButton tooltip={item.title} />}
>
{item.icon && <item.icon />}
<span>{item.title}</span>
{item.icon && <item.icon className='shrink-0' />}
<span className='min-w-0 flex-1 truncate'>{item.title}</span>
{item.badge && <NavBadge>{item.badge}</NavBadge>}
<ChevronRight className='ms-auto transition-transform duration-200 group-data-[panel-open]/collapsible-trigger:rotate-90' />
<ChevronRight className='ms-auto size-4 shrink-0 transition-transform duration-200 group-data-[panel-open]/collapsible-trigger:rotate-90' />
</CollapsibleTrigger>
<CollapsibleContent className='CollapsibleContent'>
<SidebarMenuSub>
@@ -185,8 +185,8 @@ function SidebarMenuCollapsible({
<Link to={subItem.url} onClick={() => setOpenMobile(false)} />
}
>
{subItem.icon && <subItem.icon />}
<span>{subItem.title}</span>
{subItem.icon && <subItem.icon className='shrink-0' />}
<span className='min-w-0 flex-1 truncate'>{subItem.title}</span>
{subItem.badge && <NavBadge>{subItem.badge}</NavBadge>}
</SidebarMenuSubButton>
</SidebarMenuSubItem>
@@ -219,10 +219,10 @@ function SidebarMenuCollapsedDropdown({
/>
}
>
{item.icon && <item.icon />}
<span>{item.title}</span>
{item.icon && <item.icon className='shrink-0' />}
<span className='min-w-0 flex-1 truncate'>{item.title}</span>
{item.badge && <NavBadge>{item.badge}</NavBadge>}
<ChevronRight className='ms-auto transition-transform duration-200 group-data-[popup-open]/dropdown-trigger:rotate-90' />
<ChevronRight className='ms-auto size-4 shrink-0 transition-transform duration-200 group-data-[popup-open]/dropdown-trigger:rotate-90' />
</DropdownMenuTrigger>
<DropdownMenuContent side='right' align='start' sideOffset={4}>
<DropdownMenuGroup>
@@ -33,11 +33,6 @@ function SectionPageLayoutTitle(_props: SlotProps) {
}
SectionPageLayoutTitle.displayName = 'SectionPageLayout.Title'
function SectionPageLayoutDescription(_props: SlotProps) {
return null
}
SectionPageLayoutDescription.displayName = 'SectionPageLayout.Description'
function SectionPageLayoutActions(_props: SlotProps) {
return null
}
@@ -87,13 +82,13 @@ export function SectionPageLayout(props: SectionPageLayoutProps) {
<div className='mb-2 sm:mb-3'>{breadcrumb}</div>
)}
<div className='flex flex-wrap items-center justify-between gap-x-3 gap-y-2 sm:gap-x-4'>
<div className='min-w-0'>
<div className='min-w-0 flex-1'>
<h2 className='truncate text-base font-bold tracking-tight sm:text-lg'>
{title}
</h2>
</div>
{actions != null && (
<div className='flex shrink-0 flex-wrap items-center gap-2 sm:gap-x-4'>
<div className='flex shrink-0 flex-wrap items-center justify-end gap-2 sm:gap-x-4'>
{actions}
</div>
)}
@@ -114,7 +109,6 @@ export function SectionPageLayout(props: SectionPageLayoutProps) {
}
SectionPageLayout.Title = SectionPageLayoutTitle
SectionPageLayout.Description = SectionPageLayoutDescription
SectionPageLayout.Actions = SectionPageLayoutActions
SectionPageLayout.Content = SectionPageLayoutContent
SectionPageLayout.Breadcrumb = SectionPageLayoutBreadcrumb