mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-21 08:59:07 +01:00
Tweak tab padding
This commit is contained in:
@@ -1,8 +1,7 @@
|
|||||||
import useResizeObserver from '@react-hook/resize-observer';
|
import useResizeObserver from '@react-hook/resize-observer';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import type { CSSProperties, FormEvent } from 'react';
|
import type { CSSProperties, FormEvent } from 'react';
|
||||||
import React, { useCallback, useMemo, useRef } from 'react';
|
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
||||||
import { useDebouncedState } from '../hooks/useDebouncedState';
|
|
||||||
import type { ReflectResponseService } from '../hooks/useGrpc';
|
import type { ReflectResponseService } from '../hooks/useGrpc';
|
||||||
import { useGrpcConnections } from '../hooks/useGrpcConnections';
|
import { useGrpcConnections } from '../hooks/useGrpcConnections';
|
||||||
import { useUpdateGrpcRequest } from '../hooks/useUpdateGrpcRequest';
|
import { useUpdateGrpcRequest } from '../hooks/useUpdateGrpcRequest';
|
||||||
@@ -58,7 +57,7 @@ export function GrpcConnectionSetupPane({
|
|||||||
const activeConnection = connections[0] ?? null;
|
const activeConnection = connections[0] ?? null;
|
||||||
const isStreaming = activeConnection?.elapsed === 0;
|
const isStreaming = activeConnection?.elapsed === 0;
|
||||||
|
|
||||||
const [paneSize, setPaneSize] = useDebouncedState(99999, 100);
|
const [paneSize, setPaneSize] = useState(99999);
|
||||||
const urlContainerEl = useRef<HTMLDivElement>(null);
|
const urlContainerEl = useRef<HTMLDivElement>(null);
|
||||||
useResizeObserver<HTMLDivElement>(urlContainerEl.current, (entry) => {
|
useResizeObserver<HTMLDivElement>(urlContainerEl.current, (entry) => {
|
||||||
setPaneSize(entry.contentRect.width);
|
setPaneSize(entry.contentRect.width);
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|||||||
import { useLocalStorage } from 'react-use';
|
import { useLocalStorage } from 'react-use';
|
||||||
import { useActiveRequestId } from '../../hooks/useActiveRequestId';
|
import { useActiveRequestId } from '../../hooks/useActiveRequestId';
|
||||||
import { useActiveWorkspaceId } from '../../hooks/useActiveWorkspaceId';
|
import { useActiveWorkspaceId } from '../../hooks/useActiveWorkspaceId';
|
||||||
import { useDebouncedState } from '../../hooks/useDebouncedState';
|
|
||||||
import { clamp } from '../../lib/clamp';
|
import { clamp } from '../../lib/clamp';
|
||||||
import { ResizeHandle } from '../ResizeHandle';
|
import { ResizeHandle } from '../ResizeHandle';
|
||||||
import { HotKeyList } from './HotKeyList';
|
import { HotKeyList } from './HotKeyList';
|
||||||
@@ -31,7 +30,7 @@ const areaL = { gridArea: 'left' };
|
|||||||
const areaR = { gridArea: 'right' };
|
const areaR = { gridArea: 'right' };
|
||||||
const areaD = { gridArea: 'drag' };
|
const areaD = { gridArea: 'drag' };
|
||||||
|
|
||||||
const STACK_VERTICAL_WIDTH = 700;
|
const STACK_VERTICAL_WIDTH = 500;
|
||||||
|
|
||||||
export function SplitLayout({
|
export function SplitLayout({
|
||||||
style,
|
style,
|
||||||
@@ -45,7 +44,7 @@ export function SplitLayout({
|
|||||||
minWidthPx = 10,
|
minWidthPx = 10,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const containerRef = useRef<HTMLDivElement>(null);
|
const containerRef = useRef<HTMLDivElement>(null);
|
||||||
const [vertical, setVertical] = useDebouncedState<boolean>(false, 100);
|
const [vertical, setVertical] = useState<boolean>(false);
|
||||||
const [widthRaw, setWidth] = useLocalStorage<number>(`${name}_width::${useActiveWorkspaceId()}`);
|
const [widthRaw, setWidth] = useLocalStorage<number>(`${name}_width::${useActiveWorkspaceId()}`);
|
||||||
const [heightRaw, setHeight] = useLocalStorage<number>(
|
const [heightRaw, setHeight] = useLocalStorage<number>(
|
||||||
`${name}_height::${useActiveWorkspaceId()}`,
|
`${name}_height::${useActiveWorkspaceId()}`,
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export function Tabs({
|
|||||||
tabListClassName,
|
tabListClassName,
|
||||||
'flex items-center overflow-x-auto overflow-y-visible hide-scrollbars mt-1 mb-2',
|
'flex items-center overflow-x-auto overflow-y-visible hide-scrollbars mt-1 mb-2',
|
||||||
// Give space for button focus states within overflow boundary.
|
// Give space for button focus states within overflow boundary.
|
||||||
'-mx-5 pl-3 py-1',
|
'-ml-5 pl-3 pr-1 py-1',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<HStack space={2} className="flex-shrink-0">
|
<HStack space={2} className="flex-shrink-0">
|
||||||
|
|||||||
Reference in New Issue
Block a user