diff --git a/README.md b/README.md index da372cb3..c98323da 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,7 @@ Everything imports from `@corbits/react-ui`, except rows marked "optional peer", | `VoiceWaveform` | Live audio level bars | | `DictationStatusLine` | Composer dictation status row | | `MicPermissionDialog` | Microphone permission prompt (optional peer, `ui/mic-permission-dialog`) | +| `Panel` | Side panel resized from its edge; hidden panes keep their state | #### Runs diff --git a/e2e/fixtures.tsx b/e2e/fixtures.tsx index f4b578db..f8da0c5b 100644 --- a/e2e/fixtures.tsx +++ b/e2e/fixtures.tsx @@ -1,4 +1,4 @@ -import { useEffect, useLayoutEffect, useState } from "react"; +import { useEffect, useLayoutEffect, useState, Profiler } from "react"; import type { ReactNode } from "react"; import { @@ -28,6 +28,13 @@ import { PromptInputTextarea, type PromptInputStatus, type PromptToken, + Panel, + PanelActions, + PanelClose, + PanelContent, + PanelHandle, + PanelHeader, + PanelPane, } from "@corbits/react-ui"; import { CommandPalette, @@ -609,6 +616,73 @@ function PromptWithAttachment() { ); } +/** Counts React commits on `` without rendering anything. */ +function countCommit() { + const body = document.body; + body.dataset["commits"] = String(Number(body.dataset["commits"] ?? 0) + 1); +} + +/** A tall filler, so each pane scrolls. */ +function Filler({ label }: { label: string }) { + return ( +
    + {Array.from({ length: 60 }, (_, index) => ( +
  1. + {label} line {index + 1} +
  2. + ))} +
+ ); +} + +function PanelScenario() { + const [open, setOpen] = useState(true); + const [shown, setShown] = useState("notes"); + const [width, setWidth] = useState(null); + return ( + +
+
+ + + + + {width === null ? "default" : String(width)} + +
+ {open ? ( + + + + + setOpen(false)} /> + + + + + + + + +