Skip to content

Add Studio Explorer toolbar - #48925

Merged
SaxonF merged 1 commit into
masterfrom
chore/toolbar-component
Aug 12, 2026
Merged

SaxonF merged 1 commit into
masterfrom
chore/toolbar-component

Conversation

@SaxonF

@SaxonF SaxonF commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the Studio-owned ExplorerToolbar composition used by Explorer notebooks, chats, SQL snippets, query cells, and tabs.

  • provides icon, title, actions, and compact action-button slots
  • follows Studio's 40px header sizing with a --header-height fallback
  • keeps resource-specific state and behavior in the consuming Explorer surface
  • adds focused Studio component tests
  • adds project-local agent guidance at apps/studio/.claude/skills/explorer/SKILL.md

These components are intentionally scoped to Studio under apps/studio/components/interfaces/Explorer; this PR no longer changes ui-patterns or the design-system app.

Stack

Validation

  • pnpm --filter studio exec vitest run components/interfaces/Explorer/ExplorerToolbar/ExplorerToolbar.test.tsx — 3 tests passed
  • pnpm --filter studio typecheck
  • Prettier
  • git diff --check

Summary by CodeRabbit

  • New Features

    • Added shared Explorer toolbar components for icons, titles, actions, custom controls, and compact buttons.
    • Added accessibility defaults, configurable toolbar sizing, ref forwarding, and native property support.
    • Added documentation covering Explorer component usage, composition, sizing, actions, state ownership, and extensions.
  • Tests

    • Added comprehensive coverage for toolbar composition, styling, accessibility, refs, and configurable behavior.

@vercel

vercel Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
studio-self-hosted Ready Ready Preview Aug 12, 2026 3:12am
studio-staging Ready Ready Preview Aug 12, 2026 3:12am
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Aug 12, 2026 3:12am
design-system Skipped Skipped Aug 12, 2026 3:12am
docs Skipped Skipped Aug 12, 2026 3:12am
ui-library Skipped Skipped Aug 12, 2026 3:12am
zone-www-dot-com Skipped Skipped Aug 12, 2026 3:12am

Request Review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds reusable Explorer toolbar primitives, exported prop types, comprehensive component tests, and Studio Explorer usage guidance.

Changes

Explorer Toolbar

Layer / File(s) Summary
Toolbar components and public API
apps/studio/components/interfaces/Explorer/ExplorerToolbar/index.tsx
Adds the toolbar container, icon, title, actions region, and compact action button with forwarded props, refs, accessibility defaults, slot markers, and exported types.
Toolbar behavior validation
apps/studio/components/interfaces/Explorer/ExplorerToolbar/ExplorerToolbar.test.tsx
Tests composition, accessibility, styling, custom controls, prop forwarding, refs, action sizing, and configurable toolbar height.
Explorer usage conventions
apps/studio/.claude/skills/explorer/SKILL.md
Documents Explorer component locations, toolbar composition, sizing, action behavior, state ownership, and extension conventions.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: jordienr, charislam

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the implementation and validation, but it omits the required CONTRIBUTING acknowledgment and several template sections. Add the required CONTRIBUTING acknowledgment and explicitly document the change type, current behavior, new behavior, and additional context using the repository template.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main change: adding the Studio Explorer toolbar.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/toolbar-component

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@supabase

supabase Bot commented Aug 11, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@github-actions

github-actions Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results (next)

passed  243 passed
skipped  5 skipped

Details

stats  248 tests across 29 suites
duration  4 minutes, 3 seconds
commit  ad8e5a3

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@SaxonF
SaxonF marked this pull request as ready for review August 11, 2026 22:08
@SaxonF
SaxonF requested a review from a team as a code owner August 11, 2026 22:08
@SaxonF
SaxonF force-pushed the chore/toolbar-component branch from b66abef to 1071862 Compare August 11, 2026 22:08

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6d3a4bc and 1071862.

⛔ Files ignored due to path filters (1)
  • apps/design-system/__registry__/index.tsx is excluded by !apps/design-system/__registry__/**
📒 Files selected for processing (8)
  • apps/design-system/config/docs.ts
  • apps/design-system/content/docs/fragments/explorer-toolbar.mdx
  • apps/design-system/registry/default/example/explorer-toolbar-demo.tsx
  • apps/design-system/registry/examples.ts
  • apps/design-system/registry/fragments.ts
  • packages/ui-patterns/package.json
  • packages/ui-patterns/src/ExplorerToolbar/ExplorerToolbar.test.tsx
  • packages/ui-patterns/src/ExplorerToolbar/index.tsx

Comment on lines +35 to +58
```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>
)
}
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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.

Suggested change
```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.

@dnywh dnywh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested deploy preview.

@SaxonF
SaxonF force-pushed the chore/toolbar-component branch from 1071862 to ad8e5a3 Compare August 12, 2026 03:06
@SaxonF
SaxonF requested a review from a team as a code owner August 12, 2026 03:06
@SaxonF SaxonF changed the title Add Explorer toolbar pattern Add Studio Explorer toolbar Aug 12, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1071862 and ad8e5a3.

📒 Files selected for processing (3)
  • apps/studio/.claude/skills/explorer/SKILL.md
  • apps/studio/components/interfaces/Explorer/ExplorerToolbar/ExplorerToolbar.test.tsx
  • apps/studio/components/interfaces/Explorer/ExplorerToolbar/index.tsx

@@ -0,0 +1,84 @@
import { render, screen, within } from '@testing-library/react'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 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 -160

Repository: 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 -220

Repository: 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

@SaxonF
SaxonF merged commit fb80d8c into master Aug 12, 2026
41 checks passed
@SaxonF
SaxonF deleted the chore/toolbar-component branch August 12, 2026 03:21
SaxonF added a commit that referenced this pull request Aug 12, 2026
## 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`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants