Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:0xranx OpenContext PageRefPicker

From Leeroopedia
Knowledge Sources
Domains Editor, React
Last Updated 2026-10-24 00:00 GMT

Overview

Page reference picker modal for the Tiptap editor, providing searchable document selection and inserting OpenContext stable-link page references.

Description

The PageRefPicker.jsx component in src/ui/src/editor/tiptap/ is a modal that lets users search and select documents from the knowledge base to insert as page reference nodes in the editor. It fetches the folder tree and document list, provides fuzzy search filtering, and inserts an oc://doc/{stable_id} link node into the Tiptap editor when a document is selected.

Usage

Import this component and render it conditionally when the slash menu triggers a page reference insertion.

Code Reference

Source Location

Signature

export default function PageRefPicker({ editor, isOpen, onClose })

Import

import PageRefPicker from './editor/tiptap/PageRefPicker';

I/O Contract

Inputs

Name Type Required Description
editor Editor Yes Tiptap editor instance
isOpen boolean Yes Modal visibility
onClose Function Yes Close callback

Usage Examples

Rendering Page Reference Picker

import PageRefPicker from './editor/tiptap/PageRefPicker';

<PageRefPicker
  editor={editor}
  isOpen={pageRefOpen}
  onClose={() => setPageRefOpen(false)}
/>

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment