diff --git a/app/src/components/StoriesTab/StoryList.tsx b/app/src/components/StoriesTab/StoryList.tsx index a283a34a..dd78d245 100644 --- a/app/src/components/StoriesTab/StoryList.tsx +++ b/app/src/components/StoriesTab/StoryList.tsx @@ -1,6 +1,6 @@ import { HugeiconsIcon } from '@hugeicons/react'; import { Add01Icon, Book01Icon, MoreHorizontalIcon, PencilIcon, Delete01Icon } from '@hugeicons/core-free-icons'; -import { useState } from 'react'; +import { useState, useMemo } from 'react'; import { AlertDialog, AlertDialogAction, @@ -30,7 +30,7 @@ import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Textarea } from '@/components/ui/textarea'; import { useToast } from '@/components/ui/use-toast'; -import { useStories, useCreateStory, useUpdateStory, useDeleteStory } from '@/lib/hooks/useStories'; +import { useStories, useCreateStory, useUpdateStory, useDeleteStory, useStory } from '@/lib/hooks/useStories'; import { cn } from '@/lib/utils/cn'; import { formatDate } from '@/lib/utils/format'; import { useStoryStore } from '@/stores/storyStore'; @@ -39,6 +39,8 @@ export function StoryList() { const { data: stories, isLoading } = useStories(); const selectedStoryId = useStoryStore((state) => state.selectedStoryId); const setSelectedStoryId = useStoryStore((state) => state.setSelectedStoryId); + const trackEditorHeight = useStoryStore((state) => state.trackEditorHeight); + const { data: currentStory } = useStory(selectedStoryId); const createStory = useCreateStory(); const updateStory = useUpdateStory(); const deleteStory = useDeleteStory(); @@ -55,6 +57,16 @@ export function StoryList() { const [newStoryDescription, setNewStoryDescription] = useState(''); const { toast } = useToast(); + // Calculate bottom padding to account for FloatingGenerateBox and StoryTrackEditor + const hasTrackEditor = currentStory && currentStory.items.length > 0; + const bottomPadding = useMemo(() => { + // FloatingGenerateBox height (~100px) + gap (24px) + const generateBoxHeight = 124; + // Track editor height when visible + const editorHeight = hasTrackEditor ? trackEditorHeight + 24 : 0; + return generateBoxHeight + editorHeight; + }, [hasTrackEditor, trackEditorHeight]); + const handleCreateStory = () => { if (!newStoryName.trim()) { toast({ @@ -184,7 +196,10 @@ export function StoryList() { {/* Story List */} -
+
{storyList.length === 0 ? (