fix(webui): share control layout for preset alignment
This commit is contained in:
1 parent
55ff1d8d1f
commit
763ae9c2ae
7 files changed
+49
-18
No files matched your search
@@ -80,7 +80,7 @@ export function ModelAPIControl({
|
||||
</SelectContent>
|
||||
</Select>
|
||||
) : (
|
||||
<span className="block pe-3 text-[13px] text-muted-foreground sm:text-right">{fixedLabel}</span>
|
||||
<span className="control-layout w-full justify-start border-transparent text-[13px] text-muted-foreground sm:justify-end">{fixedLabel}</span>
|
||||
)}
|
||||
</SettingsRow>
|
||||
{configurable && selectedAPI === "responses" && (!requestAPIs || requestAPIs.includes("chat_completions")) ? (
|
||||
|
||||
@@ -6,7 +6,6 @@ import { useAutoSave } from "@/components/settings/shared/useAutoSave";
|
||||
import { useEffect, useId, useRef, useState, type Dispatch, type SetStateAction } from "react";
|
||||
import { DisclosureContent } from "@/components/ui/disclosure";
|
||||
import {
|
||||
ChevronDown,
|
||||
GripVertical,
|
||||
ListOrdered,
|
||||
Loader2,
|
||||
@@ -34,6 +33,7 @@ import {
|
||||
StatusPill,
|
||||
} from "@/components/settings/shared/SettingsControls";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { ControlChevron } from "@/components/ui/control-chevron";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -530,9 +530,9 @@ export function ModelsSettings({
|
||||
aria-expanded={advancedOpen}
|
||||
aria-controls={advancedId}
|
||||
onClick={() => setAdvancedOpen((value) => !value)}
|
||||
className="flex min-h-[62px] w-full items-center justify-between gap-4 px-4 py-3.5 text-left transition-colors settings-hover sm:px-5"
|
||||
className="settings-disclosure-row w-full text-left transition-colors settings-hover"
|
||||
>
|
||||
<span>
|
||||
<span className="min-w-0">
|
||||
<span className="block text-[14px] font-medium text-foreground">
|
||||
{tx("settings.models.advancedOptions", "Advanced options")}
|
||||
</span>
|
||||
@@ -545,13 +545,16 @@ export function ModelsSettings({
|
||||
})}</span>
|
||||
</span>
|
||||
</span>
|
||||
<ChevronDown
|
||||
className={cn(
|
||||
"me-3 h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200 motion-reduce:transition-none",
|
||||
advancedOpen && "rotate-180",
|
||||
)}
|
||||
aria-hidden
|
||||
/>
|
||||
<span className="settings-control">
|
||||
<span className="control-layout justify-end border-transparent">
|
||||
<ControlChevron
|
||||
className={cn(
|
||||
"transition-transform duration-200 motion-reduce:transition-none",
|
||||
advancedOpen && "rotate-180",
|
||||
)}
|
||||
/>
|
||||
</span>
|
||||
</span>
|
||||
</button>
|
||||
<DisclosureContent id={advancedId} open={advancedOpen}>
|
||||
<div className="bg-muted/12 px-4 py-4 sm:px-5">
|
||||
|
||||
@@ -3,7 +3,6 @@ import {
|
||||
Bot,
|
||||
Brain,
|
||||
Check,
|
||||
ChevronDown,
|
||||
CircleAlert,
|
||||
Cloud,
|
||||
Cpu,
|
||||
@@ -26,6 +25,7 @@ import {
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { ControlChevron } from "@/components/ui/control-chevron";
|
||||
import { ComboboxOption, useComboboxNavigation } from "@/components/ui/combobox";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { Input } from "@/components/ui/input";
|
||||
@@ -126,7 +126,7 @@ export function ProviderPicker({
|
||||
type="button"
|
||||
disabled={disabled}
|
||||
className={cn(
|
||||
"h-9 w-full justify-between rounded-full border-input bg-background px-3 text-[13px] font-normal shadow-none",
|
||||
"w-full justify-between rounded-full border-input bg-background text-[13px] font-normal shadow-none",
|
||||
"settings-hover focus-visible:ring-2 focus-visible:ring-ring",
|
||||
disabled && "text-muted-foreground",
|
||||
)}
|
||||
@@ -364,8 +364,9 @@ export function ModelIdPicker({
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="control"
|
||||
className={cn(
|
||||
"h-9 w-full justify-between rounded-full border-input bg-background px-3 text-[13px] font-normal shadow-none",
|
||||
"w-full justify-between rounded-full border-input bg-background text-[13px] font-normal shadow-none",
|
||||
"settings-hover focus-visible:ring-2 focus-visible:ring-ring",
|
||||
)}
|
||||
>
|
||||
@@ -384,7 +385,7 @@ export function ModelIdPicker({
|
||||
{value || emptyLabel || tx("settings.models.selectModel", "Select model")}
|
||||
</span>
|
||||
</span>
|
||||
<ChevronDown className="ml-2 h-3.5 w-3.5 shrink-0 text-muted-foreground" aria-hidden />
|
||||
<ControlChevron />
|
||||
</Button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent
|
||||
|
||||
Reference in new issue
Block a user