@@ -46,7 +46,8 @@ workspaces
4646 ├── parent_id → pages.id (nullable, enables nesting)
4747 ├── content: jsonb (Lexical editor state — NOT a separate blocks table)
4848 ├── position: integer (ordering among siblings)
49- └── created_by → profiles.id
49+ ├── created_by → profiles.id
50+ └── search_vector: tsvector (generated, title weight A + content text weight B, GIN indexed)
5051
5152Sign-up flow (atomic, via DB trigger):
5253 1. auth.users row created by Supabase Auth
@@ -70,7 +71,7 @@ Sign-up flow (atomic, via DB trigger):
7071| Session management | Next.js 16 proxy (not middleware) | ` src/proxy.ts ` with ` updateSession ` — Next.js 16 convention replacing middleware |
7172| Floating UI | ` @floating-ui/react ` | Positioning for slash command menu, floating toolbar, link editor (same as Lexical playground) |
7273| Image storage | Supabase Storage | Bucket for uploaded images, public URL stored in ImageNode |
73- | Full-text search | PostgreSQL ` tsvector ` + ` tsquery ` | Generated column or trigger on page title + extracted content text |
74+ | Full-text search | PostgreSQL ` tsvector ` + ` tsquery ` | Generated column on pages combining title (weight A) + extracted content text (weight B), GIN index, ` search_pages ` RPC |
7475
7576## Lexical Editor — Implementation Plan
7677
158159│ │ ├── page.tsx # /[workspaceSlug] — workspace home (page list or empty state)
159160│ │ └── [pageId]/page.tsx # /[workspaceSlug]/[pageId] — page with title + editor placeholder
160161│ └── api/
161- │ └── health/route.ts # Health check endpoint (DB connectivity)
162+ │ ├── health/route.ts # Health check endpoint (DB connectivity)
163+ │ └── search/route.ts # Full-text search (GET ?q=&workspace_id=) → calls search_pages RPC
162164├── components/
163165│ ├── auth/
164166│ │ ├── oauth-buttons.tsx # GitHub + Google buttons (disabled, "coming soon" tooltip)
169171│ │ ├── sidebar-context.tsx # React context for sidebar open/close state + ⌘+\ shortcut
170172│ │ ├── workspace-switcher.tsx # Dropdown listing all workspaces, create workspace trigger
171173│ │ ├── create-workspace-dialog.tsx # Dialog for creating a new workspace
174+ │ │ ├── page-search.tsx # Full-text search input + results dropdown (debounced, 300ms)
172175│ │ ├── page-tree.tsx # Hierarchical page tree with CRUD, drag-and-drop, nest/unnest
173176│ │ └── user-menu.tsx # User dropdown with settings link + sign-out
174177│ ├── page-title.tsx # Inline-editable page title (saves on blur/Enter)
0 commit comments