Skip to content

Joshen/fe 3775 create a larger assistant workspace for observability - #47954

Merged
joshenlim merged 5 commits into
masterfrom
joshen/fe-3775-create-a-larger-assistant-workspace-for-observability
Jul 15, 2026
Merged

joshenlim merged 5 commits into
masterfrom
joshen/fe-3775-create-a-larger-assistant-workspace-for-observability

Conversation

@joshenlim

@joshenlim joshenlim commented Jul 15, 2026 •

Copy link
Copy Markdown
Member

Context

Supports maximising the AI assistant to fit the content width which will provide a larger workspace for observability work for example

image image

To test

  • Can maximize/minimize AI Assistant
  • Swapping to another sidebar should bring the panel size back to previous
    • Only the AI Assistant can be maximized (for now at least)

Summary by CodeRabbit

  • New Features

    • Added maximize/minimize controls for the AI assistant panel.
    • Added a keyboard shortcut to quickly maximize the assistant (hidden from settings).
  • Improvements

    • The main content panel now collapses/resizes automatically based on assistant maximization.
    • Switching away from the AI assistant now automatically exits maximized mode; returning restores the maximized experience.
    • Updated the assistant header UI with dynamic label/icon/accessibility and a maximize shortcut when chat isn’t loading.

@joshenlim
joshenlim requested a review from a team as a code owner July 15, 2026 09:18
@vercel

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

Request Review

@supabase

supabase Bot commented Jul 15, 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 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The AI assistant gains shared maximization state, a keyboard shortcut, dynamic header controls, and layout integration that collapses or restores the resizable content panel.

Changes

AI assistant maximization

Layer / File(s) Summary
Sidebar maximization state
apps/studio/state/sidebar-manager-state.tsx
Adds isMaximised state and toggleMaximise(), and resets maximization when toggling another sidebar.
Assistant maximize controls
apps/studio/state/shortcuts/registry.ts, apps/studio/components/ui/AIAssistantPanel/AIAssistantHeader.tsx
Registers the assistant maximize shortcut and connects it and the header button to dynamic maximize/minimize behavior.
Resizable layout integration
apps/studio/components/layouts/DefaultLayout.tsx, apps/studio/components/layouts/ProjectLayout/LayoutSidebar/index.tsx
Collapses or restores the content panel from maximization state, conditionally enables panel collapsing, expands the sidebar limit, and reorders hook calls.

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
Loading

Suggested reviewers: djhi, alaister

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description does not follow the required template and is missing the contributing acknowledgment, change type, current behavior, and new behavior sections. Add the template sections in order, including YES/NO for CONTRIBUTING.md, change type, current behavior, new behavior, and any issue links or extra context.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: maximizing the AI assistant workspace for observability.
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 joshen/fe-3775-create-a-larger-assistant-workspace-for-observability

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.

@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: 2

🧹 Nitpick comments (1)
apps/studio/components/layouts/ProjectLayout/LayoutSidebar/index.tsx (1)

1-4: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove unused imports.

usePrevious and usePanelRef are 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

📥 Commits

Reviewing files that changed from the base of the PR and between c9eb33a and afff17e.

📒 Files selected for processing (5)
  • apps/studio/components/layouts/DefaultLayout.tsx
  • apps/studio/components/layouts/ProjectLayout/LayoutSidebar/index.tsx
  • apps/studio/components/ui/AIAssistantPanel/AIAssistantHeader.tsx
  • apps/studio/state/shortcuts/registry.ts
  • apps/studio/state/sidebar-manager-state.tsx

@github-actions

github-actions Bot commented Jul 15, 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  9 minutes, 42 seconds
commit  0456656

Flaky tests

Features › database.spec.ts › Database › Schema Visualizer › table actions work as expected
Features › table-editor.spec.ts › table editor › should show rls accordingly

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

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

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 win

Restore 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

📥 Commits

Reviewing files that changed from the base of the PR and between 0ddadba and 0456656.

📒 Files selected for processing (1)
  • apps/studio/components/layouts/DefaultLayout.tsx

@joshenlim
joshenlim merged commit 72d623f into master Jul 15, 2026
37 checks passed
@joshenlim
joshenlim deleted the joshen/fe-3775-create-a-larger-assistant-workspace-for-observability branch July 15, 2026 14:39
@github-actions

github-actions Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1784126562)

Score Average Improvements Regressions
Knowledge Usage 92.3% (+1pp) 1 🟢 1 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Tool Usage 68.6% (-17pp) 1 🟢 1 🔴
Time_to_first_token 2.77tok (-0.49tok) 25 🟢 4 🔴
Llm_calls 2.76 (-0.03) 8 🟢 16 🔴
Tool_calls 2.93 (+0.14) 10 🟢 8 🔴
Errors 5.22 (-2.18) 29 🟢 -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 24615tok (+4983.76tok) 9 🟢 16 🔴
Prompt_cached_tokens 8892.32tok (+2354.02tok) 11 🟢 12 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 597.01tok (+29.92tok) 13 🟢 15 🔴
Completion_reasoning_tokens 106.45tok (+14.01tok) 13 🟢 13 🔴
Total_tokens 25212.01tok (+5013.68tok) 11 🟢 17 🔴
Estimated_cost 0$ (+0$) 9 🟢 16 🔴
Duration 13.17s (-6.7s) 26 🟢 3 🔴
Llm_duration 9.9s (-0.99s) 22 🟢 7 🔴

joshenlim pushed a commit that referenced this pull request Jul 21, 2026
## 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 -->
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