Skip to content

fix(studio): guard panel collapse/resize on narrow viewports - #48098

Merged
joshenlim merged 2 commits into
masterfrom
aliwaseem/fe-3955-panel-constraints-not-found-for-index-1-crash-in
Jul 21, 2026
Merged

joshenlim merged 2 commits into
masterfrom
aliwaseem/fe-3955-panel-constraints-not-found-for-index-1-crash-in

Conversation

@awaseem

@awaseem awaseem commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes FE-3955 / SUPABASE-APP-K41 — 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

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.

DefaultLayout called panelRef.current.collapse()/.resize() on the
panel-content ResizablePanel whenever the AI assistant sidebar was
maximised. Below the md breakpoint, LayoutSidebar renders no panel
(the sidebar shows as a mobile sheet instead), leaving panel-content
as the group's only panel. react-resizable-panels' resize algorithm
then computes an invalid pivot index of -1 and throws.

Fixes FE-3955
@awaseem
awaseem requested a review from a team as a code owner July 20, 2026 14:47
@vercel

vercel Bot commented Jul 20, 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, Comment Jul 20, 2026 2:57pm
studio-staging Ready Ready Preview, Comment Jul 20, 2026 2:57pm
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jul 20, 2026 2:57pm
design-system Skipped Skipped Jul 20, 2026 2:57pm
docs Skipped Skipped Jul 20, 2026 2:57pm
ui-library Skipped Skipped Jul 20, 2026 2:57pm
zone-www-dot-com Skipped Skipped Jul 20, 2026 2:57pm

Request Review

@supabase

supabase Bot commented Jul 20, 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 ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b4edc6f9-c166-47a8-8612-6a0883bcae66

📥 Commits

Reviewing files that changed from the base of the PR and between c9598a1 and 6243bbd.

📒 Files selected for processing (1)
  • apps/studio/components/layouts/DefaultLayout.tsx
💤 Files with no reviewable changes (1)
  • apps/studio/components/layouts/DefaultLayout.tsx

📝 Walkthrough

Walkthrough

DefaultLayout now avoids resizable sidebar panel operations on mobile layouts and reruns the effect when the mobile state changes.

Changes

Sidebar layout behavior

Layer / File(s) Summary
Guard mobile sidebar panel effects
apps/studio/components/layouts/DefaultLayout.tsx
The sidebar effect now exits when isMobile is true and includes isMobile in its dependency array.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • supabase/supabase#47954: Changes related DefaultLayout sidebar panel behavior based on sidebar maximization state.

Suggested reviewers: charislam

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main fix: guarding panel collapse/resize on narrow viewports.
Description check ✅ Passed The description covers the bug, current and new behavior, and test plan, though it omits the template's checklist sections.
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.
✨ 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 aliwaseem/fe-3955-panel-constraints-not-found-for-index-1-crash-in

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.

@github-actions

github-actions Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results (next)

passed  236 passed
flaky  2 flaky
skipped  5 skipped

Details

stats  243 tests across 28 suites
duration  10 minutes, 37 seconds
commit  6243bbd

Flaky tests

Features › realtime-inspector.spec.ts › Realtime Inspector › Basic Inspector UI › channel selection popover opens and works
Features › realtime-inspector.spec.ts › Realtime Inspector › Basic Inspector UI › start/stop listening button works

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

@joshenlim joshenlim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Changes LGTM! Minimally checked on preview

@joshenlim
joshenlim merged commit 846706b into master Jul 21, 2026
36 of 37 checks passed
@joshenlim
joshenlim deleted the aliwaseem/fe-3955-panel-constraints-not-found-for-index-1-crash-in branch July 21, 2026 07:22
@github-actions

github-actions Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1784618739)

Score Average Improvements Regressions
Completeness 100% (+5pp) 4 🟢 -
Conciseness 39.7% (-2pp) 7 🟢 10 🔴
Correctness 67.8% (+1pp) 3 🟢 3 🔴
Docs Faithfulness 71.4% (0pp) 3 🟢 3 🔴
Goal Completion 81% (+4pp) 6 🟢 1 🔴
Tool Usage 70.6% (-1pp) 2 🟢 2 🔴
Knowledge Usage 92.3% (-5pp) - 2 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Safety 85.7% (-2pp) 2 🟢 1 🔴
URL Validity 100% (+0pp) - -
Time_to_first_token 3.15tok (+0.32tok) 9 🟢 20 🔴
Llm_calls 6.91 (-0.41) 5 🟢 19 🔴
Tool_calls 2.86 (-0.16) 7 🟢 15 🔴
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 20841.78tok (-4793.43tok) 19 🟢 6 🔴
Prompt_cached_tokens 7232.74tok (-735.63tok) 11 🟢 15 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 600.24tok (-6.87tok) 16 🟢 13 🔴
Completion_reasoning_tokens 89.85tok (-21.16tok) 17 🟢 9 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 21442.02tok (-4800.3tok) 20 🟢 9 🔴
Estimated_cost 0$ (0$) 18 🟢 8 🔴
Duration 17.11s (+0.78s) 12 🟢 17 🔴
Llm_duration 12.35s (+0.44s) 15 🟢 14 🔴

hunleyd added a commit that referenced this pull request Aug 8, 2026
…fomap-entry-for-pitr-archiving-stale' into hunleyd/indata-979-studio-lintinfomap-entry-for-pitr-archiving-stale

* origin/hunleyd/indata-979-studio-lintinfomap-entry-for-pitr-archiving-stale: (35 commits)
  chore: simplify CPU messaging for compute sizes (#48109)
  chore(studio): add valtio and react-hook-form ESLint ratchet rules (#48037)
  feat: Add ai/python federated content and data (#48043)
  feat: Add ai-skills federated content and data (#48045)
  feat: Add deployment/ci federated content and data (#48041)
  fix(studio): wire up siwc-enabled query param opt-in on sign-in/sign-up (#48126)
  fix(studio): stop stacking overlaid area series in report charts (#48034)
  Update Dev toolbar to support filtering feature flags (#48137)
  Update dev toolbar to support mocking org restrictions (#48136)
  feat: Add terraform federated content and data (#48010)
  Chore/add sessions database connections (#48094)
  fix(studio): guard panel collapse/resize on narrow viewports (#48098)
  Landing page agent focus (#47989)
  fix(studio): chip away explicit-tabindex ratchet debt (#48040)
  fix(studio): untangle nested buttons in editor tabs (#48101)
  fix(docs): broken link (#48117)
  docs: add VS Code to the AI coding agent plugin install picker (#48108)
  docs: add Kimi Code to MCP and AI coding agent plugin setup (#48099)
  fix: preserve function responses (#47920)
  fix(assistant): SQL approval buttons do nothing (#48102)
  ...
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