Skip to content

Commit a51d873

Browse files
authored
Merge pull request #136 from badaitech/fix/sidebar-scroll
fix sidebar scroll
2 parents 4bb1244 + b2559b5 commit a51d873

27 files changed

Lines changed: 161 additions & 30 deletions

File tree

apps/chaingraph-backend/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# @badaitech/chaingraph-backend
22

3+
## 0.1.19
4+
5+
### Patch Changes
6+
7+
- Bump package
8+
- Updated dependencies
9+
- @badaitech/chaingraph-nodes@0.1.19
10+
- @badaitech/chaingraph-trpc@0.1.19
11+
- @badaitech/chaingraph-types@0.1.19
12+
313
## 0.1.18
414

515
### Patch Changes

apps/chaingraph-backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@badaitech/chaingraph-backend",
33
"type": "module",
4-
"version": "0.1.18",
4+
"version": "0.1.19",
55
"private": false,
66
"description": "Backend server for the Chaingraph project",
77
"license": "BUSL-1.1",

apps/chaingraph-frontend/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# @badaitech/chaingraph-frontend
22

3+
## 0.1.19
4+
5+
### Patch Changes
6+
7+
- Bump package
8+
- Updated dependencies
9+
- @badaitech/chaingraph-nodes@0.1.19
10+
- @badaitech/chaingraph-trpc@0.1.19
11+
- @badaitech/chaingraph-types@0.1.19
12+
313
## 0.1.18
414

515
### Patch Changes

apps/chaingraph-frontend/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@badaitech/chaingraph-frontend",
33
"type": "module",
4-
"version": "0.1.18",
4+
"version": "0.1.19",
55
"private": false,
66
"description": "Frontend application for the Chaingraph project",
77
"license": "BUSL-1.1",
@@ -89,6 +89,7 @@
8989
"@xyflow/react": "^12.6.0",
9090
"@xyflow/system": "^0.0.57",
9191
"add": "^2.0.6",
92+
"ahooks": "^3.8.4",
9293
"class-variance-authority": "^0.7.1",
9394
"clsx": "^2.1.1",
9495
"cmdk": "^1.1.1",

apps/chaingraph-frontend/src/components/theme/ThemeProvider.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
* As of the Change Date specified in that file, in accordance with the Business Source License, use of this software will be governed by the Apache License, version 2.0.
77
*/
88

9-
import type { PropsWithChildren } from 'react'
9+
import type { CSSProperties, PropsWithChildren } from 'react'
1010
import type { ThemeMode } from './ThemeContext'
11+
import { cn } from '@/lib/utils'
1112
import { Theme } from '@radix-ui/themes'
1213
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
14+
import { useShadowRoot } from '../ui/useShadowRoot'
1315
import { ThemeContext } from './ThemeContext'
1416

1517
const localStorageKeyPrefix = 'chaingraph:'
@@ -18,9 +20,11 @@ const localStorageKeyTheme = `${localStorageKeyPrefix}theme`
1820
export interface ThemeProviderProps extends PropsWithChildren {
1921
theme?: ThemeMode
2022
className?: string
23+
style?: CSSProperties
2124
}
2225

23-
export function ThemeProvider({ children, theme }: ThemeProviderProps) {
26+
export function ThemeProvider({ children, style, className, theme }: ThemeProviderProps) {
27+
const { height } = useShadowRoot()
2428
const [currentTheme, setTheme] = useState<ThemeMode>(() => {
2529
// check if a theme is passed as a prop
2630
if (theme) {
@@ -63,7 +67,7 @@ export function ThemeProvider({ children, theme }: ThemeProviderProps) {
6367

6468
return (
6569
<ThemeContext value={themeProviderValue}>
66-
<Theme className="w-full h-full" appearance={themeProviderValue.theme}>
70+
<Theme style={{ height, minHeight: height, ...style }} className={cn('w-full h-full', className)} appearance={themeProviderValue.theme}>
6771
{children}
6872
</Theme>
6973
</ThemeContext>

apps/chaingraph-frontend/src/components/ui/alert-dialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ function AlertDialogOverlay({ ref, className, ...props }: React.ComponentPropsWi
3434
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName
3535

3636
function AlertDialogContent({ ref, className, ...props }: React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content> & { ref?: React.RefObject<React.ElementRef<typeof AlertDialogPrimitive.Content> | null> }) {
37-
const shadowRoot = useShadowRoot()
38-
const portalEl = shadowRoot.getElementById('chaingraph-portal')
37+
const { root } = useShadowRoot()
38+
const portalEl = root.getElementById('chaingraph-portal')
3939
return (
4040
<AlertDialogPortal container={portalEl}>
4141
<AlertDialogOverlay />

apps/chaingraph-frontend/src/components/ui/context-menu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ function ContextMenuSubContent({ ref, className, ...props }: React.ComponentProp
6060
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName
6161

6262
function ContextMenuContent({ ref, className, ...props }: React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content> & { ref?: React.RefObject<React.ElementRef<typeof ContextMenuPrimitive.Content> | null> }) {
63-
const shadowRoot = useShadowRoot()
64-
const portalEl = shadowRoot.getElementById('chaingraph-portal')
63+
const { root } = useShadowRoot()
64+
const portalEl = root.getElementById('chaingraph-portal')
6565
return (
6666
<ContextMenuPrimitive.Portal container={portalEl}>
6767
<ContextMenuPrimitive.Content

apps/chaingraph-frontend/src/components/ui/dialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ function DialogOverlay({ ref, className, ...props }: React.ComponentPropsWithout
3636
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
3737

3838
function DialogContent({ ref, className, children, ...props }: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & { ref?: React.RefObject<React.ElementRef<typeof DialogPrimitive.Content> | null> }) {
39-
const shadowRoot = useShadowRoot()
40-
const portalEl = shadowRoot.getElementById('chaingraph-portal')
39+
const { root } = useShadowRoot()
40+
const portalEl = root.getElementById('chaingraph-portal')
4141
return (
4242
<DialogPortal container={portalEl}>
4343
<DialogOverlay />

apps/chaingraph-frontend/src/components/ui/dropdown-menu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ DropdownMenuSubContent.displayName
6262
= DropdownMenuPrimitive.SubContent.displayName
6363

6464
function DropdownMenuContent({ ref, className, sideOffset = 4, ...props }: React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> & { ref?: React.RefObject<React.ElementRef<typeof DropdownMenuPrimitive.Content> | null> }) {
65-
const shadowRoot = useShadowRoot()
66-
const portalEl = shadowRoot.getElementById('chaingraph-portal')
65+
const { root } = useShadowRoot()
66+
const portalEl = root.getElementById('chaingraph-portal')
6767
return (
6868
<DropdownMenuPrimitive.Portal container={portalEl}>
6969
<DropdownMenuPrimitive.Content

apps/chaingraph-frontend/src/components/ui/popover.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const PopoverTrigger = PopoverPrimitive.Trigger
1818
const PopoverAnchor = PopoverPrimitive.Anchor
1919

2020
function PopoverContent({ ref, className, align = 'center', sideOffset = 4, ...props }: React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & { ref?: React.RefObject<React.ElementRef<typeof PopoverPrimitive.Content> | null> }) {
21-
const shadowRoot = useShadowRoot()
22-
const portalEl = shadowRoot.getElementById('chaingraph-portal')
21+
const { root } = useShadowRoot()
22+
const portalEl = root.getElementById('chaingraph-portal')
2323
return (
2424
<PopoverPrimitive.Portal container={portalEl}>
2525
<PopoverPrimitive.Content

0 commit comments

Comments
 (0)