--- name: studio-best-practices description: React and TypeScript best practices for Supabase Studio. Use when writing or reviewing Studio components — covers boolean naming, component structure, loading/error states, state management, custom hooks, event handlers, conditional rendering, performance, and TypeScript conventions. --- # Studio Best Practices Applies to `apps/studio/**/*.{ts,tsx}`. ## Boolean Naming Use descriptive prefixes — derive from existing state rather than storing separately: - `is` — state/identity: `isLoading`, `isPaused`, `isNewRecord` - `has` — possession: `hasPermission`, `hasData` - `can` — capability: `canUpdateColumns`, `canDelete` - `should` — conditional behavior: `shouldFetch`, `shouldRender` Extract complex conditions into named variables: ```tsx // ❌ inline multi-condition { !isSchemaLocked && isTableLike(selectedTable) && canUpdateColumns && !isLoading &&