From 43e8fc764a240caefd184eee83d5dda7e68861e4 Mon Sep 17 00:00:00 2001 From: Laputa App Date: Fri, 27 Feb 2026 16:58:10 +0100 Subject: [PATCH] fix: property dropdowns adapt to narrow panel width - Popover and Select components: add collisionPadding=8 as default - TypeSelector and AddPropertyForm SelectContent: position=popper, side=left - DateValue and AddDateInput PopoverContent: side=left Dropdowns now flip direction when hitting viewport edge instead of clipping. --- src-tauri/target | 1 + src/components/DynamicPropertiesPanel.tsx | 8 ++++---- src/components/ui/popover.tsx | 2 ++ src/components/ui/select.tsx | 2 ++ 4 files changed, 9 insertions(+), 4 deletions(-) create mode 120000 src-tauri/target diff --git a/src-tauri/target b/src-tauri/target new file mode 120000 index 00000000..251f8ace --- /dev/null +++ b/src-tauri/target @@ -0,0 +1 @@ +/Users/luca/Workspace/laputa-app/src-tauri/target \ No newline at end of file diff --git a/src/components/DynamicPropertiesPanel.tsx b/src/components/DynamicPropertiesPanel.tsx index 6d29cfb6..f9222cf2 100644 --- a/src/components/DynamicPropertiesPanel.tsx +++ b/src/components/DynamicPropertiesPanel.tsx @@ -148,7 +148,7 @@ function DateValue({ value, onSave }: { {formatted || 'Pick a date\u2026'} - + - + - + {DISPLAY_MODE_OPTIONS.map(opt => { const OptIcon = DISPLAY_MODE_ICONS[opt.value] return ( @@ -428,7 +428,7 @@ function TypeSelector({ isA, customColorKey, availableTypes, onUpdateProperty, o > - + None {options.map(type => ( diff --git a/src/components/ui/popover.tsx b/src/components/ui/popover.tsx index 444211f3..c618fe7e 100644 --- a/src/components/ui/popover.tsx +++ b/src/components/ui/popover.tsx @@ -19,6 +19,7 @@ function PopoverContent({ className, align = "center", sideOffset = 4, + collisionPadding = 8, ...props }: React.ComponentProps) { return ( @@ -27,6 +28,7 @@ function PopoverContent({ data-slot="popover-content" align={align} sideOffset={sideOffset} + collisionPadding={collisionPadding} className={cn( "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-[12000] w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", className diff --git a/src/components/ui/select.tsx b/src/components/ui/select.tsx index e437f056..141cd421 100644 --- a/src/components/ui/select.tsx +++ b/src/components/ui/select.tsx @@ -53,6 +53,7 @@ function SelectContent({ children, position = "item-aligned", align = "center", + collisionPadding = 8, ...props }: React.ComponentProps) { return ( @@ -67,6 +68,7 @@ function SelectContent({ )} position={position} align={align} + collisionPadding={collisionPadding} {...props} >