fix(editor): stabilize SQL run-statement gutter width

This commit is contained in:
lewis authored and GitHub committed 2026-08-06 14:00:09 +08:00
1 parent 0862e63389
commit c398a07573
4 files changed
+14 -24

No files matched your search

@@ -4,10 +4,9 @@ import { describe, expect, it } from "vitest";
import { createStatementGutterMarkerDom, shouldShowStatementGutter } from "@/lib/editor/codemirrorStatementGutter";
describe("CodeMirror statement gutter marker", () => {
it("omits the gutter when run buttons and status markers are absent", () => {
expect(shouldShowStatementGutter(false, 0)).toBe(false);
expect(shouldShowStatementGutter(true, 0)).toBe(true);
expect(shouldShowStatementGutter(false, 1)).toBe(true);
it("keeps gutter visibility controlled by the run-button preference", () => {
expect(shouldShowStatementGutter(false)).toBe(false);
expect(shouldShowStatementGutter(true)).toBe(true);
});
it("keeps execution status inside the run button column", () => {
@@ -8,8 +8,8 @@ export interface StatementGutterMarkerDomOptions {
statusLabel?: string;
}
export function shouldShowStatementGutter(showRunButtons: boolean, markerCount: number): boolean {
return showRunButtons || markerCount > 0;
export function shouldShowStatementGutter(showRunButtons: boolean): boolean {
return showRunButtons;
}
function createStatusIconDom(status: StatementExecutionMarkerStatus, includeCircle: boolean) {
+4 -4
View File
@@ -762,19 +762,19 @@ export function buildEditorFontThemeRules(opts?: { fixedHeight?: boolean; scroll
},
".cm-lineNumbers .cm-gutterElement": {
cursor: "pointer",
paddingRight: "16px",
paddingRight: "8px",
userSelect: "none",
},
".cm-run-statement-gutter": {
minWidth: "34px",
minWidth: "28px",
},
".cm-run-statement-gutter .cm-gutterElement": {
alignItems: "center",
boxSizing: "border-box",
display: "flex",
justifyContent: "center",
minWidth: "34px",
padding: "0 5px",
minWidth: "28px",
padding: "0 2px",
},
".cm-run-statement-marker": {
alignItems: "center",