Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ const InfrastructureInfo = () => {
</AlertDescription_Shadcn_>
</Alert_Shadcn_>
)}
{/* TODO(bobbie): once extension_dependent_objects is removed on the backend, remove this block and the ts-ignores below */}
{!data?.eligible && (data?.extension_dependent_objects || []).length > 0 && (
<Alert_Shadcn_
variant="warning"
Expand Down Expand Up @@ -222,7 +223,6 @@ const InfrastructureInfo = () => {
? 'These extensions are not supported in newer versions of Supabase Postgres. If you are not using them, it is safe to remove them.'
: 'Check the docs for which ones might need to be removed.'}
</p>

<div>
<Button size="tiny" type="default" asChild>
<a
Expand All @@ -237,6 +237,93 @@ const InfrastructureInfo = () => {
</AlertDescription_Shadcn_>
</Alert_Shadcn_>
)}
{!data?.eligible &&
// @ts-ignore
(data?.objects_to_be_dropped || []).length > 0 && (
<Alert_Shadcn_
variant="warning"
title="A new version of Postgres is available for your project"
>
<AlertTitle_Shadcn_>
A new version of Postgres is available
</AlertTitle_Shadcn_>
<AlertDescription_Shadcn_ className="flex flex-col gap-3">
<div>
<p className="mb-1">
You'll need to remove the following objects before upgrading:
</p>

<ul className="pl-4">
{
// @ts-ignore
(data?.objects_to_be_dropped || []).map((obj: string) => (
<li className="list-disc" key={obj}>
{obj}
</li>
))
}
</ul>
</div>
<p>Check the docs for which objects need to be removed.</p>
<div>
<Button size="tiny" type="default" asChild>
<a
href="https://supabase.com/docs/guides/platform/upgrading#extensions"
target="_blank"
rel="noreferrer"
>
View docs
</a>
</Button>
</div>
</AlertDescription_Shadcn_>
</Alert_Shadcn_>
)}
{!data?.eligible &&
// @ts-ignore
(data?.unsupported_extensions || []).length > 0 && (
<Alert_Shadcn_
variant="warning"
title="A new version of Postgres is available for your project"
>
<AlertTitle_Shadcn_>
A new version of Postgres is available
</AlertTitle_Shadcn_>
<AlertDescription_Shadcn_ className="flex flex-col gap-3">
<div>
<p className="mb-1">
You'll need to remove the following extensions before upgrading:
</p>

<ul className="pl-4">
{
// @ts-ignore
(data?.unsupported_extensions || []).map((obj: string) => (
<li className="list-disc" key={obj}>
{obj}
</li>
))
}
</ul>
</div>
<p>
These extensions are not supported in newer versions of Supabase
Postgres. If you are not using them, it is safe to remove them.
</p>
<div>
<Button size="tiny" type="default" asChild>
<a
href="https://supabase.com/docs/guides/platform/upgrading#extensions"
target="_blank"
rel="noreferrer"
>
View docs
</a>
</Button>
</div>
</AlertDescription_Shadcn_>
</Alert_Shadcn_>
)}
</>
)}
</>
Expand Down
8 changes: 4 additions & 4 deletions packages/ai-commands/src/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ export async function clippy(

const [{ embedding }] = embeddingResponse.data

const { error: matchError, data: pageSections } = await supabaseClient
const { error: matchError, data: pageSections } = (await supabaseClient
.rpc('match_page_sections_v2', {
embedding,
match_threshold: 0.78,
min_content_length: 50,
})
.neq('rag_ignore', true)
.select('content,page!inner(path),rag_ignore')
.limit(10) as { error: any; data: PageSection[] | null }
.limit(10)) as { error: any; data: PageSection[] | null }

if (matchError || !pageSections) {
throw new ApplicationError('Failed to match page sections', matchError)
Expand All @@ -93,10 +93,10 @@ export async function clippy(
}

const pagePath = pageSection.page.path

// Include source reference with each section
contextText += `[Source ${sourceIndex}: ${pagePath}]\n${content.trim()}\n---\n`

// Track sources for later reference
if (!sourcesMap.has(pagePath)) {
sourcesMap.set(pagePath, content)
Expand Down
7 changes: 6 additions & 1 deletion packages/ui-patterns/src/CommandMenu/prepackaged/ai/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ interface FinalizeWithSourcesAction {
index: number
}

type MessageAction = NewMessageAction | UpdateMessageAction | AppendContentAction | ResetAction | FinalizeWithSourcesAction
type MessageAction =
| NewMessageAction
| UpdateMessageAction
| AppendContentAction
| ResetAction
| FinalizeWithSourcesAction

export { MessageRole, MessageStatus }
export type { Message, MessageAction, SourceLink }
Loading