mirror of
https://github.com/supabase/supabase.git
synced 2026-10-07 18:35:07 +03:00
## Context Chats with the AI Assistant is currently stored locally on the browser and not synced across devices which caused a bit of confusion for some users when they realised they couldn't access their chat histories on different devices. (Ideal state tbh is to persist the chat conversations, but that'll need support on the BE) PR here just adds a foot note to both the chat history dropdown in the side panel + chat nav for the explorer regarding this - opting for something with a small footprint <img width="293" height="322" alt="image" src="https://github.com/user-attachments/assets/284ee0c1-16bf-432b-b473-29ee048ed4cc" /> <img width="392" height="956" alt="image" src="https://github.com/user-attachments/assets/e5eb1409-fa63-4dae-9439-86facbe41277" /> --------- Co-authored-by: Gildas Garcia <1122076+djhi@users.noreply.github.com>
Writing components
Where to create your components
- For components that declare the general structure and layout of a page:
/components/layouts/xxx
- For components that are tightly coupled to a specific interface:
/components/interfaces/xxx
- For components that are meant to be reusable across multiple pages:
/components/ui/xxx
- Note: We're gradually moving files out of the
to-be-cleanedfolder into the respective folders as we refactor
Component structure
- If a component has constants and utility methods that are tightly coupled to itself, keep them close to the component and enclose them in a folder with an
index.tsxas an entry point - Otherwise it can just be a file on its own
- For example:
-
components/ui - SampleComponentA - SampleComponentA.tsx - SampleComponentA.constants.ts - SampleComponentA.utils.ts - SampleComponentA.types.ts - index.ts - SampleComponentB.tsx
-
Template for building components
// Declare the prop types of your component
interface ComponentAProps {
sampleProp: string
}
// Name your component accordingly — use a named export, not a default export
export const ComponentA = ({ sampleProp }: ComponentAProps) => {
return <div>ComponentA: {sampleProp}</div>
}