From 626e3740e105d8957f300724cd5b38f4028b0976 Mon Sep 17 00:00:00 2001 From: Jamie Pine Date: Sat, 14 Mar 2026 11:14:46 -0700 Subject: [PATCH] Auto-select first story when navigating to Stories tab --- app/src/components/StoriesTab/StoryList.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/components/StoriesTab/StoryList.tsx b/app/src/components/StoriesTab/StoryList.tsx index 64719257..4222a800 100644 --- a/app/src/components/StoriesTab/StoryList.tsx +++ b/app/src/components/StoriesTab/StoryList.tsx @@ -1,5 +1,5 @@ import { BookOpen, MoreHorizontal, Pencil, Plus, Trash2 } from 'lucide-react'; -import { useState } from 'react'; +import { useEffect, useState } from 'react'; import { AlertDialog, AlertDialogAction, @@ -62,6 +62,13 @@ export function StoryList() { const [newStoryDescription, setNewStoryDescription] = useState(''); const { toast } = useToast(); + // Auto-select the first story when the list loads with no selection + useEffect(() => { + if (!selectedStoryId && stories && stories.length > 0) { + setSelectedStoryId(stories[0].id); + } + }, [selectedStoryId, stories, setSelectedStoryId]); + const handleCreateStory = () => { if (!newStoryName.trim()) { toast({