From dab35820b76c9b3e3f0f397169f45b33a27c8d9c Mon Sep 17 00:00:00 2001 From: Gigi Date: Thu, 2 Oct 2025 23:33:05 +0200 Subject: [PATCH] feat: add onSelectUrl to BookmarkItem and intercept URL clicks - Adds optional onSelectUrl callback - Prevents default navigation to open in main content panel - Keeps middle-click/target blank behavior if no handler --- src/components/BookmarkItem.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/BookmarkItem.tsx b/src/components/BookmarkItem.tsx index 0ab34362..753668b4 100644 --- a/src/components/BookmarkItem.tsx +++ b/src/components/BookmarkItem.tsx @@ -8,9 +8,10 @@ import { extractUrlsFromContent } from '../services/bookmarkHelpers' interface BookmarkItemProps { bookmark: IndividualBookmark index: number + onSelectUrl?: (url: string) => void } -export const BookmarkItem: React.FC = ({ bookmark, index }) => { +export const BookmarkItem: React.FC = ({ bookmark, index, onSelectUrl }) => { const copy = async (text: string) => { try { await navigator.clipboard.writeText(text) @@ -50,7 +51,14 @@ export const BookmarkItem: React.FC = ({ bookmark, index }) =

URLs:

{extractedUrls.map((url, urlIndex) => ( - + { if (onSelectUrl) { e.preventDefault(); onSelectUrl(url) } }} + > {url} ))}