From 6894f1c8719fa5751bc22fe221f16330835e7103 Mon Sep 17 00:00:00 2001 From: Ryderjj89 Date: Mon, 15 Sep 2025 17:55:08 -0400 Subject: [PATCH] Add direct verse navigation from search results - Search results now navigate directly to specific verses using URL hash - Clicking a search result takes you to the chapter and scrolls to the exact verse - Matches the behavior of favorites navigation for consistent user experience - URL format: /book/BookName/chapter/1#verse-5 for precise verse targeting --- frontend/src/components/SearchComponent.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/SearchComponent.tsx b/frontend/src/components/SearchComponent.tsx index e548a6e2..e65f08a6 100644 --- a/frontend/src/components/SearchComponent.tsx +++ b/frontend/src/components/SearchComponent.tsx @@ -77,7 +77,9 @@ const SearchComponent: React.FC = ({ // Handle result click const handleResultClick = (result: SearchResult) => { const urlBookName = getBookUrlName(formatBookName(result.book)); - navigate(`/book/${urlBookName}/chapter/${result.chapter}`); + // Navigate to chapter with verse hash to scroll directly to the verse + const url = `/book/${urlBookName}/chapter/${result.chapter}#verse-${result.verse}`; + navigate(url); if (onClose) onClose(); };