Skip to content

Commit 590cf4f

Browse files
committed
feat(dashboard): improve layout overflow handling and responsive design
1 parent 8d92544 commit 590cf4f

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

dashboard/src/components/common/string-array-popover-input.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export function StringArrayPopoverInput({
124124
dir="ltr"
125125
variant="outline"
126126
role="combobox"
127-
className={cn('h-auto w-full min-w-0 justify-between p-2 text-left', className)}
127+
className={cn('h-auto w-full min-w-0 overflow-hidden justify-between p-2 text-left', className)}
128128
title={displayValue || placeholder}
129129
disabled={disabled}
130130
>
@@ -193,7 +193,7 @@ export function StringArrayPopoverInput({
193193
</div>
194194
<div className="min-h-0 max-h-[min(50dvh,14rem)] space-y-1 overflow-y-auto overscroll-contain pr-1 touch-pan-y">
195195
{items.map((item, index) => (
196-
<div key={`${item}-${index}`} className="group flex min-w-0 items-center gap-2 rounded-md border p-2 transition-colors hover:bg-accent/50">
196+
<div key={`${item}-${index}`} className="group flex min-w-0 max-w-full items-center gap-2 rounded-md border p-2 transition-colors hover:bg-accent/50">
197197
{editingIndex === index ? (
198198
<Input
199199
value={editingValue}

dashboard/src/features/hosts/dialogs/host-modal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ const ArrayInput = memo<ArrayInputProps>(({ field, placeholder, label, infoConte
198198
const isMobile = useIsMobile()
199199

200200
return (
201-
<FormItem>
201+
<FormItem className="min-w-0">
202202
<div className="flex items-center gap-2">
203203
<FormLabel>{label}</FormLabel>
204204
{infoContent && (
@@ -807,8 +807,8 @@ const HostModal: React.FC<HostModalProps> = ({ isDialogOpen, onOpenChange, onSub
807807
)}
808808
/>
809809

810-
<div className="!mb-4 flex justify-between gap-4">
811-
<div className="flex-[2]">
810+
<div className="!mb-4 grid grid-cols-1 gap-4 sm:grid-cols-[minmax(0,2fr)_minmax(7rem,1fr)]">
811+
<div className="min-w-0">
812812
<FormField
813813
control={form.control}
814814
name="address"
@@ -819,7 +819,7 @@ const HostModal: React.FC<HostModalProps> = ({ isDialogOpen, onOpenChange, onSub
819819
}}
820820
/>
821821
</div>
822-
<div className="flex-1">
822+
<div className="min-w-0">
823823
<FormField
824824
control={form.control}
825825
name="port"

0 commit comments

Comments
 (0)