From 5c2aea0a6b2861b15e0bc7ef1658306a18b2f080 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 30 Dec 2025 01:40:34 +0200 Subject: [PATCH] chore: remove LLM generated doc --- CONTEXT_DATA_EXAMPLE.md | 194 ---------------------------------------- 1 file changed, 194 deletions(-) delete mode 100644 CONTEXT_DATA_EXAMPLE.md diff --git a/CONTEXT_DATA_EXAMPLE.md b/CONTEXT_DATA_EXAMPLE.md deleted file mode 100644 index ecd383eac..000000000 --- a/CONTEXT_DATA_EXAMPLE.md +++ /dev/null @@ -1,194 +0,0 @@ -# Context Data Pattern - Usage Examples - -This document shows how to use the new context data pattern to communicate between type widgets (inside splits) and shared components (sidebars, toolbars). - -## Architecture - -Data is stored directly on the `NoteContext` object: -- **Type widgets** (PDF, Text, Code) publish data using `useSetContextData()` -- **Sidebar/toolbar components** read data using `useGetContextData()` -- Data is automatically cleared when switching notes -- Components automatically re-render when data changes - -## Example 1: PDF Page Navigation - -### Publishing from PDF Viewer (inside split) - -```tsx -// In Pdf.tsx -import { useSetContextData } from "../../react/hooks"; - -interface PdfPageInfo { - pageNumber: number; - title: string; -} - -export default function PdfPreview({ note, blob }) { - const { noteContext } = useActiveNoteContext(); - const [pages, setPages] = useState([]); - - useEffect(() => { - // When PDF loads, extract page information - const pageInfo = extractPagesFromPdf(); - setPages(pageInfo); - }, [blob]); - - // Publish pages to context data - useSetContextData(noteContext, "pdfPages", pages); - - return