Skip to content

Commit 81ec652

Browse files
Update to version 0.1.50 (StructuredLabs#606)
Center align Clean up markdown fix partial scroll issue Simplify tableviewer Chat widget UI Improve chat widget ui Remove sidebar portal Improve sidebar styling Sidebar styling Table viewer Co-authored-by: Shivam Singhal <shivamsi@gmail.com>
1 parent 70b3e71 commit 81ec652

12 files changed

Lines changed: 272 additions & 456 deletions

File tree

examples/iris/hello.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99
# fastplotlib,
1010
get_df,
1111
plotly,
12+
sidebar,
1213
table,
1314
text,
1415
)
1516

1617

18+
sidebar()
19+
1720
# from preswald.engine.service import PreswaldService
1821

1922

@@ -162,7 +165,7 @@
162165
text(
163166
"## Sample of the Iris Dataset \n Below is a preview of the first 10 rows of the dataset, showing key measurements for each iris species."
164167
)
165-
table(df, limit=10)
168+
table(df)
166169

167170
# Add an interactive chat interface
168171
text(

frontend/src/App.css

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#root {
2-
max-width: 1280px;
3-
margin: 0 auto;
4-
padding: 2rem;
5-
text-align: center;
2+
width: 100%;
3+
margin: 0;
4+
padding: 0;
65
}
76

87
.logo {

frontend/src/components.css

Lines changed: 41 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,27 @@
88
}
99

1010
.main-content-collapsed-sidebar {
11-
@apply lg:pl-20 transition-all duration-300;
11+
@apply lg:pl-20 transition-all duration-300 ease-in-out;
1212
}
1313

1414
.main-content-open-sidebar {
15-
@apply lg:pl-80 transition-all duration-300;
15+
@apply lg:pl-64 transition-all duration-300 ease-in-out;
1616
}
1717

1818
.topbar {
1919
@apply fixed top-0 z-40 flex h-16 shrink-0 items-center gap-x-4 border-b bg-background -mx-8 sm:-mx-10 lg:-mx-12 shadow-sm w-full;
2020
}
2121

2222
.mobile-menu-button {
23-
@apply lg:hidden;
23+
@apply fixed left-4 top-4 z-50 lg:hidden h-9 w-9 p-0 flex items-center justify-center;
2424
}
2525

2626
.desktop-collapse-button {
27-
@apply hidden lg:flex;
27+
@apply hidden lg:flex absolute -right-4 top-3 h-6 w-6 items-center justify-center rounded-full z-50 translate-x-1/2;
2828
}
2929

3030
.icon-button {
31-
@apply h-6 w-6 transition-transform duration-200;
31+
@apply h-4 w-4 transition-transform duration-200;
3232
}
3333

3434
.separator {
@@ -52,51 +52,55 @@
5252
}
5353

5454
.sidebar-container {
55-
@apply flex grow flex-col h-full;
55+
@apply flex grow flex-col gap-4 h-full py-2;
5656
}
5757

5858
.sidebar-content {
5959
@apply flex flex-col h-full justify-between;
6060
}
6161

6262
.sidebar-nav {
63-
@apply flex flex-col gap-y-5 w-full;
63+
@apply flex flex-col gap-1 w-full;
6464
}
6565

6666
.sidebar-header {
67-
@apply flex h-16 shrink-0 items-center;
67+
@apply flex h-16 items-center px-6 mb-2;
68+
}
69+
70+
.sidebar-logo-container {
71+
@apply w-6 h-6 flex items-center justify-center shrink-0;
6872
}
6973

7074
.sidebar-logo {
71-
@apply h-8 w-8;
75+
@apply h-6 w-6;
7276
}
7377

7478
.sidebar-title {
75-
@apply ml-4 text-lg font-semibold transition-opacity duration-200;
79+
@apply ml-2 text-lg font-medium text-foreground;
7680
}
7781

7882
.sidebar-nav-list {
79-
@apply flex flex-1 flex-col;
83+
@apply flex flex-1 flex-col px-4;
8084
}
8185

8286
.sidebar-nav-items {
83-
@apply flex flex-1 flex-col gap-y-7;
87+
@apply flex flex-1 flex-col gap-1;
8488
}
8589

8690
.sidebar-nav-link {
87-
@apply flex items-center gap-x-3 rounded-md px-2 py-2 text-sm font-semibold leading-6 transition-all duration-200 m-2;
91+
@apply flex items-center gap-x-3 rounded-md px-3 py-2 text-sm text-muted-foreground font-medium transition-colors hover:bg-accent hover:text-accent-foreground;
8892
}
8993

9094
.sidebar-nav-link-active {
91-
@apply bg-accent hover:rounded-md;
95+
@apply bg-accent/50 text-foreground;
9296
}
9397

9498
.sidebar-nav-link-hover {
95-
@apply hover:bg-accent;
99+
@apply hover:bg-accent hover:text-accent-foreground;
96100
}
97101

98102
.sidebar-icon {
99-
@apply h-6 w-6 shrink-0 transition-transform duration-200;
103+
@apply h-4 w-4 shrink-0 opacity-70;
100104
}
101105

102106
.sidebar-footer {
@@ -109,48 +113,48 @@
109113

110114
/* Mobile Sidebar */
111115
.sidebar-mobile {
112-
@apply fixed inset-y-0 left-0 flex w-[280px] flex-col border-r bg-background p-0;
116+
@apply fixed inset-y-0 left-0 flex w-[280px] flex-col bg-background p-0 shadow-lg;
113117
}
114118

115119
.sidebar-mobile-header {
116-
@apply p-4 border-b;
120+
@apply flex h-16 items-center px-6 border-b border-border;
117121
}
118122

119123
.sidebar-mobile-title {
120-
@apply flex items-center gap-2;
124+
@apply flex items-center gap-3;
121125
}
122126

123127
.sidebar-mobile-close-btn {
124128
@apply top-4 right-4 h-8 w-8;
125129
}
126130

127131
.sidebar-mobile-content {
128-
@apply flex-1 overflow-hidden px-4 py-2;
132+
@apply flex-1 overflow-y-auto px-4 py-2;
129133
}
130134

131-
/* Desktop Sidebar */
132-
.sidebar-desktop {
133-
@apply hidden lg:fixed lg:inset-y-0 lg:z-50 lg:flex lg:flex-col border-r bg-background transition-all duration-300 ease-in-out transform-gpu;
135+
.sidebar-mobile-logo-container {
136+
@apply w-6 h-6 flex items-center justify-center shrink-0;
134137
}
135138

136-
.sidebar-desktop-collapsed {
137-
@apply lg:w-20 pt-6 items-center gap-y-4;
139+
.sidebar-mobile-name {
140+
@apply text-lg font-medium text-foreground;
138141
}
139142

140-
.sidebar-desktop-collapsed .sidebar-header {
141-
@apply justify-center items-center;
143+
/* Desktop Sidebar */
144+
.sidebar-desktop {
145+
@apply hidden lg:flex fixed left-0 top-0 h-full flex-col bg-muted/50 transition-all duration-300 ease-in-out z-30 border-r border-border;
142146
}
143147

144-
.sidebar-desktop-expanded {
145-
@apply lg:w-80;
148+
.sidebar-desktop-collapsed {
149+
width: 80px;
146150
}
147151

148-
.sidebar-desktop-expanded .desktop-collapse-button {
149-
@apply fixed top-6 right-2;
152+
.sidebar-desktop-expanded {
153+
width: 256px;
150154
}
151155

152156
.sidebar-desktop-content {
153-
@apply flex-1 overflow-hidden px-4 py-2;
157+
@apply flex-1 overflow-hidden px-2 py-2;
154158
}
155159

156160
.loading-container {
@@ -560,106 +564,6 @@
560564
@apply text-muted-foreground;
561565
}
562566

563-
.markdown-container {
564-
@apply w-full;
565-
}
566-
567-
.markdown-card-variant-default {
568-
@apply bg-card;
569-
}
570-
571-
.markdown-card-variant-outline {
572-
@apply border rounded-lg;
573-
}
574-
575-
.markdown-card-variant-ghost {
576-
@apply bg-transparent border-none shadow-none;
577-
}
578-
579-
.markdown-card-content {
580-
@apply prose prose-sm md:prose-base lg:prose-lg dark:prose-invert max-w-none;
581-
}
582-
583-
.markdown-headings {
584-
@apply prose-headings:scroll-m-20;
585-
}
586-
587-
.markdown-paragraph {
588-
@apply prose-p:leading-7;
589-
}
590-
591-
.markdown-list {
592-
@apply prose-li:marker:text-muted-foreground;
593-
}
594-
595-
.markdown-pre {
596-
@apply prose-pre:p-0 prose-pre:bg-transparent prose-pre:shadow-lg;
597-
}
598-
599-
.markdown-code {
600-
@apply prose-code:text-zinc-900 dark:prose-code:text-zinc-100;
601-
}
602-
603-
.markdown-padding {
604-
@apply p-0;
605-
}
606-
607-
.markdown-heading-1 {
608-
@apply scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl;
609-
}
610-
611-
.markdown-heading-2 {
612-
@apply scroll-m-20 pb-2 text-3xl font-semibold tracking-tight first:mt-0;
613-
}
614-
615-
.markdown-heading-3 {
616-
@apply scroll-m-20 text-2xl font-semibold tracking-tight;
617-
}
618-
619-
.markdown-link {
620-
@apply font-medium text-primary underline underline-offset-4;
621-
}
622-
623-
.markdown-pre-wrapper {
624-
@apply mb-2 mt-2 overflow-x-auto rounded-lg bg-zinc-950 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 p-4 shadow-sm;
625-
}
626-
627-
.markdown-inline-code {
628-
@apply relative rounded px-[0.3rem] py-[0.2rem] font-mono text-sm bg-zinc-100 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 whitespace-normal inline-block;
629-
}
630-
631-
.markdown-code-lang {
632-
@apply absolute right-2 top-2 z-10 rounded-md bg-zinc-700 px-2 py-1 text-xs font-medium text-zinc-200;
633-
}
634-
635-
.markdown-blockquote {
636-
@apply mt-2 border-l-2 pl-6 italic;
637-
}
638-
639-
.markdown-ul {
640-
@apply my-2 ml-6 list-disc [&>li]:mt-2;
641-
}
642-
643-
.markdown-ol {
644-
@apply my-2 ml-6 list-decimal [&>li]:mt-2;
645-
}
646-
647-
.markdown-table-wrapper {
648-
@apply my-4 w-full overflow-y-auto;
649-
}
650-
651-
.markdown-table {
652-
@apply w-full;
653-
}
654-
655-
.markdown-th {
656-
@apply border px-4 py-2 text-left font-bold [&[align=center]]:text-center [&[align=right]]:text-right;
657-
}
658-
659-
.markdown-td {
660-
@apply border px-4 py-2 text-left [&[align=center]]:text-center [&[align=right]]:text-right;
661-
}
662-
663567
.image-widget-container {
664568
@apply overflow-hidden;
665569
}
@@ -832,3 +736,8 @@
832736
.dag-visualizer-tooltip-content {
833737
@apply text-xs;
834738
}
739+
740+
/* Platform/Section Headers in Sidebar */
741+
.sidebar-section-header {
742+
@apply px-2 py-4 text-xs font-medium text-muted-foreground/70 uppercase tracking-wider;
743+
}

frontend/src/components/DynamicComponents.jsx

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,7 @@ class ErrorBoundary extends React.Component {
6565

6666
// Memoized component wrapper
6767
const MemoizedComponent = memo(
68-
({
69-
component,
70-
index,
71-
handleUpdate,
72-
extractKeyProps,
73-
sidebarOpen,
74-
setSidebarOpen,
75-
isCollapsed,
76-
setIsCollapsed,
77-
}) => {
68+
({ component, index, handleUpdate, extractKeyProps }) => {
7869
const [componentId, componentKey, props] = extractKeyProps(component, index);
7970

8071
switch (component.type) {
@@ -248,12 +239,6 @@ const MemoizedComponent = memo(
248239
key={componentKey}
249240
{...props}
250241
rowData={component.data || []}
251-
title={component.title || 'Table Viewer'}
252-
variant={component.variant || 'default'}
253-
showTitle={component.showTitle ?? true}
254-
striped={component.striped ?? true}
255-
dense={component.dense ?? false}
256-
hoverable={component.hoverable ?? true}
257242
className={component.className}
258243
/>
259244
);

frontend/src/components/Layout.jsx

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
11
'use client';
22

3-
import {
4-
ChartBarIcon,
5-
ClockIcon,
6-
DocumentTextIcon,
7-
GlobeAltIcon,
8-
HomeIcon,
9-
MagnifyingGlassIcon,
10-
ServerIcon,
11-
Squares2X2Icon,
12-
} from '@heroicons/react/24/solid';
13-
143
import React, { useState } from 'react';
154
import { useEffect } from 'react';
16-
import { Outlet } from 'react-router-dom';
175

186
export default function Layout({ branding, children }) {
197
const [faviconLoaded, setFaviconLoaded] = useState(false);
@@ -72,11 +60,9 @@ export default function Layout({ branding, children }) {
7260

7361
return (
7462
<div className="min-h-screen bg-background">
75-
<div id="sidebar-portal" />
76-
{/* Main Content */}
77-
<div className="flex flex-col min-h-screen main-content-layout">
78-
<main className="flex-1 py-10">
79-
<div className="px-4 sm:px-6 lg:px-8">{children}</div>
63+
<div className="flex min-h-screen relative">
64+
<main className="flex-1 main-content-layout relative z-0">
65+
<div className="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10">{children}</div>
8066
</main>
8167
</div>
8268
</div>

0 commit comments

Comments
 (0)