From 2034a1b929fbee2d0010531ff17c96a3cd03fd3c Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Wed, 19 Aug 2026 16:20:03 +0800 Subject: [PATCH] Use DiffEditor for QueryCell for logs migration (#49238) ## Context Previously we added the clickhouse logs migration banner for the Query Cell in Notebooks But rewriting was doing a direct swap of the content Changes here opt to use the DiffEditor instead to maintain the same UX for query editing that's not done by the user directly image ## Summary by CodeRabbit * **New Features** * Added a review workflow for legacy SQL rewrites. * View proposed rewrites in a full-editor comparison overlay. * Accept rewrites to update and save the SQL, or discard them without applying changes. * **Bug Fixes** * Prevented query execution, source changes, and visibility toggling while a rewrite is under review. * Prevented outdated rewrite proposals from overwriting newer SQL edits. --- .../Explorer/QueryEditor/QuerySourceMenu.tsx | 3 + .../interfaces/Explorer/QueryEditor/index.tsx | 59 ++++++++++++++++--- 2 files changed, 54 insertions(+), 8 deletions(-) diff --git a/apps/studio/components/interfaces/Explorer/QueryEditor/QuerySourceMenu.tsx b/apps/studio/components/interfaces/Explorer/QueryEditor/QuerySourceMenu.tsx index 450df7cec6f..61f6ffb8b6a 100644 --- a/apps/studio/components/interfaces/Explorer/QueryEditor/QuerySourceMenu.tsx +++ b/apps/studio/components/interfaces/Explorer/QueryEditor/QuerySourceMenu.tsx @@ -26,6 +26,7 @@ import { import { type RoleImpersonationController } from '@/state/role-impersonation-state' export type QuerySourceMenuProps = { + disabled?: boolean rowLimit?: number onRowLimitChange?: (val: number) => void roleImpersonationState?: RoleImpersonationController @@ -43,6 +44,7 @@ export type QuerySourceMenuProps = { * has SQL to preserve or discard and a fresh draft does not. */ export const QuerySourceMenu = ({ + disabled = false, rowLimit = 100, onRowLimitChange, roleImpersonationState, @@ -74,6 +76,7 @@ export const QuerySourceMenu = ({ + + + +
+ +
+ + )} )}