Repository navigation
Add Studio Explorer toolbar - #48925
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
📝 WalkthroughWalkthroughAdds reusable Explorer toolbar primitives, exported prop types, comprehensive component tests, and Studio Explorer usage guidance. ChangesExplorer Toolbar
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
🎭 Playwright Test Results (next)Details
Skipped testsFeatures › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled |
b66abef to
1071862
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/design-system/content/docs/fragments/explorer-toolbar.mdx`:
- Around line 35-58: Add the missing NotebookText, Sparkles, and Play icon
imports from lucide-react to the NotebookToolbar usage example so all referenced
components are defined and the copied snippet compiles.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: ede9a195-7dfc-41dc-8360-7f8ab97683db
⛔ Files ignored due to path filters (1)
apps/design-system/__registry__/index.tsxis excluded by!apps/design-system/__registry__/**
📒 Files selected for processing (8)
apps/design-system/config/docs.tsapps/design-system/content/docs/fragments/explorer-toolbar.mdxapps/design-system/registry/default/example/explorer-toolbar-demo.tsxapps/design-system/registry/examples.tsapps/design-system/registry/fragments.tspackages/ui-patterns/package.jsonpackages/ui-patterns/src/ExplorerToolbar/ExplorerToolbar.test.tsxpackages/ui-patterns/src/ExplorerToolbar/index.tsx
| ```tsx | ||
| import { | ||
| ExplorerToolbar, | ||
| ExplorerToolbarAction, | ||
| ExplorerToolbarActions, | ||
| ExplorerToolbarIcon, | ||
| ExplorerToolbarTitle, | ||
| } from 'ui-patterns/ExplorerToolbar' | ||
|
|
||
| export function NotebookToolbar() { | ||
| return ( | ||
| <ExplorerToolbar aria-label="Notebook toolbar"> | ||
| <ExplorerToolbarIcon> | ||
| <NotebookText /> | ||
| </ExplorerToolbarIcon> | ||
| <ExplorerToolbarTitle>Authentication health</ExplorerToolbarTitle> | ||
| <ExplorerToolbarActions> | ||
| <ExplorerToolbarAction icon={<Sparkles />}>Analyze</ExplorerToolbarAction> | ||
| <ExplorerToolbarAction aria-label="Run all cells" icon={<Play />} /> | ||
| </ExplorerToolbarActions> | ||
| </ExplorerToolbar> | ||
| ) | ||
| } | ||
| ``` |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Import the icon components in the usage example.
NotebookText, Sparkles, and Play have no bindings in this snippet. Users cannot compile the copied example. Import them from lucide-react.
Proposed fix
+import { NotebookText, Play, Sparkles } from 'lucide-react'
import {
ExplorerToolbar,
ExplorerToolbarAction,📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ```tsx | |
| import { | |
| ExplorerToolbar, | |
| ExplorerToolbarAction, | |
| ExplorerToolbarActions, | |
| ExplorerToolbarIcon, | |
| ExplorerToolbarTitle, | |
| } from 'ui-patterns/ExplorerToolbar' | |
| export function NotebookToolbar() { | |
| return ( | |
| <ExplorerToolbar aria-label="Notebook toolbar"> | |
| <ExplorerToolbarIcon> | |
| <NotebookText /> | |
| </ExplorerToolbarIcon> | |
| <ExplorerToolbarTitle>Authentication health</ExplorerToolbarTitle> | |
| <ExplorerToolbarActions> | |
| <ExplorerToolbarAction icon={<Sparkles />}>Analyze</ExplorerToolbarAction> | |
| <ExplorerToolbarAction aria-label="Run all cells" icon={<Play />} /> | |
| </ExplorerToolbarActions> | |
| </ExplorerToolbar> | |
| ) | |
| } | |
| ``` | |
| import { NotebookText, Play, Sparkles } from 'lucide-react' | |
| import { | |
| ExplorerToolbar, | |
| ExplorerToolbarAction, | |
| ExplorerToolbarActions, | |
| ExplorerToolbarIcon, | |
| ExplorerToolbarTitle, | |
| } from 'ui-patterns/ExplorerToolbar' | |
| export function NotebookToolbar() { | |
| return ( | |
| <ExplorerToolbar aria-label="Notebook toolbar"> | |
| <ExplorerToolbarIcon> | |
| <NotebookText /> | |
| </ExplorerToolbarIcon> | |
| <ExplorerToolbarTitle>Authentication health</ExplorerToolbarTitle> | |
| <ExplorerToolbarActions> | |
| <ExplorerToolbarAction icon={<Sparkles />}>Analyze</ExplorerToolbarAction> | |
| <ExplorerToolbarAction aria-label="Run all cells" icon={<Play />} /> | |
| </ExplorerToolbarActions> | |
| </ExplorerToolbar> | |
| ) | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/design-system/content/docs/fragments/explorer-toolbar.mdx` around lines
35 - 58, Add the missing NotebookText, Sparkles, and Play icon imports from
lucide-react to the NotebookToolbar usage example so all referenced components
are defined and the copied snippet compiles.
1071862 to
ad8e5a3
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@apps/studio/components/interfaces/Explorer/ExplorerToolbar/ExplorerToolbar.test.tsx`:
- Line 1: Update the test imports and all three render calls in the
ExplorerToolbar tests to use customRender from `@/tests/lib/custom-render` instead
of render. Remove the unused render import and do not add or retain addAPIMock,
since these tests make no network requests.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 01103e80-cd8d-4f55-90d9-5fb7e3a3ccd6
📒 Files selected for processing (3)
apps/studio/.claude/skills/explorer/SKILL.mdapps/studio/components/interfaces/Explorer/ExplorerToolbar/ExplorerToolbar.test.tsxapps/studio/components/interfaces/Explorer/ExplorerToolbar/index.tsx
| @@ -0,0 +1,84 @@ | |||
| import { render, screen, within } from '@testing-library/react' | |||
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
set -eu
file="apps/studio/components/interfaces/Explorer/ExplorerToolbar/ExplorerToolbar.test.tsx"
printf '%s\n' '--- test file ---'
cat -n "$file"
printf '%s\n' '--- nearby customRender/addAPIMock patterns ---'
rg -n -C 3 '\b(customRender|addAPIMock)\b' apps/studio/components/interfaces/Explorer apps/studio --glob '*.{test,spec}.{ts,tsx,js,jsx}' | head -240
printf '%s\n' '--- renderer definitions/imports ---'
rg -n '\b(customRender|addAPIMock)\b' apps/studio --glob '*.{ts,tsx,js,jsx}' | head -160Repository: supabase/supabase
Length of output: 41669
🏁 Script executed:
set -eu
printf '%s\n' '--- custom renderer and MSW setup ---'
cat -n apps/studio/tests/lib/custom-render.tsx | sed -n '1,130p'
cat -n apps/studio/tests/lib/msw.ts | sed -n '1,110p'
printf '%s\n' '--- toolbar source map and implementation ---'
ast-grep outline apps/studio/components/interfaces/Explorer/ExplorerToolbar/index.tsx
cat -n apps/studio/components/interfaces/Explorer/ExplorerToolbar/index.tsx | sed -n '1,260p'
printf '%s\n' '--- toolbar imports and test setup references ---'
rg -n -C 3 'ExplorerToolbar|`@testing-library/react`|customRender' apps/studio/components/interfaces/Explorer/ExplorerToolbar apps/studio/components/interfaces/Explorer --glob '*.{ts,tsx,js,jsx}'
rg -n -C 2 'unhandled|onUnhandledRequest|mswServer' apps/studio/tests apps/studio/vitest* apps/studio --glob '*.{ts,tsx,js,jsx}' | head -220Repository: supabase/supabase
Length of output: 50374
Use the Studio test renderer.
Replace the three render calls with customRender from @/tests/lib/custom-render. This test has no network requests, so it does not need addAPIMock.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@apps/studio/components/interfaces/Explorer/ExplorerToolbar/ExplorerToolbar.test.tsx`
at line 1, Update the test imports and all three render calls in the
ExplorerToolbar tests to use customRender from `@/tests/lib/custom-render` instead
of render. Remove the unused render import and do not add or retain addAPIMock,
since these tests make no network requests.
Sources: Coding guidelines, Learnings
## Summary Adds the Studio-owned `ExplorerQuery` shell used by notebooks, SQL snippets, dedicated query tabs, and assistant query blocks within Explorer. - provides framed embedded and full-height viewport roots - provides composable editor, results, and footer layout regions - keeps result content responsible for its own scrolling while the results region fills remaining height - remains presentational: query models, execution, source resolution, persistence, and result rendering stay external - expands the project-local Explorer agent skill with composition and sizing guidance - adds focused Studio component tests All files are scoped to `apps/studio`; this PR no longer changes `ui-patterns` or the design-system app. ## Stack - Base: #48925 - Next: #48961 - This PR targets `chore/toolbar-component`, so its review diff contains only the query shell layer. ## Validation - `pnpm --filter studio exec vitest run components/interfaces/Explorer/ExplorerQuery/ExplorerQuery.test.tsx components/interfaces/Explorer/ExplorerToolbar/ExplorerToolbar.test.tsx` — 6 tests passed - `pnpm --filter studio typecheck` - Prettier - `git diff --check`
Summary
Adds the Studio-owned
ExplorerToolbarcomposition used by Explorer notebooks, chats, SQL snippets, query cells, and tabs.--header-heightfallbackapps/studio/.claude/skills/explorer/SKILL.mdThese components are intentionally scoped to Studio under
apps/studio/components/interfaces/Explorer; this PR no longer changesui-patternsor the design-system app.Stack
masterValidation
pnpm --filter studio exec vitest run components/interfaces/Explorer/ExplorerToolbar/ExplorerToolbar.test.tsx— 3 tests passedpnpm --filter studio typecheckgit diff --checkSummary by CodeRabbit
New Features
Tests