Description
The workspace home page list shows only page titles, icons, and last-modified timestamps. When multiple pages share the same title (especially "Untitled"), users cannot distinguish between them without clicking each one. Adding a single-line content preview snippet below each page title would help users identify pages at a glance, similar to how email clients show message previews.
Evidence
- Live product review: The workspace home showed 19 pages, many titled "Untitled" or "Untitled Database". Without content previews, these pages are visually indistinguishable. Users must click each page to find the one they want.
- Codebase review: The
pages table stores content as Lexical JSON (content jsonb). A public.extract_text_from_lexical(content) function already exists in the database (migration 20260415111351) for search indexing. The workspace home query (src/app/(app)/[workspaceSlug]/page.tsx) currently fetches id, title, parent_id, position, icon, is_database, created_at, updated_at — no content data.
- User feedback: Multiple feedback digests note low search usage relative to page views, suggesting users browse rather than search — content previews would make browsing more effective.
Acceptance Criteria
Technical Notes
- Option A (recommended): Add a stored
content_preview column to the pages table, maintained by a trigger that calls extract_text_from_lexical() and truncates to 200 chars on INSERT/UPDATE. This avoids fetching full content JSON for all pages.
- Option B: Compute previews client-side by fetching
content for visible pages. This is expensive for large workspaces and not recommended.
- Migration:
npx supabase migration new add_content_preview_column
- Update the workspace home query to include
content_preview in the SELECT
- Update
WorkspaceHomeProps type and the page list rendering in src/components/workspace-home.tsx
- The
extract_text_from_lexical function already handles Lexical JSON tree walking — reuse it in the trigger
Approval Required
This improvement was flagged as high-risk because it requires a database schema change (new column + trigger on the pages table) and modifies the data model. To approve, comment "approved" and the automation will pick it up. To reject, close the issue.
Description
The workspace home page list shows only page titles, icons, and last-modified timestamps. When multiple pages share the same title (especially "Untitled"), users cannot distinguish between them without clicking each one. Adding a single-line content preview snippet below each page title would help users identify pages at a glance, similar to how email clients show message previews.
Evidence
pagestable stores content as Lexical JSON (content jsonb). Apublic.extract_text_from_lexical(content)function already exists in the database (migration20260415111351) for search indexing. The workspace home query (src/app/(app)/[workspaceSlug]/page.tsx) currently fetchesid, title, parent_id, position, icon, is_database, created_at, updated_at— no content data.Acceptance Criteria
text-xs text-muted-foregroundstylingpnpm lint && pnpm typecheck && pnpm testpassTechnical Notes
content_previewcolumn to thepagestable, maintained by a trigger that callsextract_text_from_lexical()and truncates to 200 chars on INSERT/UPDATE. This avoids fetching full content JSON for all pages.contentfor visible pages. This is expensive for large workspaces and not recommended.npx supabase migration new add_content_preview_columncontent_previewin the SELECTWorkspaceHomePropstype and the page list rendering insrc/components/workspace-home.tsxextract_text_from_lexicalfunction already handles Lexical JSON tree walking — reuse it in the triggerApproval Required
This improvement was flagged as high-risk because it requires a database schema change (new column + trigger on the pages table) and modifies the data model. To approve, comment "approved" and the automation will pick it up. To reject, close the issue.