Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
📝 WalkthroughWalkthroughThe AI assistant gains shared maximization state, a keyboard shortcut, dynamic header controls, and layout integration that collapses or restores the resizable content panel. ChangesAI assistant maximization
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant AIAssistantHeader
participant SidebarManagerState
participant DefaultLayout
participant ResizablePanel
AIAssistantHeader->>SidebarManagerState: Toggle maximization
SidebarManagerState-->>DefaultLayout: Publish isMaximised
DefaultLayout->>ResizablePanel: Collapse or restore content width
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
apps/studio/components/layouts/ProjectLayout/LayoutSidebar/index.tsx (1)
1-4: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove unused imports.
usePreviousandusePanelRefare imported but not used within this file.♻️ Proposed fix
-import { usePrevious } from '`@uidotdev/usehooks`' import { useBreakpoint } from 'common' import { useEffect } from 'react' -import { cn, ResizableHandle, ResizablePanel, usePanelRef } from 'ui' +import { cn, ResizableHandle, ResizablePanel } from 'ui'🤖 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/layouts/ProjectLayout/LayoutSidebar/index.tsx` around lines 1 - 4, Remove the unused usePrevious import from `@uidotdev/usehooks` and usePanelRef from the ui import in LayoutSidebar, while preserving the remaining imports and behavior.
🤖 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/layouts/DefaultLayout.tsx`:
- Around line 71-79: Update the resize call in the isMaximised effect to pass
contentMaxSizePercentage directly as a number instead of formatting it as a
percentage string. Leave the collapse behavior and effect dependencies
unchanged.
In `@apps/studio/state/sidebar-manager-state.tsx`:
- Around line 123-125: Reset isMaximised whenever the active sidebar changes,
not only in toggleSidebar. Update openSidebar and the closeSidebar/closeActive
paths to clear maximization when the AI Assistant is closed or another sidebar
is opened, preferably by reusing a centralized active-sidebar transition helper
while preserving existing sidebar behavior.
---
Nitpick comments:
In `@apps/studio/components/layouts/ProjectLayout/LayoutSidebar/index.tsx`:
- Around line 1-4: Remove the unused usePrevious import from `@uidotdev/usehooks`
and usePanelRef from the ui import in LayoutSidebar, while preserving the
remaining imports and behavior.
🪄 Autofix (Beta)
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
Run ID: fc2fb525-afb6-4712-a9e7-2a36c101fb1c
📒 Files selected for processing (5)
apps/studio/components/layouts/DefaultLayout.tsxapps/studio/components/layouts/ProjectLayout/LayoutSidebar/index.tsxapps/studio/components/ui/AIAssistantPanel/AIAssistantHeader.tsxapps/studio/state/shortcuts/registry.tsapps/studio/state/sidebar-manager-state.tsx
🎭 Playwright Test Results (next)Details
Flaky testsFeatures › database.spec.ts › Database › Schema Visualizer › table actions work as expected Skipped testsFeatures › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/studio/components/layouts/DefaultLayout.tsx (1)
74-81: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winRestore the previous panel size on exit. In
apps/studio/components/layouts/DefaultLayout.tsx:74-81,resize(\${contentMaxSizePercentage}%`)overwrites any user-adjusted width whenever maximization ends oractiveSidebarchanges. Useexpand()` or persist the last non-collapsed size so switching away from the AI Assistant restores the prior layout.🤖 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/layouts/DefaultLayout.tsx` around lines 74 - 81, Update the maximization effect in DefaultLayout around panelRef and activeSidebar so leaving the maximized AI Assistant restores the panel’s previous non-collapsed size instead of always resizing to contentMaxSizePercentage. Use the panel’s expand() behavior or persist and reuse the last user-adjusted size, while retaining collapse() when isMaximised is true.
🤖 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.
Outside diff comments:
In `@apps/studio/components/layouts/DefaultLayout.tsx`:
- Around line 74-81: Update the maximization effect in DefaultLayout around
panelRef and activeSidebar so leaving the maximized AI Assistant restores the
panel’s previous non-collapsed size instead of always resizing to
contentMaxSizePercentage. Use the panel’s expand() behavior or persist and reuse
the last user-adjusted size, while retaining collapse() when isMaximised is
true.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 461de052-e538-4bb5-a326-33e055c5982b
📒 Files selected for processing (1)
apps/studio/components/layouts/DefaultLayout.tsx
Braintrust eval report
|
## Summary Fixes FE-3955 / [SUPABASE-APP-K41](https://supabase.sentry.io/issues/7613475596/) — a crash affecting 101 users (502 occurrences, escalating) since the "maximise AI assistant" feature (#47954) shipped on 2026-07-15. `DefaultLayout` calls `panelRef.current.collapse()` / `.resize()` on the `panel-content` resizable panel whenever the AI assistant sidebar is maximised. Below the `md` breakpoint, `LayoutSidebar` renders no panel at all (the sidebar shows as a mobile sheet instead), leaving `panel-content` as the *only* panel in the `ResizablePanelGroup`. `react-resizable-panels`' resize algorithm assumes a neighboring panel exists to pivot against, so with a single panel it computes an invalid pivot index of `-1` and throws `Panel constraints not found for index -1`. This guards the effect with the same `isMobile` breakpoint check `LayoutSidebar` already uses, so we never call `collapse()`/`resize()` when there's no sibling panel to resize against. ## Test plan - [ ] On a narrow viewport (or actual mobile device), open the AI assistant and toggle maximise — should no longer throw - [ ] On desktop, confirm maximise/minimise still resizes the content panel as before <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed a mobile layout issue where the sidebar could collapse or resize incorrectly, leading to runtime errors. * Improved the sidebar’s resize/collapse behavior on mobile devices to keep the layout stable. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Context
Supports maximising the AI assistant to fit the content width which will provide a larger workspace for observability work for example
To test
Summary by CodeRabbit
New Features
Improvements