fix: minor ui fixes

This commit is contained in:
melvinchia3636
2026-06-24 10:20:40 +08:00
parent eaff3f4daa
commit 7fd13794c0
7 changed files with 18 additions and 9 deletions

View File

@@ -65,7 +65,7 @@ const getLocale = forge
query: z.object({
lang: z.string(),
namespace: z.enum(ALLOWED_NAMESPACE),
subnamespace: z.string()
subnamespace: z.string().regex(/^[a-zA-Z][a-zA-Z0-9-]*$/)
})
},
output: {

View File

@@ -80,7 +80,8 @@ export const contract = {
]
},
"subnamespace": {
"type": "string"
"type": "string",
"pattern": "^[a-zA-Z][a-zA-Z0-9-]*$"
}
},
"required": [

View File

@@ -80,7 +80,8 @@ export const contract = {
]
},
"subnamespace": {
"type": "string"
"type": "string",
"pattern": "^[a-zA-Z][a-zA-Z0-9-]*$"
}
},
"required": [

View File

@@ -80,7 +80,8 @@ export const contract = {
]
},
"subnamespace": {
"type": "string"
"type": "string",
"pattern": "^[a-zA-Z][a-zA-Z0-9-]*$"
}
},
"required": [

View File

@@ -1,12 +1,12 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { Flex } from '@/components/primitives'
import { Flex, type FlexProps } from '@/components/primitives'
import { usePersonalization } from '@/providers'
import { TagChip } from '../TagChip'
interface HeaderFilterProps<
T extends Record<string, string | string[] | null>
> {
> extends Omit<FlexProps<'div'>, 'onChange'> {
/** The filterable items available for selection. */
availableFilters: Record<
keyof T,
@@ -51,7 +51,8 @@ interface HeaderFilterProps<
export function TagsFilter<T extends Record<string, string | string[] | null>>({
availableFilters: items,
values,
onChange
onChange,
...rest
}: HeaderFilterProps<T>) {
const { derivedThemeColor } = usePersonalization()
@@ -60,7 +61,7 @@ export function TagsFilter<T extends Record<string, string | string[] | null>>({
}
return (
<Flex align="center" gap="sm" wrap="wrap">
<Flex align="center" gap="sm" wrap="wrap" {...rest}>
{Object.entries(items).map(
([query, { data, isColored }]) =>
values[query] &&

View File

@@ -89,6 +89,7 @@ function _Header({
dark: 'bg-800',
darkHover: 'bg-700'
}}
flex="1"
renderContent={value => value || 'All Categories'}
value={selectedCategory}
onChange={value => setSelectedCategory(value)}

View File

@@ -54,7 +54,11 @@ export function SidebarItemContent({
<Box asChild minWidth="0" width="100%">
<Text truncate as="div">
{typeof label === 'string' && namespace !== false
? t([`${namespace}:sidebar.${_.camelCase(label)}`, label])
? t([
`${namespace}:sidebar.${_.camelCase(label)}`,
`sidebar.${_.camelCase(label)}`,
label
])
: label}{' '}
{number !== undefined && hasSubsection && (
<Text