Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/web/src/components/settings/ProviderInstanceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ export function ProviderInstanceCard({
inert={readOnly}
aria-disabled={readOnly || undefined}
className={cn(
"flex w-full items-center justify-end gap-2 sm:w-auto",
"flex w-full min-w-0 items-center justify-end gap-2 @min-[32rem]/settings-row:w-auto",
readOnly && "opacity-50 select-none",
)}
>
Expand All @@ -831,7 +831,7 @@ export function ProviderInstanceCard({
<DraftInput
id={`provider-instance-${instanceId}-display-name`}
size="sm"
className="min-w-0 flex-1 sm:w-56 sm:flex-none"
className="min-w-0 flex-1 @min-[32rem]/settings-row:w-56"
value={instance.displayName ?? ""}
onCommit={updateDisplayName}
placeholder={driverOption?.label ?? "Instance label"}
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/components/settings/ProviderSettingsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,14 @@ function ProviderSettingsFieldRow({
value={value}
inputId={inputId}
size="sm"
className="w-full sm:w-56"
className="w-full max-w-full @min-[32rem]/settings-row:w-56"
onChange={onChange}
/>
) : field.control === "textarea" ? (
<Textarea
id={inputId}
aria-describedby={descriptionId}
className="w-full sm:w-96"
className="w-full max-w-full @min-[32rem]/settings-row:w-[min(24rem,50cqw)]"
value={readProviderConfigString(value, field.key)}
onChange={(event) =>
onChange(nextProviderConfigWithFieldValue(value, field, event.target.value))
Expand All @@ -285,7 +285,7 @@ function ProviderSettingsFieldRow({
id={inputId}
aria-describedby={descriptionId}
size="sm"
className="w-full sm:w-56"
className="w-full max-w-full @min-[32rem]/settings-row:w-56"
type={field.control === "password" ? "password" : undefined}
autoComplete={field.control === "password" ? "off" : undefined}
value={readProviderConfigString(value, field.key)}
Expand Down
19 changes: 12 additions & 7 deletions apps/web/src/components/settings/ProviderSettingsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ function providerEnvironmentDetail(environment: EnvironmentPresentation): string
const providerCardClassName = "rounded-xl border border-border/60 bg-card/40 shadow-xs/5";
// Shared by the editor grid and the placeholder states so switching devices
// never changes the card's footprint.
const providerCardHeightClassName = "lg:h-[min(44rem,calc(100dvh-11rem))] lg:min-h-[32rem]";
const providerCardHeightClassName =
"@min-[48rem]/providers:h-[min(44rem,calc(100dvh-11rem))] @min-[48rem]/providers:min-h-[32rem]";

/**
* Same chrome as the provider editor (section heading, floating device tabs,
Expand Down Expand Up @@ -271,7 +272,7 @@ interface ProviderSettingsTarget {

export function ProviderSettingsPanel(target: ProviderSettingsTarget) {
return (
<SettingsPageContainer width="wide" className="gap-8">
<SettingsPageContainer width="wide" className="@container/providers gap-8">
<ProviderSettingsPanelContent
key={`${target.environmentId ?? ""}:${target.instanceId ?? ""}`}
{...target}
Expand Down Expand Up @@ -1054,20 +1055,24 @@ export function EnvironmentProviderSettings({
className={cn(
providerCardClassName,
providerCardHeightClassName,
"overflow-hidden lg:grid lg:grid-cols-[17rem_minmax(0,1fr)]",
"overflow-hidden @min-[48rem]/providers:grid @min-[48rem]/providers:grid-cols-[17rem_minmax(0,1fr)]",
)}
>
<div className="border-b border-border/60 bg-muted/10 lg:flex lg:min-h-0 lg:flex-col lg:border-r lg:border-b-0">
<ScrollArea scrollFade chainVerticalScroll className="lg:min-h-0 lg:flex-1">
<div className="border-b border-border/60 bg-muted/10 @min-[48rem]/providers:flex @min-[48rem]/providers:min-h-0 @min-[48rem]/providers:flex-col @min-[48rem]/providers:border-r @min-[48rem]/providers:border-b-0">
<ScrollArea
scrollFade
chainVerticalScroll
className="@min-[48rem]/providers:min-h-0 @min-[48rem]/providers:flex-1"
>
<div className="divide-y divide-border/50">
{rows.map((row) => renderProviderInstance(row, "list"))}
</div>
</ScrollArea>
</div>

<div className="min-w-0 lg:min-h-0">
<div className="min-w-0 @min-[48rem]/providers:min-h-0">
{selectedRow ? (
<ScrollArea scrollFade chainVerticalScroll className="lg:h-full">
<ScrollArea scrollFade chainVerticalScroll className="@min-[48rem]/providers:h-full">
<div className="space-y-6 p-4">{renderProviderInstance(selectedRow, "editor")}</div>
</ScrollArea>
) : (
Expand Down
13 changes: 8 additions & 5 deletions apps/web/src/components/settings/settingsLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,14 @@ export function SettingsRow({
// Focusable so keyboard users can still reach the explanation.
<span
tabIndex={0}
className="flex w-full items-center rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring sm:w-auto"
className="flex w-full items-center rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring @min-[32rem]/settings-row:w-auto"
/>
}
>
<div inert className="flex w-full items-center gap-2 opacity-50 sm:w-auto">
<div
inert
className="flex w-full items-center gap-2 opacity-50 @min-[32rem]/settings-row:w-auto"
>
{control}
</div>
</TooltipTrigger>
Expand Down Expand Up @@ -437,12 +440,12 @@ export function SettingsRow({
tabIndex={rowProps.id ? -1 : rowProps.tabIndex}
data-slot="settings-row"
className={cn(
"rounded-xl px-3 sm:px-4 aria-disabled:opacity-50 aria-disabled:[&_*]:text-muted-foreground",
"@container/settings-row rounded-xl px-3 sm:px-4 aria-disabled:opacity-50 aria-disabled:[&_*]:text-muted-foreground",
children ? "pt-3 pb-1" : "py-3",
className,
)}
>
<div className="flex flex-col gap-3 sm:grid sm:grid-cols-[minmax(0,1fr)_minmax(10rem,auto)] sm:items-center sm:gap-8">
<div className="flex flex-col gap-3 @min-[32rem]/settings-row:grid @min-[32rem]/settings-row:grid-cols-[minmax(0,1fr)_minmax(10rem,auto)] @min-[32rem]/settings-row:items-center @min-[32rem]/settings-row:gap-8">
<div className="min-w-0 flex-1 space-y-1">
<div className="flex min-h-5 items-center gap-1.5">
<h3 className="text-sm font-medium tracking-[-0.005em] text-foreground">{title}</h3>
Expand All @@ -465,7 +468,7 @@ export function SettingsRow({
) : null}
</div>
{renderedControl ? (
<div className="flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end">
<div className="flex w-full min-w-0 shrink-0 items-center gap-2 @min-[32rem]/settings-row:w-auto @min-[32rem]/settings-row:justify-end">
{renderedControl}
</div>
) : null}
Expand Down
Loading