Skip to content

Add Panel #106

Closed
Closed

Description

@pratikbuilds

Add a side panel resized from its edge, with a header, actions and panes that keep their state while hidden.

Part of #94.

Why

Threads, files and other side content open in a panel beside the chat. People resize it, switch between panes and expect to come back to the scroll position and the text they left. The existing PagePanel and SidebarPanel stay as they are; the old ChatPanel is deleted at the cutover (#110).

What

  • src/ui/panel.tsx: Panel (width, onWidthChange), PanelHandle, PanelHeader, PanelActions, PanelClose, PanelContent (keepMounted), PanelPane.
  • src/hooks/use-resizable.ts: width clamping, keyboard steps, reset, and the main area's minimum width.
  • stories/chat/panel.stories.tsx: wide, narrow-screen overlay, several panes.
  • e2e/fixtures.tsx: a panel scenario with a text field in each pane, with e2e/panel.spec.ts.
  • Unit tests for the hook; exports in src/index.ts.

Requirements

  • R39: resizes from PanelHandle by pointer (no React render while dragging) and by arrow keys; resets on double-click or Enter; the main area keeps a minimum width; narrow screens get an overlay; PanelContent with keepMounted keeps a hidden pane's scroll position and typed text.
  • R5–R12: the shared component rules (width is controllable).

Constraints

Done when

  • Unit tests cover useResizable: clamps to min and max; keeps the main area's minimum; arrow keys step; reset returns to the default.
  • Browser spec covers:
    • Dragging resizes without React renders during the drag.
    • Double-click resets.
    • Text typed in a hidden pane survives showing it again.
  • No serious or critical axe violation in the new stories, in light or dark.
  • bun run check, bun run build, bun run test:e2e and bun run dep-guard pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions