Skip to content

feat(panel): add a resizable Panel with keep-mounted panes - #4

Closed
pratikbuilds wants to merge 1 commit into
conversation/08-prompt-inputfrom
conversation/12-panel
Closed

pratikbuilds wants to merge 1 commit into
conversation/08-prompt-inputfrom
conversation/12-panel

Conversation

@pratikbuilds

Copy link
Copy Markdown
Owner

Panel resizes from PanelHandle by pointer without a React render while dragging, by arrow keys, and resets on double-click or Enter. The main area keeps a minimum width and a narrow container gets an overlay. PanelContent with keepMounted keeps a hidden pane's scroll position and typed text. useResizable holds the width logic.

Stacked on #3: review only this commit. Part of corbitsdev#94.

Notes for review

  • Width is a CSS variable written by useResizable; zero React renders while dragging (e2e counts renders), one save on release.
  • Overlay uses a container query (row narrower than 48rem), not a viewport breakpoint, so a sidebar beside the row counts; the consumer marks the row @container.
  • Layout rule: Panel is the last child of a @container relative flex row (no gap) holding a min-w-0 flex-1 main area and the panel.
  • PanelContent value is controlled only: the consumer's tabs own which pane shows.
  • Extra props: minWidth (320), mainMinWidth (440), defaultWidth; label on PanelHandle/PanelClose. README Chat table gains a Panel row.

Verification

  • This commit passes bun run typecheck and bun run lint on its own (the stack is checked commit by commit).
  • At the top of the stack: bun run check, bun run build, bun run dep-guard, bun run contrast-test and bun run test:e2e (Playwright specs and the Storybook axe sweep in light and dark) pass.

Closes corbitsdev#106

Panel resizes from PanelHandle by pointer without a React render while
dragging, by arrow keys, and resets on double-click or Enter. The main
area keeps a minimum width and a narrow container gets an overlay.
PanelContent with keepMounted keeps a hidden pane's scroll position and
typed text. useResizable holds the width logic.
@pratikbuilds

Copy link
Copy Markdown
Owner Author

Moved upstream: corbitsdev#116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant