Add a new feature gated behind Pro Mode (dump-pro-mode localStorage preference).
Steps
Implement the feature — gate it behind the
proModeboolean:- In Canvas.tsx:
const [proMode] = useLocalStorage(PRO_MODE_STORAGE_KEY, false);(already exists) - In other components:
const [proMode] = useLocalStorage(PRO_MODE_STORAGE_KEY, false);with importimport { PRO_MODE_STORAGE_KEY } from "@/lib/chat-providers";andimport { useLocalStorage } from "@/hooks/useLocalStorage"; - Wrap the feature's UI with
{proMode && ( ... )}
- In Canvas.tsx:
Add to the welcome dialog in
src/components/canvas/Canvas.tsx:- Find the
Pro Mode Enableddialog (search forproWelcomeOpen) - Add a new entry to the features array with
{ icon: IconName, label: "Short name", desc: "One-line description" } - Import the lucide icon if not already imported
- Find the
Document on the help page at
src/app/help/pro-mode/page.tsx:- Add a new entry to the
PRO_FEATURESarray with:icon: lucide-react icon componenttitle: feature name (2-4 words)description: 1-2 sentences explaining the featurecolor: one ofblue,violet,green,orange,indigo,amber— pick one not already heavily used, or add a new color toCOLOR_MAP
- Import the icon from lucide-react if not already imported
- Add a new entry to the
Key files
src/lib/chat-providers.ts—PRO_MODE_STORAGE_KEYconstantsrc/components/canvas/Canvas.tsx— pro mode toggle, welcome dialog, canvas featuressrc/components/board/BoardSettings.tsx— board settings (context type, system prompt, RSS)src/components/board/ChatButton.tsx— AI chat prompt dialogsrc/app/b/[boardId]/page.tsx— board page (view switcher)src/app/help/pro-mode/page.tsx— help page listing all pro features
Style guide
- Keep welcome dialog entries concise: label (2-4 words) + desc (under 60 chars)
- Help page descriptions: 1-2 full sentences explaining what the feature does
- Always gate behind
proMode— never show pro features by default - Use existing patterns:
useLocalStoragefor reading the preference, lucide icons for UI