mirror of
https://github.com/supabase/supabase.git
synced 2026-10-17 23:29:08 +03:00
* start * added panels * remove stuff * fixes and refinements * clean up * remove old assistant panel * resizable assistant kinda * use icon * Add missing package * remove canvas * add suggestions * updated empty state if no tables exist * fix table condition * Implement diffing if using assistant in sql editor * Reinstate old assistant in SQL editor if feature preview is off * pane size adjustment * assistant button corners * Add SQL snippet content to assistant if opening assistant in sql editor * Add the necessary checks for opt in and hipaa * revert adding snippet to assistant when opening assistant in sql editor * Add cmd i shortcut * Add admonitions for when disablePrompt is toggled on, and if no api key is set. Add footer note RE rate limitation * Bump ai package in packages * some fixes for backwards compability depending on feature preview toggled * Rename feature preview property for new assistant * Smol fix * Prevent SQL snippet from running until message is finished * only loading last message * fix z-index * save chat state to global state * add debug to failed ai queries * Add basic contextual invalidation * Add explain code action to SQL editor * Add link to abort ongoing queries from SqlSnippet * Update feature preview content * Fix * Fix * Fix * Te4st * Fix tests * ONly show ai button within a project * Fix PH tracking * Beef up a bit more event tracking * Rough fix to padding when assistant is open * A bit more telemetry stuff * Update prompts * fix rls editing via assistant * Update generate-v3.ts prompt to get auth schema too * Add policy satement to assistant when editing * Address all comments * fixc * Fix SqlSnippet not taking full width on larger viewports * Adjust max width --------- Co-authored-by: Saxon Fletcher <saxonafletcher@gmail.com>
69 lines
2.5 KiB
TypeScript
69 lines
2.5 KiB
TypeScript
import { useParams } from 'common'
|
|
import Link from 'next/link'
|
|
import { useRouter } from 'next/router'
|
|
|
|
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
|
|
import { useSelectedProject } from 'hooks/misc/useSelectedProject'
|
|
import { FeedbackDropdown } from '../ProjectLayout/LayoutHeader/FeedbackDropdown'
|
|
import HelpPopover from '../ProjectLayout/LayoutHeader/HelpPopover'
|
|
import NotificationsPopoverV2 from '../ProjectLayout/LayoutHeader/NotificationsPopoverV2/NotificationsPopover'
|
|
import BranchDropdown from './BranchDropdown'
|
|
import EnableBranchingButton from './EnableBranchingButton/EnableBranchingButton'
|
|
import OrganizationDropdown from './OrganizationDropdown'
|
|
import ProjectDropdown from './ProjectDropdown'
|
|
import SettingsButton from './SettingsButton'
|
|
import UserSettingsDropdown from './UserSettingsDropdown'
|
|
import AssistantButton from './AssistantButton'
|
|
|
|
// [Joshen] Just FYI this is only for Nav V2 which is still going through design iteration
|
|
// Component is not currently in use
|
|
|
|
const AppHeader = () => {
|
|
const router = useRouter()
|
|
const { ref } = useParams()
|
|
const project = useSelectedProject()
|
|
const organization = useSelectedOrganization()
|
|
|
|
const isBranchingEnabled =
|
|
project?.is_branch_enabled === true || project?.parent_project_ref !== undefined
|
|
|
|
return (
|
|
<div className="flex items-center justify-between px-4 py-1 bg-studio border-b">
|
|
<div className="flex items-center space-x-1">
|
|
<Link
|
|
href={organization !== undefined ? `/org/${organization?.slug}` : '/'}
|
|
className="block mr-3"
|
|
>
|
|
<img
|
|
src={`${router.basePath}/img/supabase-logo.svg`}
|
|
alt="Supabase"
|
|
className="mx-auto h-[40px] w-6 cursor-pointer rounded"
|
|
/>
|
|
</Link>
|
|
<OrganizationDropdown isNewNav />
|
|
{ref !== undefined && <ProjectDropdown isNewNav />}
|
|
{ref !== undefined && (
|
|
<>
|
|
{isBranchingEnabled ? <BranchDropdown isNewNav /> : <EnableBranchingButton isNewNav />}
|
|
</>
|
|
)}
|
|
</div>
|
|
|
|
<div className="flex items-center gap-4">
|
|
<div className="flex items-center gap-3">
|
|
<FeedbackDropdown />
|
|
<NotificationsPopoverV2 />
|
|
<HelpPopover />
|
|
<AssistantButton />
|
|
<SettingsButton />
|
|
</div>
|
|
<div className="flex items-center gap-3">
|
|
<UserSettingsDropdown />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default AppHeader
|