From c33d255eba8ba9ff7c7a2a01a93dce80cb685708 Mon Sep 17 00:00:00 2001 From: Saxon Fletcher Date: Thu, 10 Sep 2026 15:39:21 +1000 Subject: [PATCH 1/8] chore(studio): refine assistant empty states (#50191) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit image image ## What kind of change does this PR introduce? UI refinement. ## What is the current behavior? The assistant sidebar and Explorer chat use different empty states. ## What is the new behavior? Share a centered empty state with chat-focused prompts, use-case icons, and a “Use your own agent” footer. Simplify prompt cards and align Explorer Home styling. ## Additional context Studio typecheck, targeted ESLint, and Prettier pass. E2E selectors updated; browser verification pending. Local build stopped after showing no progress during compilation. I have read CONTRIBUTING.md. ## Summary by CodeRabbit * **New Features** * Redesigned Explorer and AI Assistant onboarding with project-focused chat prompts. * Added personalized chat template icons and updated suggested actions. * Added an option to connect and use an external agent through Claude, OpenAI, or Cursor. * Improved chat composer placement and empty-chat guidance. * **Style** * Action cards now support layouts without descriptions and adjust alignment automatically. * **Tests** * Updated end-to-end coverage for the revised assistant interface. --- .../interfaces/Explorer/ExplorerHomeTab.tsx | 19 +- .../interfaces/Explorer/templates.ts | 24 --- .../components/layouts/Tabs/ActionCard.tsx | 8 +- .../AIAssistantPanel/AIAssistant.prompts.ts | 47 ++-- .../ui/AIAssistantPanel/AIOnboarding.tsx | 204 +++++------------- .../AssistantAgentHarnessFooter.tsx | 30 +++ .../ui/AIAssistantPanel/AssistantChat.tsx | 197 +++++++++-------- e2e/studio/features/assistant.spec.ts | 7 +- 8 files changed, 234 insertions(+), 302 deletions(-) create mode 100644 apps/studio/components/ui/AIAssistantPanel/AssistantAgentHarnessFooter.tsx diff --git a/apps/studio/components/interfaces/Explorer/ExplorerHomeTab.tsx b/apps/studio/components/interfaces/Explorer/ExplorerHomeTab.tsx index ef4bef56b26ba..80da4693f8129 100644 --- a/apps/studio/components/interfaces/Explorer/ExplorerHomeTab.tsx +++ b/apps/studio/components/interfaces/Explorer/ExplorerHomeTab.tsx @@ -1,9 +1,11 @@ -import { MessageSquarePlus, NotebookText, SquareCode } from 'lucide-react' +import { NotebookText, SquareCode } from 'lucide-react' import { useState } from 'react' import { useCreateChat, useCreateNotebook, useCreateQuery } from './hooks' -import { CHAT_TEMPLATES, NOTEBOOK_TEMPLATES } from './templates' +import { NOTEBOOK_TEMPLATES } from './templates' import { ActionCard } from '@/components/layouts/Tabs/ActionCard' +import { CHAT_TEMPLATES } from '@/components/ui/AIAssistantPanel/AIAssistant.prompts' +import { AssistantAgentHarnessFooter } from '@/components/ui/AIAssistantPanel/AssistantAgentHarnessFooter' import { AssistantChatForm } from '@/components/ui/AIAssistantPanel/AssistantChatForm' export const ExplorerHomeTab = () => { @@ -16,21 +18,19 @@ export const ExplorerHomeTab = () => { return (
-
-

Explore your project

-

- Ask the Assistant about your data, or begin with a new resource. -

+
+

Run SQL. Chat with your project. Create a Notebook

setValue(e.target.value)} onSubmit={(message) => createChat({ initialMessage: message })} /> +
@@ -70,9 +70,8 @@ export const ExplorerHomeTab = () => { {CHAT_TEMPLATES.map((template) => ( } + icon={} title={template.title} - description={template.description} bgColor="bg-blue-500" onClick={() => createChat({ name: template.title, initialMessage: template.initialMessage }) diff --git a/apps/studio/components/interfaces/Explorer/templates.ts b/apps/studio/components/interfaces/Explorer/templates.ts index 498f958b82417..31e33055af823 100644 --- a/apps/studio/components/interfaces/Explorer/templates.ts +++ b/apps/studio/components/interfaces/Explorer/templates.ts @@ -1,30 +1,6 @@ import { createLogCellSkeleton, createMarkdownCellSkeleton, createQueryCellSkeleton } from './utils' import type { Notebooks } from '@/types' -export type ChatTemplate = { - title: string - description: string - initialMessage: string -} - -export const CHAT_TEMPLATES: ChatTemplate[] = [ - { - title: 'Generate sample data', - description: 'Chat template', - initialMessage: 'Generate sample data for a blog with users, posts, and comments tables.', - }, - { - title: 'Set up RLS policies', - description: 'Chat template', - initialMessage: 'Create RLS policies to ensure users can only access their own data.', - }, - { - title: 'Build a notebook', - description: 'Chat template', - initialMessage: 'Build me a notebook that tracks weekly signups and active users.', - }, -] - export type NotebookTemplate = { title: string description: string diff --git a/apps/studio/components/layouts/Tabs/ActionCard.tsx b/apps/studio/components/layouts/Tabs/ActionCard.tsx index 24f4057997b00..9586bb2599a98 100644 --- a/apps/studio/components/layouts/Tabs/ActionCard.tsx +++ b/apps/studio/components/layouts/Tabs/ActionCard.tsx @@ -1,10 +1,10 @@ import type { ReactNode } from 'react' -import { Card } from 'ui' +import { Card, cn } from 'ui' export const ActionCard = (card: { icon: ReactNode title: string - description: string + description?: string bgColor: string onClick?: () => void }) => { @@ -13,7 +13,7 @@ export const ActionCard = (card: { className="grow bg-surface-100 p-3 transition-colors hover:bg-surface-200 border hover:border-default cursor-pointer" onClick={card.onClick} > -
+
@@ -21,7 +21,7 @@ export const ActionCard = (card: {

{card.title}

-

{card.description}

+ {card.description &&

{card.description}

}
diff --git a/apps/studio/components/ui/AIAssistantPanel/AIAssistant.prompts.ts b/apps/studio/components/ui/AIAssistantPanel/AIAssistant.prompts.ts index 8274e777d8e0f..b2711d99aa89c 100644 --- a/apps/studio/components/ui/AIAssistantPanel/AIAssistant.prompts.ts +++ b/apps/studio/components/ui/AIAssistantPanel/AIAssistant.prompts.ts @@ -1,42 +1,51 @@ -export const defaultPrompts = [ - { - title: 'Create a back-end', - prompt: - 'Create a messaging app with users, messages, and an edge function that uses OpenAI to summarize message threads.', - }, - { - title: 'Health check', - prompt: 'Can you check if my database and edge functions are healthy?', - }, +import { + BookOpen, + Bug, + Database, + Gauge, + NotebookText, + ShieldCheck, + type LucideIcon, +} from 'lucide-react' + +export type ChatTemplate = { + title: string + icon: LucideIcon + initialMessage: string +} + +export const CHAT_TEMPLATES: ChatTemplate[] = [ { - title: 'Query your data', - prompt: 'Give me a list of new users from the auth.users table who signed up in the past week', + title: 'Generate sample data', + icon: Database, + initialMessage: 'Generate sample data for a blog with users, posts, and comments tables.', }, { title: 'Set up RLS policies', - prompt: 'Create RLS policies to ensure users can only access their own data', + icon: ShieldCheck, + initialMessage: 'Create RLS policies to ensure users can only access their own data.', }, { - title: 'Create a function', - prompt: 'Create an edge function that summarises the contents of a table row using OpenAI', - }, - { - title: 'Generate sample data', - prompt: 'Generate sample data for a blog with users, posts, and comments tables', + title: 'Build a notebook', + icon: NotebookText, + initialMessage: 'Build me a notebook that tracks weekly signups and active users.', }, ] export const codeSnippetPrompts = [ { title: 'Explain code', + icon: BookOpen, prompt: 'Explain what this code does and how it works', }, { title: 'Improve code', + icon: Gauge, prompt: 'How can I improve this code for better performance and readability?', }, { title: 'Debug issues', + icon: Bug, prompt: 'Help me debug any potential issues with this code', }, ] diff --git a/apps/studio/components/ui/AIAssistantPanel/AIOnboarding.tsx b/apps/studio/components/ui/AIAssistantPanel/AIOnboarding.tsx index 83df5deb1a17f..74771eb8ecbcd 100644 --- a/apps/studio/components/ui/AIAssistantPanel/AIOnboarding.tsx +++ b/apps/studio/components/ui/AIAssistantPanel/AIOnboarding.tsx @@ -1,15 +1,12 @@ -import { useParams } from 'common' -import { motion } from 'framer-motion' -import { BarChart, FileText, Shield } from 'lucide-react' -import { AiIconAnimation, Button, Skeleton } from 'ui' +import { MessageSquarePlus } from 'lucide-react' +import type { ReactNode } from 'react' -import { codeSnippetPrompts, defaultPrompts } from './AIAssistant.prompts' -import { LINTER_LEVELS } from '@/components/interfaces/Linter/Linter.constants' -import { createLintSummaryPrompt } from '@/components/interfaces/Linter/Linter.utils' -import { useProjectLintsQuery, type Lint } from '@/data/lint/lint-query' +import { CHAT_TEMPLATES, codeSnippetPrompts } from './AIAssistant.prompts' +import { ActionCard } from '@/components/layouts/Tabs/ActionCard' import type { SqlSnippet } from '@/state/ai-assistant-state' interface AIOnboardingProps { + children: ReactNode sqlSnippets?: SqlSnippet[] suggestions?: { title?: string @@ -20,161 +17,64 @@ interface AIOnboardingProps { } export const AIOnboarding = ({ + children, sqlSnippets, suggestions, onValueChange, onFocusInput, }: AIOnboardingProps) => { - const prompts = suggestions?.prompts - ? suggestions.prompts.map((suggestion) => ({ - title: suggestion.label, - prompt: suggestion.description, - icon: , - })) - : sqlSnippets && sqlSnippets.length > 0 - ? codeSnippetPrompts - : defaultPrompts + const suggestionPrompts = suggestions?.prompts ?? [] + const hasSuggestions = suggestionPrompts.length > 0 + let templates = CHAT_TEMPLATES - const { ref: projectRef } = useParams() - const { data: lints, isLoading: isLoadingLints } = useProjectLintsQuery({ projectRef }) - - const errorLints: Lint[] = (lints?.filter((lint) => lint.level === LINTER_LEVELS.ERROR) ?? - []) as Lint[] - const securityErrorLints = errorLints.filter((lint) => lint.categories?.[0] === 'SECURITY') - const performanceErrorLints = errorLints.filter((lint) => lint.categories?.[0] !== 'SECURITY') + if (hasSuggestions) { + templates = suggestionPrompts.map((suggestion) => ({ + title: suggestion.label, + icon: MessageSquarePlus, + initialMessage: suggestion.description, + })) + } else if (sqlSnippets && sqlSnippets.length > 0) { + templates = codeSnippetPrompts.map((prompt) => ({ + title: prompt.title, + icon: prompt.icon, + initialMessage: prompt.prompt, + })) + } return ( -
-
-
- - How can I assist you? - - - {suggestions?.prompts?.length ? ( -
-

Suggestions

- {prompts.map((item, index) => ( - - - - ))} -
- ) : ( - <> - {isLoadingLints ? ( -
- - {Array.from({ length: 6 }).map((_, index) => ( - - ))} -
- ) : ( - <> - {performanceErrorLints.length > 0 && ( -
-

- Improve Performance -

- {performanceErrorLints.map((lint, index) => { - return ( - - ) - })} -
- )} +
+
+
+

Chat with your project

+
- {securityErrorLints.length > 0 && ( -
-

- Improve Security -

- {securityErrorLints.map((lint, index) => { - return ( - - ) - })} -
- )} + {children} -
-

Ideas

- {prompts.map((item, index) => ( - - ))} -
- - )} - +
+ {hasSuggestions && suggestions?.title && ( +

{suggestions.title}

)} -
+
+ {templates.map((template) => ( + + ))} +
+
) diff --git a/apps/studio/components/ui/AIAssistantPanel/AssistantAgentHarnessFooter.tsx b/apps/studio/components/ui/AIAssistantPanel/AssistantAgentHarnessFooter.tsx new file mode 100644 index 0000000000000..59efa660839c8 --- /dev/null +++ b/apps/studio/components/ui/AIAssistantPanel/AssistantAgentHarnessFooter.tsx @@ -0,0 +1,30 @@ +import { useTheme } from 'next-themes' +import { parseAsBoolean, parseAsString, useQueryStates } from 'nuqs' +import { ConnectionIcon } from 'ui-patterns/McpUrlBuilder/components/ConnectionIcon' + +export const AssistantAgentHarnessFooter = () => { + const { resolvedTheme } = useTheme() + const theme = resolvedTheme === 'dark' ? 'dark' : 'light' + const [, setConnectParams] = useQueryStates({ + showConnect: parseAsBoolean.withDefault(false), + connectTab: parseAsString, + }) + + return ( +
+ +
+ ) +} diff --git a/apps/studio/components/ui/AIAssistantPanel/AssistantChat.tsx b/apps/studio/components/ui/AIAssistantPanel/AssistantChat.tsx index 20a618426843a..afd612b6c0f15 100644 --- a/apps/studio/components/ui/AIAssistantPanel/AssistantChat.tsx +++ b/apps/studio/components/ui/AIAssistantPanel/AssistantChat.tsx @@ -21,6 +21,7 @@ import { resolvePendingToolApprovalsAsDenied, } from './AIAssistant.utils' import { AIOnboarding } from './AIOnboarding' +import { AssistantAgentHarnessFooter } from './AssistantAgentHarnessFooter' import { AssistantChatForm } from './AssistantChatForm' import { Conversation, @@ -445,9 +446,95 @@ export const AssistantChat = ({ } else if (isSupportChat) { placeholder = 'Describe your support issue...' } else { - placeholder = 'Chat to Postgres...' + placeholder = 'Ask about your data, troubleshoot an issue, or explore your project...' } + const composer = ( +
+
+ {isSupportChat && !isSupportChatClosed && ( +
+
+
+ + +
+
+ )} + {disablePrompts && ( + + )} + + {isSuccess && !isApiKeySet && ( + + } + /> + )} + +
+ { + setValue(e.target.value) + onInputChange?.(e.target.value) + }} + onSubmit={(finalMessage) => { + sendMessageToAssistant(finalMessage) + }} + onStop={() => { + stop() + // to save partial responses from the AI + const lastMessage = chatMessages[chatMessages.length - 1] + if (lastMessage && lastMessage.role === 'assistant') { + state.updateMessage(lastMessage, chatId) + } + }} + sqlSnippets={composerContext?.sqlSnippets} + onRemoveSnippet={(index) => { + const newSnippets = [...(composerContext?.sqlSnippets ?? [])] + newSnippets.splice(index, 1) + composerContext?.onSetSqlSnippets?.(newSnippets) + }} + includeSnippetsInMessage={includeSnippetsInMessage} + /> +
+
+
+ ) + return ( - ) : ( - setValue(val)} - onFocusInput={() => inputRef.current?.focus()} - /> - )} + ) : null} {editingMessageId && ( @@ -600,87 +679,23 @@ export const AssistantChat = ({ )} -
-
- {isSupportChat && !isSupportChatClosed && ( -
-
-
- - -
-
- )} - {disablePrompts && ( - - )} - - {isSuccess && !isApiKeySet && ( - - } - /> - )} - - { - setValue(e.target.value) - onInputChange?.(e.target.value) - }} - onSubmit={(finalMessage) => { - sendMessageToAssistant(finalMessage) - }} - onStop={() => { - stop() - // to save partial responses from the AI - const lastMessage = chatMessages[chatMessages.length - 1] - if (lastMessage && lastMessage.role === 'assistant') { - state.updateMessage(lastMessage, chatId) - } - }} - sqlSnippets={composerContext?.sqlSnippets} - onRemoveSnippet={(index) => { - const newSnippets = [...(composerContext?.sqlSnippets ?? [])] - newSnippets.splice(index, 1) - composerContext?.onSetSqlSnippets?.(newSnippets) - }} - includeSnippetsInMessage={includeSnippetsInMessage} - /> -
-
+ {hasMessages ? ( + composer + ) : ( + { + setValue(prompt) + onInputChange?.(prompt) + }} + onFocusInput={() => inputRef.current?.focus()} + > + {composer} + {!isSupportChat && } + + )}
) diff --git a/e2e/studio/features/assistant.spec.ts b/e2e/studio/features/assistant.spec.ts index c549040e53186..d510ca77c12f8 100644 --- a/e2e/studio/features/assistant.spec.ts +++ b/e2e/studio/features/assistant.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { test } from '../utils/test.js' import { toUrl } from '../utils/to-url.js' @@ -16,10 +17,12 @@ test.describe('AI Assistant', async () => { await page.locator('#assistant-trigger').click() // Wait for the assistant panel to be visible - await expect(page.getByRole('heading', { name: 'How can I assist you?' })).toBeVisible() + await expect(page.getByRole('heading', { name: 'Chat with your project' })).toBeVisible() // Type "hello" in the chat input - const chatInput = page.getByRole('textbox', { name: 'Chat to Postgres...' }) + const chatInput = page.getByRole('textbox', { + name: 'Ask about your data, troubleshoot an issue, or explore your project...', + }) await chatInput.fill('hello') const responsePromise = page.waitForResponse( From c708e1128f3d34901548168e19df39c2f5045424 Mon Sep 17 00:00:00 2001 From: Anthony Lio Date: Thu, 10 Sep 2026 09:14:42 +0300 Subject: [PATCH 2/8] fix(ui-patterns): reveal hover-only copy controls on keyboard focus (#50083) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What kind of change does this PR introduce? bug fix + a11y _ follow-up to the UI review on #50045 ## What is the current behavior? **`CodeBlock`**: the copy control lives in an `opacity-0 group-hover:opacity-100` wrapper with no focus rule, so it stays invisible when a keyboard user tabs to it, button is focusable and pressable, just not visible **`DataInputs/Input`**: same wrapper, but the parent `InputGroup` declares a *named* group (`group/input-group`), so the unnamed `group-hover:` matched nothing. With `showCopyOnHover` the button was invisible at all times, hover included. Only consumer today is the Edge Functions "Download via CLI" popover. ## What is the new behavior? ├ adds `group-focus-within:opacity-100` to `CodeBlock` | state | preview | | -------|------| | before | image | | after | image | ├ retargets both variants at the named group: `group-hover/input-group:` + `group-focus-within/input-group:` in `Input` | state | preview | | -------|------| | before | image | | after | image | ## Testing 1. visits `/docs/guides/ai-tools/plugins#manual-installation` 2. tabs into the code block ## Summary by CodeRabbit - **Accessibility Improvements** - Copy buttons in code blocks and input fields are now revealed when the component or its contents receive keyboard focus, in addition to appearing on hover. - Improved keyboard discoverability and access to copy actions. --- packages/ui-patterns/src/CodeBlock/CodeBlock.tsx | 2 +- packages/ui-patterns/src/DataInputs/Input.tsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/ui-patterns/src/CodeBlock/CodeBlock.tsx b/packages/ui-patterns/src/CodeBlock/CodeBlock.tsx index fbd3345554e51..8d41e769e0b1d 100644 --- a/packages/ui-patterns/src/CodeBlock/CodeBlock.tsx +++ b/packages/ui-patterns/src/CodeBlock/CodeBlock.tsx @@ -269,7 +269,7 @@ export const CodeBlock = ({
diff --git a/packages/ui-patterns/src/DataInputs/Input.tsx b/packages/ui-patterns/src/DataInputs/Input.tsx index 98efedae67f78..128eb19c963fe 100644 --- a/packages/ui-patterns/src/DataInputs/Input.tsx +++ b/packages/ui-patterns/src/DataInputs/Input.tsx @@ -91,7 +91,10 @@ const Input = forwardRef< } onClick={() => _onCopy(props.value)} > From 84db103ebb6dbe96ef14951265e2e54f3e1d66d4 Mon Sep 17 00:00:00 2001 From: Jordi Enric <37541088+jordienr@users.noreply.github.com> Date: Thu, 10 Sep 2026 08:51:24 +0200 Subject: [PATCH 3/8] ci(api): verify generated types against production (#49993) --- .agents/skills/api-types/SKILL.md | 27 ++++ .github/workflows/label_prs.yml | 2 +- .github/workflows/validate-pr.yml | 6 - .../workflows/verify-production-api-types.yml | 50 ++++++++ package.json | 1 + packages/api-types/package.json | 4 +- .../scripts/verify-production-types.mjs | 121 ++++++++++++++++++ .../scripts/verify-production-types.test.mjs | 87 +++++++++++++ 8 files changed, 290 insertions(+), 8 deletions(-) create mode 100644 .agents/skills/api-types/SKILL.md create mode 100644 .github/workflows/verify-production-api-types.yml create mode 100644 packages/api-types/scripts/verify-production-types.mjs create mode 100644 packages/api-types/scripts/verify-production-types.test.mjs diff --git a/.agents/skills/api-types/SKILL.md b/.agents/skills/api-types/SKILL.md new file mode 100644 index 0000000000000..3d206497a2ce7 --- /dev/null +++ b/.agents/skills/api-types/SKILL.md @@ -0,0 +1,27 @@ +--- +name: api-types +description: Maintain Supabase API types. Use when changing generated API type declarations, OpenAPI schemas, or investigating API type deployment drift. +--- + +# API types + +The generated API contract has three specs: API v1, API v2, and Platform. Their committed outputs are `packages/api-types/types/api-v1.d.ts`, `packages/api-types/types/api-v2.d.ts`, and `packages/api-types/types/platform.d.ts`. + +## Update types + +1. Make the API/schema change and ensure it is deployed to production before relying on a type PR. Production is the merge-gate source of truth. +2. Run `pnpm api:codegen` against a running local API environment. It fetches all three local OpenAPI specs and updates the committed files. +3. Inspect and commit only the intended generated type changes. +4. Run `pnpm api:verify-types`. It fetches the three production OpenAPI specs, regenerates types with the repository tooling, and compares them with the committed files. + +Complete the update only when `pnpm api:verify-types` passes after the production deployment is available. + +## Interpret verification + +- A pass means the committed generated declarations match all three production specs at the time of the check. +- A mismatch means production and the committed files differ. If the API is not deployed, deploy it and rerun the check. If production is correct, regenerate and review the changed files. +- A fetch failure means the production schema endpoint could not be read; fix or retry the endpoint before treating the result as a type mismatch. + +## Pull requests + +The `Verify production API types` CI job runs when `packages/api-types/types/**` changes and performs the same production comparison. It is currently observational, not a required merge check. The `api-deploy-required` label is informational only. Still run the local verifier before requesting review and treat a failed CI verification as production drift that must be resolved. diff --git a/.github/workflows/label_prs.yml b/.github/workflows/label_prs.yml index 9e9ac01756e90..50af84c94579e 100644 --- a/.github/workflows/label_prs.yml +++ b/.github/workflows/label_prs.yml @@ -22,5 +22,5 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, issue_number: context.issue.number, - body: 'The `api-deploy-required` label was auto-applied to this PR because it updates the API types. Ensure that the new or updated API, if any, is deployed on production before **removing the label** and merging this PR.', + body: 'The `api-deploy-required` label was auto-applied to this PR because it updates the API types. The `Verify production API types` check reports whether the committed types match production; it is currently observational and does not block merging.', }) diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml index 2ee49d84c8e90..1b10f526421d9 100644 --- a/.github/workflows/validate-pr.yml +++ b/.github/workflows/validate-pr.yml @@ -17,12 +17,6 @@ jobs: echo "PR blocked: [tag: do not merge]" exit 1 - - name: Tagged with 'api-deploy-required' - if: contains( github.event.pull_request.labels.*.name, 'api-deploy-required') - run: | - echo "PR blocked: [tag: api-deploy-required] — confirm the API is deployed in production, then remove the label." - exit 1 - - name: All good if: ${{ success() }} run: | diff --git a/.github/workflows/verify-production-api-types.yml b/.github/workflows/verify-production-api-types.yml new file mode 100644 index 0000000000000..bc99921ca89e3 --- /dev/null +++ b/.github/workflows/verify-production-api-types.yml @@ -0,0 +1,50 @@ +name: Verify production API types + +on: + pull_request: + types: [opened, reopened, synchronize] + +permissions: + contents: read + pull-requests: read + +jobs: + verify-production-api-types: + runs-on: ubuntu-latest + steps: + - id: changes + env: + GH_TOKEN: ${{ github.token }} + run: | + if gh api "repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" --paginate --jq '.[].filename' | grep -q '^packages/api-types/types/'; then + echo "api_types_changed=true" >> "$GITHUB_OUTPUT" + else + echo "api_types_changed=false" >> "$GITHUB_OUTPUT" + fi + + - name: Check out pull request + if: steps.changes.outputs.api_types_changed == 'true' + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + with: + persist-credentials: false + + - name: Install pnpm + if: steps.changes.outputs.api_types_changed == 'true' + uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 + with: + run_install: false + + - name: Set up Node.js + if: steps.changes.outputs.api_types_changed == 'true' + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + with: + node-version-file: '.nvmrc' + cache: pnpm + + - name: Install API types dependencies + if: steps.changes.outputs.api_types_changed == 'true' + run: pnpm install --frozen-lockfile --filter=api-types... + + - name: Verify production API types + if: steps.changes.outputs.api_types_changed == 'true' + run: pnpm --filter=api-types run verify-production-types diff --git a/package.json b/package.json index aa441729e0087..e1f7d90f0d27e 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "setup:cli": "supabase start -x studio && supabase status --output json > keys.json && node scripts/generateLocalEnv.js", "generate:types": "supabase gen types typescript --local > ./supabase/functions/common/database-types.ts", "api:codegen": "cd packages/api-types && pnpm run codegen", + "api:verify-types": "pnpm --filter=api-types run verify-production-types", "knip": "knip", "authorize-vercel-deploys": "tsx scripts/authorizeVercelDeploys.ts" }, diff --git a/packages/api-types/package.json b/packages/api-types/package.json index d975cab4de8c0..f230553959b1b 100644 --- a/packages/api-types/package.json +++ b/packages/api-types/package.json @@ -7,7 +7,9 @@ "scripts": { "preinstall": "npx only-allow pnpm", "clean": "rimraf .turbo tsconfig.tsbuildinfo", - "codegen": "openapi-typescript --redocly ./redocly.yaml --alphabetize --default-non-nullable=false && prettier --cache --write types/*.d.ts" + "codegen": "openapi-typescript --redocly ./redocly.yaml --alphabetize --default-non-nullable=false && prettier --cache --write types/*.d.ts", + "verify-production-types": "node ./scripts/verify-production-types.mjs", + "test": "node --test ./scripts/*.test.mjs" }, "author": "", "license": "MIT", diff --git a/packages/api-types/scripts/verify-production-types.mjs b/packages/api-types/scripts/verify-production-types.mjs new file mode 100644 index 0000000000000..308de036e7cae --- /dev/null +++ b/packages/api-types/scripts/verify-production-types.mjs @@ -0,0 +1,121 @@ +import { execFile } from 'node:child_process' +import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { dirname, join } from 'node:path' +import { fileURLToPath } from 'node:url' +import { promisify } from 'node:util' + +const run = promisify(execFile) +const packageDirectory = dirname(dirname(fileURLToPath(import.meta.url))) +const typesDirectory = process.env.API_TYPES_DIRECTORY ?? join(packageDirectory, 'types') +const platformApiUrl = + process.env.PLATFORM_API_OPENAPI_URL ?? 'https://api.supabase.com/api/platform-json' +const fetchTimeout = 30_000 + +const specifications = [ + { name: 'api-v1', url: 'https://api.supabase.com/api/v1-json' }, + { name: 'api-v2', url: 'https://api.supabase.com/api/v2-json' }, + { name: 'platform', url: platformApiUrl }, +] + +export async function fetchOpenApiSpecifications( + specifications, + { fetchImpl = fetch, writeFileImpl = writeFile, temporaryDirectory, generatedTypesDirectory } +) { + return Promise.all( + specifications.map(async ({ name, url }) => { + let response + + try { + response = await fetchImpl(url, { + signal: AbortSignal.timeout(fetchTimeout), + }) + } catch { + throw new Error(`Could not fetch ${name} OpenAPI specification from ${url}.`) + } + + if (!response.ok) { + throw new Error( + `Could not fetch ${name} OpenAPI specification from ${url}: ${response.status}.` + ) + } + + await writeFileImpl(join(temporaryDirectory, `${name}.json`), await response.text()) + + return ` ${name}:\n root: ${join(temporaryDirectory, `${name}.json`)}\n x-openapi-ts:\n output: ${join(generatedTypesDirectory, `${name}.d.ts`)}` + }) + ) +} + +export async function findMismatchedTypes( + specifications, + { readFileImpl = readFile, generatedTypesDirectory, typesDirectory } +) { + const mismatches = await Promise.all( + specifications.map(async ({ name }) => { + const filename = `${name}.d.ts` + const [generated, committed] = await Promise.all([ + readFileImpl(join(generatedTypesDirectory, filename), 'utf8'), + readFileImpl(join(typesDirectory, filename), 'utf8'), + ]) + + return generated === committed ? undefined : filename + }) + ) + + return mismatches.filter((filename) => filename !== undefined) +} + +export async function verifyProductionTypes() { + const temporaryDirectory = await mkdtemp(join(tmpdir(), 'api-types-')) + const generatedTypesDirectory = join(temporaryDirectory, 'types') + + try { + await mkdir(generatedTypesDirectory) + + const config = await fetchOpenApiSpecifications(specifications, { + temporaryDirectory, + generatedTypesDirectory, + }) + + await writeFile(join(temporaryDirectory, 'redocly.yaml'), `apis:\n${config.join('\n')}`) + await run( + 'pnpm', + [ + 'exec', + 'openapi-typescript', + '--redocly', + join(temporaryDirectory, 'redocly.yaml'), + '--alphabetize', + '--default-non-nullable=false', + ], + { cwd: packageDirectory } + ) + + await run( + 'pnpm', + [ + 'exec', + 'prettier', + '--write', + ...specifications.map(({ name }) => join(generatedTypesDirectory, `${name}.d.ts`)), + ], + { cwd: packageDirectory } + ) + + const changedTypes = await findMismatchedTypes(specifications, { + generatedTypesDirectory, + typesDirectory, + }) + + if (changedTypes.length > 0) { + throw new Error(`Committed API types do not match production: ${changedTypes.join(', ')}`) + } + } finally { + await rm(temporaryDirectory, { force: true, recursive: true }) + } +} + +if (process.argv[1] === fileURLToPath(import.meta.url)) { + await verifyProductionTypes() +} diff --git a/packages/api-types/scripts/verify-production-types.test.mjs b/packages/api-types/scripts/verify-production-types.test.mjs new file mode 100644 index 0000000000000..f2c67b2cecca2 --- /dev/null +++ b/packages/api-types/scripts/verify-production-types.test.mjs @@ -0,0 +1,87 @@ +import assert from 'node:assert/strict' +import test from 'node:test' + +import { fetchOpenApiSpecifications, findMismatchedTypes } from './verify-production-types.mjs' + +const specifications = [ + { name: 'api-v1', url: 'https://example.com/api/v1-json' }, + { name: 'platform', url: 'https://example.com/api/platform-json' }, +] + +test('writes fetched specifications and returns their Redocly configuration', async () => { + const writes = [] + const config = await fetchOpenApiSpecifications(specifications, { + temporaryDirectory: '/tmp/api-types', + generatedTypesDirectory: '/tmp/api-types/types', + fetchImpl: async (url) => ({ + ok: true, + text: async () => `OpenAPI specification from ${url}`, + }), + writeFileImpl: async (path, content) => writes.push({ path, content }), + }) + + assert.deepEqual(writes, [ + { + path: '/tmp/api-types/api-v1.json', + content: 'OpenAPI specification from https://example.com/api/v1-json', + }, + { + path: '/tmp/api-types/platform.json', + content: 'OpenAPI specification from https://example.com/api/platform-json', + }, + ]) + assert.deepEqual(config, [ + ' api-v1:\n root: /tmp/api-types/api-v1.json\n x-openapi-ts:\n output: /tmp/api-types/types/api-v1.d.ts', + ' platform:\n root: /tmp/api-types/platform.json\n x-openapi-ts:\n output: /tmp/api-types/types/platform.d.ts', + ]) +}) + +test('returns no mismatches when generated types match committed types', async () => { + const mismatches = await findMismatchedTypes(specifications, { + generatedTypesDirectory: '/generated', + typesDirectory: '/committed', + readFileImpl: async (path) => + path.includes('/generated/') ? 'generated type' : 'generated type', + }) + + assert.deepEqual(mismatches, []) +}) + +test('reports every generated type that differs from its committed counterpart', async () => { + const mismatches = await findMismatchedTypes(specifications, { + generatedTypesDirectory: '/generated', + typesDirectory: '/committed', + readFileImpl: async (path) => { + if (path.endsWith('api-v1.d.ts')) return 'matching type' + return path.includes('/generated/') ? 'new platform type' : 'committed platform type' + }, + }) + + assert.deepEqual(mismatches, ['platform.d.ts']) +}) + +test('rejects unsuccessful OpenAPI responses', async () => { + await assert.rejects( + fetchOpenApiSpecifications([specifications[0]], { + temporaryDirectory: '/tmp/api-types', + generatedTypesDirectory: '/tmp/api-types/types', + fetchImpl: async () => ({ ok: false, status: 503 }), + writeFileImpl: async () => assert.fail('does not write an unsuccessful response'), + }), + /Could not fetch api-v1 OpenAPI specification from https:\/\/example\.com\/api\/v1-json: 503\./ + ) +}) + +test('rejects failed OpenAPI requests', async () => { + await assert.rejects( + fetchOpenApiSpecifications([specifications[0]], { + temporaryDirectory: '/tmp/api-types', + generatedTypesDirectory: '/tmp/api-types/types', + fetchImpl: async () => { + throw new Error('network unavailable') + }, + writeFileImpl: async () => assert.fail('does not write a failed response'), + }), + /Could not fetch api-v1 OpenAPI specification from https:\/\/example\.com\/api\/v1-json\./ + ) +}) From b8b92fe5661dffeb58b66910d6e63373d01e945a Mon Sep 17 00:00:00 2001 From: Anthony Lio Date: Thu, 10 Sep 2026 10:15:30 +0300 Subject: [PATCH 4/8] fix(www): careers page error (#50185) ## What kind of change does this PR introduce? bug fix careers page on anchor link click ## What is the current behavior? on `/careers`, clicking "open positions", scrolling down and back up, then clicking it again crashes the page ## What is the new behavior? destructuring defaults on the page props, so an empty-props render is harmless instead of fatal _ prefetch still returns `{}`, but the sequence now renders normally instead of throwin ## Summary by CodeRabbit * **Bug Fixes** * Improved the careers page so it renders correctly when job listings, placeholder job details, or contributor information are unavailable. --- apps/www/pages/careers.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/www/pages/careers.tsx b/apps/www/pages/careers.tsx index b1788318a1215..5ba598e4b9330 100644 --- a/apps/www/pages/careers.tsx +++ b/apps/www/pages/careers.tsx @@ -96,7 +96,11 @@ interface CareersPageProps { contributors: { login: string; avatar_url: string; html_url: string }[] } -const CareerPage = ({ jobs, placeholderJob, contributors }: CareersPageProps) => { +const CareerPage = ({ + jobs = {}, + placeholderJob = null, + contributors = [], +}: Partial) => { const { basePath } = useRouter() const { jobsCount } = staticContent From d9742d707f51e998e60037175d7310c6f6ba60d6 Mon Sep 17 00:00:00 2001 From: Saxon Fletcher Date: Thu, 10 Sep 2026 17:38:19 +1000 Subject: [PATCH 5/8] chore(studio): refine Explorer sidebar breadcrumbs (#50188) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moves Explorer’s back navigation and create actions into a reusable sidebar breadcrumb header. Reduces product-menu headings globally to `text-sm` and keeps breadcrumb links free of padding, borders, and backgrounds. ### How to test 1. Open `/project//explorer` and confirm the header shows Explorer and the SQL Editor switch action. 2. Open Notebooks and Chats. Confirm the header shows `Explorer > Notebooks/Chats` and the corresponding create action works. 3. Return using the Explorer breadcrumb with a click or Tab + Enter. Check that the label stays aligned and has no hover background. 4. Open another product, such as Database, and confirm its sidebar heading uses the smaller font size. 5. At a mobile viewport, open the menu and repeat the notebook/chat actions and back navigation without closing the sheet. Confirm the header stays current and disappears when returning to the main menu or opening another product. Validation: 18 focused tests, typecheck, formatting, and lint ratchet passed. ## Summary by CodeRabbit - **New Features** - Added a shared Explorer sidebar header with breadcrumbs and contextual actions for creating notebooks and chats. - Added keyboard-accessible navigation between the Explorer overview and notebook or chat sections. - Added support for customized product menu headers across project layouts. - **Improvements** - Centralized Explorer navigation and actions in the shared sidebar layout. - Improved mobile menu updates when navigating between Explorer resources. - Refined Explorer home layout and drag-handle behavior across screen sizes. --------- Co-authored-by: Joshen Lim --- .../interfaces/Explorer/ExplorerHomeTab.tsx | 118 ++++++++++-------- .../interfaces/Explorer/MarkdownCell.tsx | 2 +- .../interfaces/Explorer/QueryCell/index.tsx | 2 +- .../ExplorerLayout.constants.tsx | 33 +---- .../layouts/ExplorerLayout/ExplorerLayout.tsx | 17 +-- .../ExplorerLayout/ExplorerNavChats.test.tsx | 2 +- .../ExplorerLayout/ExplorerNavChats.tsx | 4 +- .../ExplorerLayout/ExplorerNavHeader.test.tsx | 85 +++++++++++++ .../ExplorerLayout/ExplorerNavHeader.tsx | 48 +++++++ .../ExplorerLayout/ExplorerNavNotebooks.tsx | 9 +- .../layouts/Navigation/ProductMenuBar.tsx | 20 ++- .../layouts/Navigation/SidebarBreadcrumb.tsx | 60 +++++++++ .../MobileMenuContent.test.tsx | 115 +++++++++++++++++ .../MobileMenuContent/MobileMenuContent.tsx | 17 ++- .../layouts/ProjectLayout/index.test.tsx | 87 ++++++++++++- .../layouts/ProjectLayout/index.tsx | 50 ++++++-- 16 files changed, 544 insertions(+), 125 deletions(-) create mode 100644 apps/studio/components/layouts/ExplorerLayout/ExplorerNavHeader.test.tsx create mode 100644 apps/studio/components/layouts/ExplorerLayout/ExplorerNavHeader.tsx create mode 100644 apps/studio/components/layouts/Navigation/SidebarBreadcrumb.tsx create mode 100644 apps/studio/components/layouts/ProjectLayout/LayoutHeader/MobileMenuContent/MobileMenuContent.test.tsx diff --git a/apps/studio/components/interfaces/Explorer/ExplorerHomeTab.tsx b/apps/studio/components/interfaces/Explorer/ExplorerHomeTab.tsx index 80da4693f8129..5deb147d84c48 100644 --- a/apps/studio/components/interfaces/Explorer/ExplorerHomeTab.tsx +++ b/apps/studio/components/interfaces/Explorer/ExplorerHomeTab.tsx @@ -1,5 +1,6 @@ import { NotebookText, SquareCode } from 'lucide-react' import { useState } from 'react' +import { cn } from 'ui' import { useCreateChat, useCreateNotebook, useCreateQuery } from './hooks' import { NOTEBOOK_TEMPLATES } from './templates' @@ -16,70 +17,77 @@ export const ExplorerHomeTab = () => { const [value, setValue] = useState('') return ( -
-
-
-

Run SQL. Chat with your project. Create a Notebook

-
- - setValue(e.target.value)} - onSubmit={(message) => createChat({ initialMessage: message })} - /> - - -
-
- } - title="Run SQL" - description="Write and run an ad-hoc query" - bgColor="bg-blue-500" - onClick={() => createQuery()} - /> - } - title="Create a notebook" - description="Combine notes, queries, and results" - bgColor="bg-blue-500" - onClick={() => createNotebook()} - /> +
+
+
+
+

Run SQL. Chat with your project. Create a Notebook

-
-
-

Start with a template

+ setValue(e.target.value)} + onSubmit={(message) => createChat({ initialMessage: message })} + /> + -
- {NOTEBOOK_TEMPLATES.map((template) => ( +
+
} - title={template.title} - description={template.description} + icon={} + title="Run SQL" + description="Write and run an ad-hoc query" bgColor="bg-blue-500" - onClick={() => - createNotebook({ name: template.title, cells: template.buildCells() }) - } + onClick={() => createQuery()} /> - ))} - {CHAT_TEMPLATES.map((template) => ( } - title={template.title} + icon={} + title="Create a notebook" + description="Combine notes, queries, and results" bgColor="bg-blue-500" - onClick={() => - createChat({ name: template.title, initialMessage: template.initialMessage }) - } + onClick={() => createNotebook()} /> - ))} -
-
+
+
+ +
+

Start with a template

+ +
+ {NOTEBOOK_TEMPLATES.map((template) => ( + } + title={template.title} + description={template.description} + bgColor="bg-blue-500" + onClick={() => + createNotebook({ name: template.title, cells: template.buildCells() }) + } + /> + ))} + {CHAT_TEMPLATES.map((template) => ( + } + title={template.title} + bgColor="bg-blue-500" + onClick={() => + createChat({ name: template.title, initialMessage: template.initialMessage }) + } + /> + ))} +
+
+
) diff --git a/apps/studio/components/interfaces/Explorer/MarkdownCell.tsx b/apps/studio/components/interfaces/Explorer/MarkdownCell.tsx index c2629d153bf5b..42319c09ea44f 100644 --- a/apps/studio/components/interfaces/Explorer/MarkdownCell.tsx +++ b/apps/studio/components/interfaces/Explorer/MarkdownCell.tsx @@ -55,7 +55,7 @@ export const MarkdownCell = ({ cell, onEdit }: MarkdownCellProps) => { id={cell._id} actions={} gripDropdownContent={} - gripClassName="mt-1.5 opacity-0 group-hover:opacity-100 has-[[data-state=open]]:opacity-100 transition" + gripClassName="mt-1.5 sm:opacity-0 group-hover:opacity-100 has-[[data-state=open]]:opacity-100 transition" > {isEditing ? (
(function id={cell._id} actions={} gripDropdownContent={} - gripClassName="mt-2 opacity-0 group-hover:opacity-100 has-[[data-state=open]]:opacity-100 transition" + gripClassName="mt-2 sm:opacity-0 group-hover:opacity-100 has-[[data-state=open]]:opacity-100 transition" > void - onBack: () => void }>) => { - const { createNotebook } = useCreateNotebook() - const { createChat } = useCreateChat() const searchPlaceholder = EXPLORER_SECTIONS.find((x) => x.type === type)?.searchPlaceholder return ( @@ -65,15 +58,7 @@ export const ExplorerNavResourceWrapper = ({ transition={LEVEL_TRANSITION} className={cn('absolute inset-0 flex flex-col', className)} > -
-
)} -
+ {hasCurrentProductHeader && ( + {currentProductMenuHeader} + )} +
{viewLevel === 'top' && ( )} {viewLevel === 'section' && sectionKeyToShow && ( -
+
{sectionKeyToShow === currentSectionKey && currentProductMenu ? ( currentProductMenu ) : SectionMenuContent ? ( diff --git a/apps/studio/components/layouts/ProjectLayout/index.test.tsx b/apps/studio/components/layouts/ProjectLayout/index.test.tsx index 13090a00efd85..8c2f1e165e7de 100644 --- a/apps/studio/components/layouts/ProjectLayout/index.test.tsx +++ b/apps/studio/components/layouts/ProjectLayout/index.test.tsx @@ -1,10 +1,11 @@ -import { render, screen, waitFor } from '@testing-library/react' +import { fireEvent, render, screen, waitFor } from '@testing-library/react' import { LOCAL_STORAGE_KEYS } from 'common' -import type { ReactNode } from 'react' +import { useState, type ReactNode } from 'react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { MobileSheetProvider } from '../Navigation/NavigationBar/MobileSheetContext' +import { MobileSheetProvider, useMobileSheet } from '../Navigation/NavigationBar/MobileSheetContext' import { ProjectLayout } from './index' +import type { MobileMenuContentProps } from './LayoutHeader/MobileMenuContent' import { STUDIO_PAGE_TITLE_SEPARATOR } from '@/lib/page-title' const { mockRouter, mockSetSelectedDatabaseId, mockSetMobileMenuOpen } = vi.hoisted(() => ({ @@ -226,6 +227,67 @@ vi.mock('@/state/database-selector', () => ({ }), })) +vi.mock('./LayoutHeader/MobileMenuContent', async (importOriginal) => { + const actual = await importOriginal() + return { + ...actual, + MobileMenuContent: ({ + currentProductMenuHeader, + currentProductMenu, + }: MobileMenuContentProps) => ( +
+ {currentProductMenuHeader} + {currentProductMenu} +
+ ), + } +}) + +vi.mock('../Navigation/ProductMenuBar', () => ({ + ProductMenuBar: () => null, +})) + +const MobileSheetHarness = () => { + const { content, openMenu, setContent } = useMobileSheet() + return ( + <> + + +
{content}
+ + ) +} + +const ResourceMenuHarness = () => { + const [section, setSection] = useState('Explorer') + return ( + <> + + {section} header} + productMenu={ + + } + > +
+ + + ) +} + const renderLayout = () => render( @@ -261,6 +323,25 @@ describe('ProjectLayout title', () => { document.title = '' }) + it('updates the open mobile menu when resource navigation changes without replacing other sheets', () => { + render( + + + + + ) + expect(screen.getByTestId('mobile-sheet')).toBeEmptyDOMElement() + fireEvent.click(screen.getByRole('button', { name: 'Open menu' })) + expect(screen.getByText('Explorer header')).toBeInTheDocument() + fireEvent.click(screen.getByRole('button', { name: 'Open notebooks' })) + expect(screen.getByText('Notebooks header')).toBeInTheDocument() + fireEvent.click(screen.getByRole('button', { name: 'Return to Explorer' })) + expect(screen.getByText('Explorer header')).toBeInTheDocument() + fireEvent.click(screen.getByRole('button', { name: 'Open other sheet' })) + fireEvent.click(screen.getByRole('button', { name: 'Change section' })) + expect(screen.getByTestId('mobile-sheet')).toHaveTextContent('Other sheet') + }) + it('sets a composed document title and deduplicates identical section/surface labels', async () => { render( diff --git a/apps/studio/components/layouts/ProjectLayout/index.tsx b/apps/studio/components/layouts/ProjectLayout/index.tsx index d03fe84dd624f..764e0f23bceff 100644 --- a/apps/studio/components/layouts/ProjectLayout/index.tsx +++ b/apps/studio/components/layouts/ProjectLayout/index.tsx @@ -6,8 +6,10 @@ import { useRouter } from 'next/router' import { forwardRef, Fragment, + isValidElement, useEffect, useLayoutEffect, + useRef, type PropsWithChildren, type ReactNode, } from 'react' @@ -107,6 +109,7 @@ export interface ProjectLayoutProps { isBlocking?: boolean product?: string productMenuBadge?: ReactNode + productMenuHeader?: ReactNode productMenu?: ReactNode browserTitle?: { entity?: string @@ -126,6 +129,7 @@ export const ProjectLayout = forwardRef { - const unregister = registerOpenMenu(() => { - setMobileSheetContent( - setMobileSheetContent(null)} - /> - ) - }) + mobileSheetContentRef.current = mobileSheetContent + }, [mobileSheetContent]) + + useLayoutEffect(() => { + const menu = ( + setMobileSheetContent(null)} + /> + ) + const unregister = registerOpenMenu(() => setMobileSheetContent(menu)) + // Keep resource navigation in an already open sheet in sync with the layout. + const currentContent = mobileSheetContentRef.current + if (isValidElement(currentContent) && currentContent.type === MobileMenuContent) { + setMobileSheetContent(menu) + } return unregister - }, [registerOpenMenu, productMenu, product, currentSectionKey, setMobileSheetContent]) + }, [ + registerOpenMenu, + productMenu, + productMenuHeader, + product, + currentSectionKey, + setMobileSheetContent, + ]) useLayoutEffect(() => { mainScrollContainer?.scrollTo({ top: 0, left: 0 }) @@ -304,6 +329,7 @@ export const ProjectLayout = forwardRef {productMenu} From e6bd407e8801cb37b34ab6cc11feb23f88959366 Mon Sep 17 00:00:00 2001 From: Anthony Lio Date: Thu, 10 Sep 2026 10:54:21 +0300 Subject: [PATCH 6/8] fix(docs): collapsible details component (#50065) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What kind of change does this PR introduce? nitpick ui bug fix in docs of the collapsible details component + commentary ## What is the current behavior? 1. data / response / notes collapsibles on reference pages grow taller when you expand them + also get double padding: the panel pads the content, and the code block pads itself again inside it 2. commentary that follows a snippet in the example column renders unstyled, since that column has no prose context. it comes out larger than the description column and inline code stays as plain text ## What is the new behavior? ├ adds `CodeBlock` a `compact` variant that get appropriate styling when used within collapsible | state | preview | | -------|------| | before |