Files
vibe-kanban/frontend
Louis Knight-Webb 62380777c9 File selector files move around too much (vibe-kanban) (#122)
* I've simplified the dropdown positioning to be much more stable and consistent. The key changes:

1. **Removed complex cursor-based positioning** - Instead of trying to calculate exact character positions, the dropdown now appears consistently below (or above) the textarea
2. **Fixed reference point** - Always positions relative to the textarea edges rather than cursor position
3. **Simpler logic** - Just checks if there's enough space below, otherwise positions above
4. **Consistent spacing** - Uses a 4px gap between textarea and dropdown

This approach eliminates the positioning inconsistencies while keeping the dropdown visually connected to the textarea where the user is typing.

* Perfect! Now the dropdown positioning accounts for the actual content height when positioning above the textarea. The key changes:

1. **Calculate actual height** - Based on the number of filtered results (`filteredFiles.length * itemHeight + dropdownPadding`)
2. **Use actual height for positioning** - When positioning above, uses `actualHeight` instead of `maxDropdownHeight` to eliminate gaps
3. **Configurable constants** - Added `itemHeight` and `dropdownPadding` that can be adjusted based on your actual item styling

This ensures the dropdown appears right above the textarea without blank space, regardless of how many results are shown.

* Fixed! Now the dropdown positioning correctly uses `searchResults.length` instead of the undefined `filteredFiles` variable. The dropdown will now properly calculate its actual height based on the number of search results and position itself without gaps when appearing above the textarea.

* I've increased the `itemHeight` to 60px to better account for the actual rendered height of each item (which has `px-3 py-2` padding plus two lines of text), and reduced the `dropdownPadding` to 8px to match the `py-1` class. This should eliminate the gap when the dropdown is positioned above the textarea.

* Now I'm using a ref-based approach that measures the actual rendered height of the dropdown and repositions it accordingly. The key changes:

1. **Real height measurement** - Uses `dropdownRef.current?.getBoundingClientRect().height` to get the actual rendered height
2. **Dynamic repositioning** - Added a `useEffect` that runs when the dropdown content changes to reposition it
3. **Eliminated guesswork** - No more trying to predict the height with calculations

This should eliminate the gap completely since it uses the actual rendered dimensions rather than estimates.

* prettier
2025-07-10 15:09:06 +01:00
..
2025-07-08 13:41:47 +02:00
2025-06-25 09:36:07 +01:00
2025-06-25 09:36:07 +01:00
2025-06-14 15:14:08 -04:00
2025-07-08 13:41:47 +02:00
2025-06-14 15:14:08 -04:00
2025-06-14 16:26:48 -04:00
2025-06-14 15:14:08 -04:00
2025-07-04 11:11:45 +02:00