Task attempt 84f34dec-b9ba-4430-84ce-07645c18d0ee - Final changes
This commit is contained in:
@@ -4,7 +4,6 @@ import {
|
|||||||
X,
|
X,
|
||||||
History,
|
History,
|
||||||
Clock,
|
Clock,
|
||||||
Code,
|
|
||||||
ChevronDown,
|
ChevronDown,
|
||||||
ChevronUp,
|
ChevronUp,
|
||||||
Settings2,
|
Settings2,
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ export function FileSearchTextarea({
|
|||||||
// Dropdown dimensions
|
// Dropdown dimensions
|
||||||
const dropdownWidth = 256 // min-w-64 = 256px
|
const dropdownWidth = 256 // min-w-64 = 256px
|
||||||
const minDropdownHeight = 120
|
const minDropdownHeight = 120
|
||||||
const maxDropdownHeight = 240 // max-h-60 = 240px
|
const maxDropdownHeight = 400 // Increased to show more results without scrolling
|
||||||
|
|
||||||
let finalTop = viewportTop
|
let finalTop = viewportTop
|
||||||
let finalLeft = viewportLeft
|
let finalLeft = viewportLeft
|
||||||
@@ -214,17 +214,17 @@ export function FileSearchTextarea({
|
|||||||
finalLeft = 16
|
finalLeft = 16
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent going off the bottom edge
|
// Prevent going off the bottom edge - use more generous spacing
|
||||||
const availableSpaceBelow = window.innerHeight - viewportTop - 16
|
const availableSpaceBelow = window.innerHeight - viewportTop - 32
|
||||||
const availableSpaceAbove = textareaRect.top + (currentLine * lineHeight) - 16
|
const availableSpaceAbove = textareaRect.top + (currentLine * lineHeight) - 32
|
||||||
|
|
||||||
if (availableSpaceBelow < minDropdownHeight && availableSpaceAbove > availableSpaceBelow) {
|
if (availableSpaceBelow < minDropdownHeight && availableSpaceAbove > availableSpaceBelow) {
|
||||||
// Position above the cursor line
|
// Position above the cursor line
|
||||||
finalTop = textareaRect.top + paddingTop + (currentLine * lineHeight) - maxDropdownHeight - 8
|
finalTop = textareaRect.top + paddingTop + (currentLine * lineHeight) - maxDropdownHeight - 8
|
||||||
maxHeight = Math.min(maxDropdownHeight, availableSpaceAbove)
|
maxHeight = Math.min(maxDropdownHeight, Math.max(availableSpaceAbove, minDropdownHeight))
|
||||||
} else {
|
} else {
|
||||||
// Position below the cursor line
|
// Position below the cursor line - prioritize using available space
|
||||||
maxHeight = Math.min(maxDropdownHeight, availableSpaceBelow)
|
maxHeight = Math.min(maxDropdownHeight, Math.max(availableSpaceBelow, minDropdownHeight))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure minimum height
|
// Ensure minimum height
|
||||||
|
|||||||
Reference in New Issue
Block a user