Skip to content

Commit ab44093

Browse files
committed
fix: ui issues
1 parent 08ae2e0 commit ab44093

File tree

8 files changed

+22
-585
lines changed

8 files changed

+22
-585
lines changed

app/globals.css

Lines changed: 0 additions & 88 deletions
This file was deleted.

src/App.tsx

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState, useCallback, useEffect } from "react";
22
import type * as Monaco from "monaco-editor";
33
import { useKeyPressEvent } from "react-use";
4-
import { Database, Play, Save, Settings, ChevronRight, ChevronDown, Server, Table, Plus, X, PanelLeftClose, PanelLeft, CheckCircle2, Clock } from "lucide-react";
4+
import { Database, Play, Save, Settings, ChevronRight, ChevronDown, Server, Table, Plus, X, CheckCircle2, Clock } from "lucide-react";
55
import Editor from "@monaco-editor/react";
66
import { Button } from "@/components/ui/button";
77
import { ResizeHandle } from "@/components/resize-handle";
@@ -72,7 +72,7 @@ function ServerSidebar({
7272
const connectionStatus = status[projectId];
7373
const projectSchemas = schemas[projectId] || [];
7474
const isProjectExpanded = expandedProjects[projectId] ?? (connectionStatus === ProjectConnectionStatus.Connected);
75-
75+
7676
return (
7777
<div key={projectId}>
7878
{/* Server/Project Level */}
@@ -104,17 +104,21 @@ function ServerSidebar({
104104
{isProjectExpanded && (
105105
<div>
106106
{/* Database Level */}
107-
<button
108-
onClick={() => onConnect(projectId)}
107+
<div
109108
className={cn(
110109
"flex w-full items-center gap-2 px-2 py-1.5 text-left text-sm hover:bg-sidebar-accent",
111-
"transition-colors rounded-sm"
110+
"transition-colors rounded-sm cursor-pointer"
112111
)}
113112
style={{ paddingLeft: "20px" }}
114113
>
115-
<span className="w-3" />
116-
<span className="text-muted-foreground"><Database className="h-4 w-4" /></span>
117-
<span className="flex-1 font-mono text-xs">{details[3]}</span>
114+
<button
115+
onClick={() => onConnect(projectId)}
116+
className="flex items-center gap-2 flex-1"
117+
>
118+
<span className="w-3" />
119+
<span className="text-muted-foreground"><Database className="h-4 w-4" /></span>
120+
<span className="font-mono text-xs">{details[3]}</span>
121+
</button>
118122
<div className="flex gap-1">
119123
<Button
120124
variant="ghost"
@@ -133,7 +137,7 @@ function ServerSidebar({
133137
<X className="h-3 w-3" />
134138
</Button>
135139
</div>
136-
</button>
140+
</div>
137141

138142
{/* Schema Level */}
139143
{connectionStatus === ProjectConnectionStatus.Connected && projectSchemas.map((schema) => {
@@ -206,7 +210,7 @@ function ServerSidebar({
206210
}
207211

208212
export default function App() {
209-
const [sidebarOpen, setSidebarOpen] = useState(true);
213+
const sidebarOpen = true;
210214
const [sidebarWidth, setSidebarWidth] = useState(280);
211215
const [editorHeight, setEditorHeight] = useState(50);
212216
const [connectionModalOpen, setConnectionModalOpen] = useState(false);
@@ -539,15 +543,6 @@ export default function App() {
539543
</div>
540544

541545
<div className="flex flex-1 overflow-hidden">
542-
<Button
543-
variant="ghost"
544-
size="icon"
545-
className="absolute left-2 top-16 z-10 h-8 w-8"
546-
onClick={() => setSidebarOpen(!sidebarOpen)}
547-
>
548-
{sidebarOpen ? <PanelLeftClose className="h-4 w-4 text-white" /> : <PanelLeft className="h-4 w-4 text-white" />}
549-
</Button>
550-
551546
{sidebarOpen && (
552547
<>
553548
<div style={{ width: `${sidebarWidth}px` }} className="flex-shrink-0">
@@ -608,12 +603,18 @@ export default function App() {
608603
</Button>
609604
</div>
610605
{/* SQL Editor */}
611-
<div className="relative flex-1 overflow-hidden bg-[var(--color-editor-bg)]">
612-
<div className="absolute inset-0 overflow-auto">
606+
<div className="relative flex-1 overflow-hidden bg-[var(--color-editor-bg)]" suppressHydrationWarning>
607+
<div className="absolute inset-0 overflow-auto bg-[#1e1e1e]">
613608
<Editor
614609
height="100%"
615610
defaultLanguage="pgsql"
616611
language="pgsql"
612+
theme="vs-dark"
613+
loading={
614+
<div className="flex h-full w-full items-center justify-center bg-[#1e1e1e]">
615+
<span className="text-muted-foreground text-sm">Loading editor...</span>
616+
</div>
617+
}
617618
beforeMount={registerContextAwareCompletions}
618619
options={{
619620
automaticLayout: true,

src/components/editor-tabs.tsx

Lines changed: 0 additions & 67 deletions
This file was deleted.

src/components/postgres-gui.tsx

Lines changed: 0 additions & 103 deletions
This file was deleted.

0 commit comments

Comments
 (0)