Skip to content

Commit 092ce88

Browse files
authored
Merge pull request #139 from supabase-community/feat/mobile
Mobile support
2 parents c239111 + 640e463 commit 092ce88

File tree

12 files changed

+463
-354
lines changed

12 files changed

+463
-354
lines changed

apps/postgres-new/app/(main)/db/[id]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default function Page({ params }: { params: { id: string } }) {
3535
return (
3636
<div className="relative h-full w-full">
3737
<NewDatabasePage />
38-
<div className="absolute inset-0 bg-background/70 backdrop-blur-sm flex items-center justify-center">
38+
<div className="absolute inset-0 bg-background/70 backdrop-blur-sm flex items-center justify-center m-4">
3939
<p>
4040
This database is already open in another tab or window.
4141
<br />

apps/postgres-new/components/chat-message.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function ChatMessage({ message, isLast }: ChatMessageProps) {
6969

7070
return (
7171
<m.div
72-
className="ml-4 self-stretch flex flex-col items-stretch gap-6"
72+
className="lg:ml-4 self-stretch flex flex-col items-stretch gap-6"
7373
variants={{
7474
hidden: {
7575
opacity: 0,

apps/postgres-new/components/chat.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export default function Chat() {
179179
layoutId={nextMessageId}
180180
className="px-5 py-2.5 text-foreground rounded-full bg-border flex gap-2 items-center shadow-xl z-50"
181181
>
182-
<Paperclip size={14} /> Add file to chat
182+
<Paperclip size={18} /> Add file to chat
183183
</m.div>
184184
),
185185
})
@@ -253,7 +253,7 @@ export default function Chat() {
253253
{dropZoneCursor}
254254
<div className="flex-1 relative h-full min-h-0">
255255
{isLoadingMessages || isLoadingSchema ? (
256-
<div className="h-full w-full max-w-4xl flex flex-col gap-10 p-10">
256+
<div className="h-full w-full max-w-4xl flex flex-col gap-10 p-5 lg:p-10">
257257
<Skeleton className="self-end h-10 w-1/3 rounded-3xl" />
258258
<Skeleton className="self-start h-28 w-2/3 rounded-3xl" />
259259
<Skeleton className="self-end h-10 w-2/3 rounded-3xl" />
@@ -273,7 +273,7 @@ export default function Chat() {
273273
<LiveShareOverlay databaseId={databaseId} />
274274
<m.div
275275
key={databaseId}
276-
className="flex flex-col gap-4 w-full max-w-4xl p-10"
276+
className="flex flex-col gap-4 w-full max-w-4xl px-2 py-5 lg:p-10"
277277
variants={{
278278
show: {
279279
transition: {
@@ -496,7 +496,7 @@ export default function Chat() {
496496
}}
497497
disabled={!isChatEnabled}
498498
>
499-
<Paperclip size={16} strokeWidth={1.3} />
499+
<Paperclip size={18} strokeWidth={1.3} />
500500
</Button>
501501
<textarea
502502
ref={inputRef}

apps/postgres-new/components/ide.tsx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ export type IDEProps = PropsWithChildren<{
2424
}>
2525

2626
export default function IDE({ children, className }: IDEProps) {
27-
const { databaseId } = useWorkspace()
28-
const [tab, setTab] = useState<TabValue>('diagram')
27+
const { databaseId, tab, setTab } = useWorkspace()
2928

3029
const isSmallBreakpoint = useBreakpoint('lg')
3130
const { data: messages } = useMessagesQuery(databaseId)
@@ -36,7 +35,7 @@ export default function IDE({ children, className }: IDEProps) {
3635
} else {
3736
setTab('diagram')
3837
}
39-
}, [isSmallBreakpoint])
38+
}, [isSmallBreakpoint, setTab])
4039

4140
const { value: migrationStatements } = useAsyncMemo(async () => {
4241
const sqlExecutions =
@@ -106,35 +105,32 @@ export default function IDE({ children, className }: IDEProps) {
106105
value="chat"
107106
className={cn(
108107
buttonVariants({ variant: tab === 'chat' ? 'default' : 'ghost' }),
109-
tab === 'chat' && '!shadow-sm',
110108
'gap-2'
111109
)}
112110
>
113-
<MessageSquareMore size={14} />
114-
<span className="hidden sm:inline">Chat</span>
111+
<MessageSquareMore className="hidden sm:block" size={18} />
112+
<span>Chat</span>
115113
</TabsTrigger>
116114
)}
117115
<TabsTrigger
118116
value="diagram"
119117
className={cn(
120118
buttonVariants({ variant: tab === 'diagram' ? 'default' : 'ghost' }),
121-
tab === 'diagram' && '!shadow-sm',
122119
'gap-2'
123120
)}
124121
>
125-
<Workflow size={14} />
126-
<span className="hidden sm:inline">Diagram</span>
122+
<Workflow className="hidden sm:block" size={18} />
123+
<span>Diagram</span>
127124
</TabsTrigger>
128125
<TabsTrigger
129126
value="migrations"
130127
className={cn(
131128
buttonVariants({ variant: tab === 'migrations' ? 'default' : 'ghost' }),
132-
tab === 'migrations' && '!shadow-sm',
133129
'gap-2'
134130
)}
135131
>
136-
<FileCode size={14} />
137-
<span className="hidden sm:inline">Migrations</span>
132+
<FileCode className="hidden sm:block" size={18} />
133+
<span>Migrations</span>
138134
</TabsTrigger>
139135
{/* Temporarily hide seeds until we get pg_dump working */}
140136
{/* {false && (
@@ -166,7 +162,7 @@ export default function IDE({ children, className }: IDEProps) {
166162
<TabsContent value="migrations" className="h-full">
167163
<div className="h-full flex flex-col gap-3">
168164
<Editor
169-
className=" py-4 rounded-md bg-[#1e1e1e]"
165+
className="py-4 rounded-md bg-[#1e1e1e]"
170166
language="pgsql"
171167
value={migrationsSql}
172168
theme="vs-dark"
@@ -176,6 +172,7 @@ export default function IDE({ children, className }: IDEProps) {
176172
enabled: false,
177173
},
178174
fontSize: 13,
175+
wordWrap: 'on',
179176
readOnly: true,
180177
}}
181178
onMount={async (editor, monaco) => {

apps/postgres-new/components/layout.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ export default function Layout({ children }: LayoutProps) {
3535
<LazyMotion features={loadFramerFeatures}>
3636
<TooltipProvider delayDuration={0}>
3737
<div className="w-full h-full flex flex-col overflow-hidden">
38-
{!isLegacyDomain && <LiveShareBanner />}
39-
{(isLegacyDomain || isLegacyDomainRedirect) && <RenameBanner />}
38+
<div className="hidden lg:flex flex-col">
39+
{!isLegacyDomain && <LiveShareBanner />}
40+
{(isLegacyDomain || isLegacyDomainRedirect) && <RenameBanner />}
41+
</div>
4042
<main className="flex-1 flex flex-col lg:flex-row min-h-0">
41-
{/* TODO: make sidebar available on mobile */}
42-
{!isSmallBreakpoint && <Sidebar />}
43+
<Sidebar />
4344
<m.div layout="position" className="w-full h-full min-w-0 min-h-0">
4445
{children}
4546
</m.div>

apps/postgres-new/components/schema/legend.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { DiamondIcon, Fingerprint, Hash, Key } from 'lucide-react'
22

33
const SchemaGraphLegend = () => {
44
return (
5-
<div className="border-t flex justify-center px-3 h-10 shadow-md bg-muted/50 text-xs md:text-[0.625rem] text-muted-foreground">
5+
<div className="border-t flex justify-center p-2 shadow-md bg-muted/50 text-[0.625rem] text-muted-foreground">
66
<ul className="flex flex-wrap items-center justify-center gap-4">
77
<li className="flex items-center font-mono gap-1">
88
<Key size={15} strokeWidth={1.5} className="flex-shrink-0 text-light" />

0 commit comments

Comments
 (0)