From d6c81b66c9999cb121dd8876f541313d484f157f Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Thu, 1 Oct 2026 11:20:41 +0800 Subject: [PATCH] Apply scrollBeyondLastLine for CodeEditor in QueryEditor and Logs Explorer (#51082) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Context As per PR title - this was the behaviour for the SQL Editor and figured it makes sense to also have this behaviour in the Explorer QueryEditor + Logs Explorer where the main UX is writing queries, and lets the user bring the active section of the code closer to the middle of the viewport (rather than right at the bottom) image ## Summary by CodeRabbit * **Editor Improvements** * Query editors now allow scrolling beyond the final line, providing more room to position the last lines on screen. * The SQL editor no longer forces the decoration area to zero width; it now uses Monaco’s default width behavior. --- apps/studio/components/interfaces/Explorer/QueryEditor/index.tsx | 1 + apps/studio/components/interfaces/SQLEditor/MonacoEditor.tsx | 1 - apps/studio/pages/project/[ref]/logs/explorer/index.tsx | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/studio/components/interfaces/Explorer/QueryEditor/index.tsx b/apps/studio/components/interfaces/Explorer/QueryEditor/index.tsx index f821a65419b..5ad7134764e 100644 --- a/apps/studio/components/interfaces/Explorer/QueryEditor/index.tsx +++ b/apps/studio/components/interfaces/Explorer/QueryEditor/index.tsx @@ -478,6 +478,7 @@ export const QueryEditor = forwardRef(funct options={{ minimap: { enabled: false }, padding: { top: 8 }, + scrollBeyondLastLine: true, }} onInputChange={(value) => onSqlChange(value ?? '')} onMount={(editor, monaco) => { diff --git a/apps/studio/components/interfaces/SQLEditor/MonacoEditor.tsx b/apps/studio/components/interfaces/SQLEditor/MonacoEditor.tsx index 5054f2bf66f..6a64b235f7e 100644 --- a/apps/studio/components/interfaces/SQLEditor/MonacoEditor.tsx +++ b/apps/studio/components/interfaces/SQLEditor/MonacoEditor.tsx @@ -210,7 +210,6 @@ export const MonacoEditor = ({ }} options={{ placeholder, - lineDecorationsWidth: 0, fixedOverflowWidgets: false, lineNumbersMinChars: 5, scrollBeyondLastLine: true, diff --git a/apps/studio/pages/project/[ref]/logs/explorer/index.tsx b/apps/studio/pages/project/[ref]/logs/explorer/index.tsx index f74291b0d8c..5828db9e7d3 100644 --- a/apps/studio/pages/project/[ref]/logs/explorer/index.tsx +++ b/apps/studio/pages/project/[ref]/logs/explorer/index.tsx @@ -509,6 +509,7 @@ export const LogsExplorerPage: NextPageWithLayout = () => { defaultValue={editorValue} onInputChange={(v) => setEditorValue(v || '')} actions={{ runQuery: { enabled: true, callback: handleRun } }} + options={{ scrollBeyondLastLine: true }} /> {rewriteProposal && (