mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-14 04:16:06 +00:00
fix(web): improve advanced settings dialog layout and width
Widen settings dialogs from sm:max-w-2xl (672px) to sm:max-w-3xl (768px) to prevent cramped toggle groups. Move boolean field help text to a separate line below the switch+label for cleaner readability.
This commit is contained in:
1 parent
4e4a835795
commit
cace4dcf31
7 files changed
+20
-17
No files matched your search
@@ -275,7 +275,7 @@ export function SystemSettingsModal({ open, onOpenChange }: SystemSettingsModalP
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="flex max-h-[90vh] w-[95vw] flex-col sm:max-w-2xl">
|
||||
<DialogContent className="flex max-h-[90vh] w-[95vw] flex-col sm:max-w-3xl">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="flex items-center gap-2">
|
||||
<Settings2 className="h-5 w-5" />
|
||||
|
||||
@@ -213,7 +213,7 @@ export function AgentAdvancedDialog({ open, onOpenChange, agent, onUpdate }: Age
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="max-h-[90vh] w-[95vw] flex flex-col sm:max-w-2xl">
|
||||
<DialogContent className="max-h-[90vh] w-[95vw] flex flex-col sm:max-w-3xl">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="flex items-center gap-2">
|
||||
<Settings className="h-4 w-4" />
|
||||
|
||||
@@ -163,7 +163,7 @@ export function HeartbeatConfigDialog({
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="max-h-[90vh] w-[95vw] flex flex-col sm:max-w-2xl">
|
||||
<DialogContent className="max-h-[90vh] w-[95vw] flex flex-col sm:max-w-3xl">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="flex items-center gap-2">
|
||||
<Heart className="h-4 w-4 text-rose-500" />
|
||||
|
||||
@@ -93,7 +93,7 @@ export function ChannelAdvancedDialog({
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="max-h-[90vh] w-[95vw] flex flex-col sm:max-w-2xl">
|
||||
<DialogContent className="max-h-[90vh] w-[95vw] flex flex-col sm:max-w-3xl">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="flex items-center gap-2">
|
||||
<Settings className="h-4 w-4" />
|
||||
|
||||
@@ -123,20 +123,23 @@ function FieldRenderer({
|
||||
</div>
|
||||
);
|
||||
|
||||
case "boolean":
|
||||
case "boolean": {
|
||||
const boolHint = resolvedHint || help;
|
||||
return (
|
||||
<div className={`flex items-center gap-2${disabled ? " opacity-50" : ""}`}>
|
||||
<Switch
|
||||
id={id}
|
||||
checked={(value as boolean) ?? (field.defaultValue as boolean) ?? false}
|
||||
onCheckedChange={(v) => onChange(v)}
|
||||
disabled={disabled}
|
||||
/>
|
||||
<Label htmlFor={id}>{label}</Label>
|
||||
{resolvedHint && <span className="text-xs text-muted-foreground ml-1">— {resolvedHint}</span>}
|
||||
{!resolvedHint && help && <span className="text-xs text-muted-foreground ml-1">— {help}</span>}
|
||||
<div className={`grid gap-1${disabled ? " opacity-50" : ""}`}>
|
||||
<div className="flex items-center gap-2">
|
||||
<Switch
|
||||
id={id}
|
||||
checked={(value as boolean) ?? (field.defaultValue as boolean) ?? false}
|
||||
onCheckedChange={(v) => onChange(v)}
|
||||
disabled={disabled}
|
||||
/>
|
||||
<Label htmlFor={id}>{label}</Label>
|
||||
</div>
|
||||
{boolHint && <p className="text-xs text-muted-foreground ml-9">{boolHint}</p>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
case "select":
|
||||
return (
|
||||
|
||||
@@ -117,7 +117,7 @@ export function CronAdvancedDialog({ open, onOpenChange, job, onUpdate }: CronAd
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="max-h-[90vh] w-[95vw] flex flex-col sm:max-w-2xl">
|
||||
<DialogContent className="max-h-[90vh] w-[95vw] flex flex-col sm:max-w-3xl">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="flex items-center gap-2">
|
||||
<Settings className="h-4 w-4" />
|
||||
|
||||
@@ -110,7 +110,7 @@ export function ProviderAdvancedDialog({
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="max-h-[90vh] w-[95vw] flex flex-col sm:max-w-2xl">
|
||||
<DialogContent className="max-h-[90vh] w-[95vw] flex flex-col sm:max-w-3xl">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="flex items-center gap-2">
|
||||
<Settings className="h-4 w-4" />
|
||||
|
||||
Reference in new issue
Block a user