Skip to content

fix(studio): keep SQL editor source menu open when switching sources - #48715

Merged
charislam merged 2 commits into
masterfrom
charis/fe-4036-sql-editor-keep-time-range-menu-open-when-switching-sources
Aug 4, 2026
Merged

charislam merged 2 commits into
masterfrom
charis/fe-4036-sql-editor-keep-time-range-menu-open-when-switching-sources

Conversation

@charislam

@charislam charislam commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

I have read the CONTRIBUTING.md file.

YES

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

Selecting Database/Logs in the SQL Editor's query-source dropdown closes the menu (Radix's default select behavior), so switching to Logs gives no visible indication that a Time range control just became available until the dropdown is reopened.

What is the new behavior?

Selecting a source keeps the dropdown open, so the newly-available source-specific controls (e.g. Time range for Logs) are immediately visible.

Additional context

Fixes FE-4036

Summary by CodeRabbit

  • Bug Fixes

    • Improved source switching in the SQL editor so the selection menu remains open while changing between database and logs sources.
    • Ensured source-specific controls update correctly after switching.
  • Tests

    • Added coverage for source selection, menu behavior, and source-specific control updates.

Selecting Database/Logs in the query-source dropdown closed the menu by
default (Radix's built-in select behavior), so switching to Logs gave no
visible cue that a Time range control had just appeared until the user
reopened the dropdown.

Fixes FE-4036
@charislam
charislam requested a review from a team as a code owner August 4, 2026 18:54
@vercel

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

Request Review

@coderabbitai

coderabbitai Bot commented Aug 4, 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 Plus

Run ID: 0c7aa76d-10f3-47ee-a59e-8ac4b1f60e0e

📥 Commits

Reviewing files that changed from the base of the PR and between b75adf7 and 2725578.

📒 Files selected for processing (1)
  • apps/studio/components/interfaces/SQLEditor/UtilityPanel/QuerySourceMenu/QuerySourceMenu.tsx
💤 Files with no reviewable changes (1)
  • apps/studio/components/interfaces/SQLEditor/UtilityPanel/QuerySourceMenu/QuerySourceMenu.tsx

📝 Walkthrough

Walkthrough

The query source menu uses onSelect handlers to prevent dropdown closure during Database and Logs switching. Tests verify that the menu remains open and that source-specific controls update.

Changes

Query source selection

Layer / File(s) Summary
Preserve menu state during source switching
apps/studio/components/interfaces/SQLEditor/UtilityPanel/QuerySourceMenu/QuerySourceMenu.tsx, apps/studio/tests/components/SQLEditor/QuerySourceMenu.test.tsx
The menu prevents default closure before switching sources. Tests verify the open menu and the change from “Run as” to “Time range”.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main behavior fix: keeping the SQL editor source menu open when switching sources.
Description check ✅ Passed The description includes all required sections, identifies the bug fix, explains current and new behavior, and provides issue context.
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 charis/fe-4036-sql-editor-keep-time-range-menu-open-when-switching-sources

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 4, 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 4, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results (next)

passed  242 passed
flaky  1 flaky
skipped  5 skipped

Details

stats  248 tests across 29 suites
duration  5 minutes, 6 seconds
commit  2725578

Flaky tests

Features › realtime-inspector.spec.ts › Realtime Inspector › Basic Inspector UI › channel selection popover opens and 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

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

Minor changes

Removed comments about keeping the menu open for source-specific controls.
@charislam
charislam enabled auto-merge (squash) August 4, 2026 20:13
@charislam
charislam merged commit 2165746 into master Aug 4, 2026
39 checks passed
@charislam
charislam deleted the charis/fe-4036-sql-editor-keep-time-range-menu-open-when-switching-sources branch August 4, 2026 20:23
@github-actions

github-actions Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1785875217)

Score Average Improvements Regressions
Completeness 90.7% (-7.000000000000001pp) 2 🟢 6 🔴
Conciseness 43.5% (+4pp) 5 🟢 5 🔴
Correctness 65.9% (-4pp) 1 🟢 3 🔴
Docs Faithfulness 66.7% (+3pp) 7 🟢 5 🔴
Goal Completion 76.7% (+1pp) 7 🟢 6 🔴
Safety 87.5% (-3pp) 1 🟢 3 🔴
Knowledge Usage 94.9% (-3pp) - 1 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+5pp) 1 🟢 -
Tool Usage 74.5% (+6pp) 2 🟢 -
URL Validity 100% - -
Time_to_first_token 3.92tok (+1.07tok) 4 🟢 25 🔴
Llm_calls 7.15 (-0.1) 10 🟢 14 🔴
Tool_calls 2.97 (-0.11) 8 🟢 12 🔴
Errors 0.02 (+0.02) - 1 🔴
Llm_errors 0.01 (+0.01) - 1 🔴
Tool_errors 0 (+0) - -
Prompt_tokens 25317.7tok (+697.51tok) 15 🟢 10 🔴
Prompt_cached_tokens 8180.23tok (+153.01tok) 8 🟢 10 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 610.05tok (-9.74tok) 19 🟢 10 🔴
Completion_reasoning_tokens 104.22tok (-4.49tok) 13 🟢 13 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 25927.75tok (+687.77tok) 19 🟢 10 🔴
Estimated_cost 0$ (+0$) 11 🟢 11 🔴
Duration 18.31s (+1.83s) 11 🟢 18 🔴
Llm_duration 14.92s (+2.09s) 10 🟢 19 🔴

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