Better sidebar collapse, debuonce container uqeries, fix recent requests

This commit is contained in:
Gregory Schier
2024-02-15 15:07:15 -08:00
parent fe4696daf7
commit b7d9f0bf92
10 changed files with 36 additions and 28 deletions

View File

@@ -5,6 +5,7 @@ import React, { useCallback, useMemo, useRef, useState } from 'react';
import { useLocalStorage } from 'react-use';
import { useActiveRequestId } from '../../hooks/useActiveRequestId';
import { useActiveWorkspaceId } from '../../hooks/useActiveWorkspaceId';
import { useDebouncedState } from '../../hooks/useDebouncedState';
import { clamp } from '../../lib/clamp';
import { ResizeHandle } from '../ResizeHandle';
import { HotKeyList } from './HotKeyList';
@@ -44,7 +45,7 @@ export function SplitLayout({
minWidthPx = 10,
}: Props) {
const containerRef = useRef<HTMLDivElement>(null);
const [vertical, setVertical] = useState<boolean>(false);
const [vertical, setVertical] = useDebouncedState<boolean>(false, 100);
const [widthRaw, setWidth] = useLocalStorage<number>(`${name}_width::${useActiveWorkspaceId()}`);
const [heightRaw, setHeight] = useLocalStorage<number>(
`${name}_height::${useActiveWorkspaceId()}`,