Skip to content

Your lightweight open-source personal agent.

fix(webui): restore CJK line height and refine text wrapping

chengyongru24033152c742
diff --git a/webui/src/components/ui/alert-dialog.tsx b/webui/src/components/ui/alert-dialog.tsx
index 77d42d6d0..59a25b540 100644
--- a/webui/src/components/ui/alert-dialog.tsx
+++ b/webui/src/components/ui/alert-dialog.tsx
@@ -78,7 +78,7 @@ const AlertDialogTitle = React.forwardRef<
>(({ className, ...props }, ref) => (
<AlertDialogPrimitive.Title
ref={ref}
- className={cn("text-lg font-semibold", className)}
+ className={cn("text-balance text-lg font-semibold", className)}
{...props}
/>
));
@@ -90,7 +90,7 @@ const AlertDialogDescription = React.forwardRef<
>(({ className, ...props }, ref) => (
<AlertDialogPrimitive.Description
ref={ref}
- className={cn("text-sm text-muted-foreground", className)}
+ className={cn("text-pretty text-sm text-muted-foreground", className)}
{...props}
/>
));
diff --git a/webui/src/components/ui/dialog.tsx b/webui/src/components/ui/dialog.tsx
index c093791e1..a412fc3e9 100644
--- a/webui/src/components/ui/dialog.tsx
+++ b/webui/src/components/ui/dialog.tsx
@@ -176,7 +176,7 @@ const DialogTitle = React.forwardRef<
<DialogPrimitive.Title
ref={ref}
className={cn(
- "text-lg font-semibold leading-none tracking-tight",
+ "text-balance text-lg font-semibold leading-none tracking-tight",
className,
)}
{...props}
@@ -190,7 +190,7 @@ const DialogDescription = React.forwardRef<
>(({ className, ...props }, ref) => (
<DialogPrimitive.Description
ref={ref}
- className={cn("text-sm text-muted-foreground", className)}
+ className={cn("text-pretty text-sm text-muted-foreground", className)}
{...props}
/>
));
diff --git a/webui/src/globals.css b/webui/src/globals.css
index 40e603685..466d4394c 100644
--- a/webui/src/globals.css
+++ b/webui/src/globals.css
@@ -120,6 +120,19 @@
body {
@apply bg-background text-foreground font-sans antialiased;
overflow: hidden;
+ text-autospace: normal;
+ }
+
+ /* Keep source text and editable values visually literal. */
+ pre,
+ code,
+ kbd,
+ samp,
+ .font-mono,
+ input,
+ textarea,
+ [contenteditable="true"] {
+ text-autospace: no-autospace;
}
#root.visual-viewport {
@@ -364,19 +377,21 @@
@apply list-none pl-0;
}
- /* CJK-friendly line-height: prose paragraphs default to 1.625 which is
- tight for Chinese/Japanese/Korean characters. Bump to 1.8 for better
- readability when the browser detects a CJK primary font. */
+ /* Set the default before locale overrides: html also matches :lang(). */
+ :root {
+ --cjk-line-height: 1.625;
+ }
+
:lang(zh),
- :lang(zh-CN),
- :lang(zh-TW),
- :lang(zh-HK),
:lang(ja),
:lang(ko) {
--cjk-line-height: 1.8;
}
- :root {
- --cjk-line-height: 1.625;
+
+ /* Balance short headings; preserve explicit line breaks in chat prose. */
+ .markdown-content :is(h1, h2, h3, h4, h5, h6),
+ .settings-section-title {
+ text-wrap: balance;
}
/* L→R sheen clipped to live activity labels. The highlight lives inside