fix(ui): correct text orientation for CJK characters in collapsible column (#619)

This commit is contained in:
Zonghao Ye 2026-02-24 11:17:51 +08:00 committed by GitHub
parent cfdf1bd903
commit a25a10f7e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,6 +21,8 @@ export function CollapsibleColumn({
collapsedLabel, collapsedLabel,
children, children,
}: CollapsibleColumnProps) { }: CollapsibleColumnProps) {
const isCJK = /[\u4e00-\u9fa5\u3040-\u30ff\uac00-\ud7af]/.test(collapsedLabel);
if (isCollapsed) { if (isCollapsed) {
return ( return (
<TooltipProvider> <TooltipProvider>
@ -42,7 +44,7 @@ export function CollapsibleColumn({
<CollapsedIcon className="h-5 w-5 text-muted-foreground group-hover:text-foreground transition-colors flex-shrink-0" /> <CollapsedIcon className="h-5 w-5 text-muted-foreground group-hover:text-foreground transition-colors flex-shrink-0" />
<div <div
className="text-xs font-medium text-muted-foreground group-hover:text-foreground transition-colors whitespace-nowrap" className="text-xs font-medium text-muted-foreground group-hover:text-foreground transition-colors whitespace-nowrap"
style={{ writingMode: 'vertical-rl', transform: 'rotate(180deg)', textOrientation: 'mixed' }} style={{ writingMode: 'vertical-rl', transform: isCJK ? 'none' : 'rotate(180deg)', textOrientation: 'mixed' }}
> >
{collapsedLabel} {collapsedLabel}
</div> </div>