feat: add SQL editor, query results, and workspace panels

Add CodeMirror 6 SQL editor with Ctrl+Enter execution, ResultsTable
with virtual scrolling and resizable columns, ResultsPanel, EditableCell,
WorkspacePanel (editor + results split), and TabContent router.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-11 19:06:48 +03:00
parent d333732346
commit 13a8535b5c
6 changed files with 520 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
import CodeMirror from "@uiw/react-codemirror";
import { sql, PostgreSQL } from "@codemirror/lang-sql";
import { keymap } from "@codemirror/view";
import { useCallback, useMemo } from "react";
interface Props {
value: string;
onChange: (value: string) => void;
onExecute: () => void;
}
export function SqlEditor({ value, onChange, onExecute }: Props) {
const handleChange = useCallback(
(val: string) => {
onChange(val);
},
[onChange]
);
const extensions = useMemo(
() => [
sql({ dialect: PostgreSQL }),
keymap.of([
{
key: "Ctrl-Enter",
run: () => {
onExecute();
return true;
},
},
{
key: "Mod-Enter",
run: () => {
onExecute();
return true;
},
},
]),
],
[onExecute]
);
return (
<CodeMirror
value={value}
onChange={handleChange}
extensions={extensions}
theme="dark"
className="h-full text-sm"
basicSetup={{
lineNumbers: true,
foldGutter: true,
highlightActiveLine: true,
autocompletion: true,
}}
/>
);
}