Skip to content

feat(panel): add tabs for the Panel - #7

Closed
pratikbuilds wants to merge 1 commit into
conversation/09-prompt-input-toolbarfrom
conversation/13-panel-tabs
Closed

pratikbuilds wants to merge 1 commit into
conversation/09-prompt-input-toolbarfrom
conversation/13-panel-tabs

Conversation

@pratikbuilds

Copy link
Copy Markdown
Owner

Add PanelTabs, PanelTab and PanelTabAdd. Tabs select by click, close by the close button, middle-click or Delete, reorder by drag and by Ctrl/Cmd+Shift+Arrow, and move by Arrow, Home and End; a long row keeps the selected tab in view. useTabs owns the open tabs and which one is selected, and useTabDrag reorders without rendering until release. These are separate from the existing Tabs.

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

Notes for review

  • Selection and the open-tab list live in useTabs (defaultTabs/onTabsChange; value/defaultValue/onValueChange), so one place decides which tab takes over on close (right neighbour, else left).
  • The × is aria-hidden and not focusable (a tablist may only contain tabs); keyboard and screen-reader users close with Delete, which each tab announces.
  • Drag is mouse/pen only (touch scrolls the row); no auto-scroll at the edges while dragging; Ctrl/Cmd+Shift+Arrow moves anywhere.
  • Layout: give the tab PanelHeader items-end bg-muted pt-1.5 pb-0; PanelTabAdd sits beside PanelTabs; spread paneProps(value) on each PanelPane.

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#107

Add PanelTabs, PanelTab and PanelTabAdd. Tabs select by click, close
by the close button, middle-click or Delete, reorder by drag and by
Ctrl/Cmd+Shift+Arrow, and move by Arrow, Home and End; a long row keeps
the selected tab in view. useTabs owns the open tabs and which one is
selected, and useTabDrag reorders without rendering until release.
These are separate from the existing Tabs.
@pratikbuilds

Copy link
Copy Markdown
Owner Author

Moved upstream: corbitsdev#119

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